GitHub PullRequestReviewCommentEvent at 2014-08-13 08:33:13
Repository: scikit-learn
Actor: GaelVaroquaux
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/comments/16163262","id":16163262,"diff_hunk":"@@ -0,0 +1,259 @@\n+.. _neural_network:\n+\n+==================================\n+Neural network models (supervised)\n+==================================\n+\n+.. currentmodule:: sklearn.neural_network\n+\n+\n+.. _elm:\n+\n+Extreme Learning Machines\n+=========================\n+**Extreme Learning Machine (ELM)** is a supervised nonlinear learning \n+algorithm that takes the following consecutive steps for training:\n+\n+  *  it applies a random projection on the input space to a possibly larger \n+     dimensional space;\n+  *  the result passes through an element-wise non-linear activation function,\n+     typically a sigmoid such as the tanh, and logistic functions; and\n+  *  last, it trains a linear one versus all classifier or a multi-output ridge \n+     regression model.\n+\n+ELM can be considered as a single-hidden layer feedforward neural network \n+(see figure 1) where:\n+\n+  *  it trains only the hidden-to-output connection weights;\n+  *  assigns random values, as constants, to the input-to-hidden connection \n+     weights; and\n+  *  minimizes the loss function using least squares.\n+\n+In several empirical studies, ELM was found to have a generalization performance \n+similar to that of 1 hidden layer MLPs or RBF kernel support vector\n+machines while being significantly faster to train.\n+\n+ELM has three main hyper-parameters,\n+\n+  *  `weight_scale`: controls the variance of the random projection weights;\n+  *  `n_hidden`: controls the number of hidden layer nodes; and\n+  *  `C`: controls the regularization strength of the output linear model.\n+\n+`weight_scale` and `C` are similar in that they regularize weight parameters\n+such that a higher value means less regularization hence less underfitting (or bias) but \n+potentially more overfitting (or variance). However, in terms of their effect \n+on the single-hidden layer feedforward network, `weight_scale` regularizes \n+the input-to-hidden connection weights, whereas `C` regularizes the hidden-to-output \n+connection weights. Some examples demonstrating the effect of these two parameters are listed\n+below::\n+\n+.. topic:: Examples:\n+\n+ * :ref:`plot_elm_hyperparameters.py`,\n+ * :ref:`plot_elm_scale_C_and_weight_scale.py`,\n+\n+Higher `n_hidden` provides ELM with a higher capacity to learn complex \n+functions. It allows ELM to have more feature detectors in the hidden \n+layer that characterize the training dataset. \n+\n+.. figure:: ../images/neural_network.png\n+     :align: center\n+     :scale: 60%\n+\n+     Figure 1 : Single-hidden layer feedforward network.\n+\n+This implements :ref:`classification <elm_classification>` for classification \n+and :ref:`regression <elm_regression>` for regression. They support both dense\n+(``numpy.ndarray`` and convertible to that by ``numpy.asarray``) and\n+sparse (any ``scipy.sparse``) sample vectors as input. They also support\n+real-time and batch-based training.\n+\n+\n+.. _elm_classification:\n+\n+Classification\n+==============\n+\n+:class:`ELMClassifier` supports binary-class, multi-class, and\n+multi-label classification on datasets.\n+\n+Like other classifiers, :class:`ELMClassifier` trains on a dataset using the\n+fit method that accepts two input parameters: an array X of size \n+``(n_samples, n_features)``, which represents the training samples, and an array y \n+of integer values of size ``(n_samples)``, which holdis the class labels respective\n+to the training samples::\n+\n+\n+    >>> from sklearn.neural_network import ELMClassifier\n+    >>> X = [[0, 0], [1, 1]]\n+    >>> y = [0, 1]\n+    >>> clf = ELMClassifier(random_state=1)\n+    >>> clf.fit(X, y)\n+    ELMClassifier(C=1, activation='tanh', batch_size=None, class_weight=None,\n+           coef0=0.0, degree=3, gamma=None, kernel='random', n_hidden=500,\n+           random_state=1, verbose=False, warm_start=False,\n+           weight_scale='auto')\n+           \n+After training, the model can predict the class of a new sample::\n+\n+    >>> clf.predict([[2., 2.]])\n+    array([1])\n+\n+\n+.. _elm_bin_multi_class:\n+\n+Binary and multi-class classification\n+--------------------------------------\n+\n+The network has one output neuron for binary classification, and one output\n+neuron per possible class for multi-class classification.\n+\n+In binary classification, if the output for a sample is higher than 0, the \n+sample is assigned to class 1; otherwise it is assigned to class 0.\n+\n+In multi-class classification, the output for a sample passes through softmax\n+which returns a set of probabilities corresponding to each class. The class \n+representing the highest probability becomes the class assigned to the sample.\n+","path":"doc/modules/neural_networks_supervised.rst","position":117,"original_position":117,"commit_id":"ca554f900f0167362c819bca447caf601dfc07ed","original_commit_id":"ca554f900f0167362c819bca447caf601dfc07ed","user":{"login":"GaelVaroquaux","id":208217,"avatar_url":"https://avatars.githubusercontent.com/u/208217?v=2","gravatar_id":"5c9fb379c4e97b58960d74dcbfc5dee5","url":"https://api.github.com/users/GaelVaroquaux","html_url":"https://github.com/GaelVaroquaux","followers_url":"https://api.github.com/users/GaelVaroquaux/followers","following_url":"https://api.github.com/users/GaelVaroquaux/following{/other_user}","gists_url":"https://api.github.com/users/GaelVaroquaux/gists{/gist_id}","starred_url":"https://api.github.com/users/GaelVaroquaux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GaelVaroquaux/subscriptions","organizations_url":"https://api.github.com/users/GaelVaroquaux/orgs","repos_url":"https://api.github.com/users/GaelVaroquaux/repos","events_url":"https://api.github.com/users/GaelVaroquaux/events{/privacy}","received_events_url":"https://api.github.com/users/GaelVaroquaux/received_events","type":"User","site_admin":false},"body":"I don't think that you need this subsection. I would replace it by the sentence 'ELMClassifier supports multi-class classification via the corresponding support in the final supervised estimator'.\r\n\r\nRemember, people are lazy (or simply buzy), so it is important to be synthetic in the documentation.","created_at":"2014-08-13T08:33:13Z","updated_at":"2014-08-13T08:33:13Z","html_url":"https://github.com/scikit-learn/scikit-learn/pull/3306#discussion_r16163262","pull_request_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/3306","_links":{"self":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/comments/16163262"},"html":{"href":"https://github.com/scikit-learn/scikit-learn/pull/3306#discussion_r16163262"},"pull_request":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/3306"}}},"pull_request":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/3306","id":17446637,"html_url":"https://github.com/scikit-learn/scikit-learn/pull/3306","diff_url":"https://github.com/scikit-learn/scikit-learn/pull/3306.diff","patch_url":"https://github.com/scikit-learn/scikit-learn/pull/3306.patch","issue_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/3306","number":3306,"state":"open","title":"GSoC 2014: Standard Extreme Learning Machines","user":{"login":"IssamLaradji","id":3382128,"avatar_url":"https://avatars.githubusercontent.com/u/3382128?v=2","gravatar_id":"e35d22a037b8b35422d3ee982f133076","url":"https://api.github.com/users/IssamLaradji","html_url":"https://github.com/IssamLaradji","followers_url":"https://api.github.com/users/IssamLaradji/followers","following_url":"https://api.github.com/users/IssamLaradji/following{/other_user}","gists_url":"https://api.github.com/users/IssamLaradji/gists{/gist_id}","starred_url":"https://api.github.com/users/IssamLaradji/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IssamLaradji/subscriptions","organizations_url":"https://api.github.com/users/IssamLaradji/orgs","repos_url":"https://api.github.com/users/IssamLaradji/repos","events_url":"https://api.github.com/users/IssamLaradji/events{/privacy}","received_events_url":"https://api.github.com/users/IssamLaradji/received_events","type":"User","site_admin":false},"body":"Finished implementing the standard extreme learning machines (ELMs). I am getting the following results with 550 hidden neurons against the digits datasets,\r\n\r\nTraining accuracy using the logistic activation function: 0.999444\r\nTraining accuracy using the tanh activation function: 1.000000\r\n\r\nFortunately, this algorithm is much easier to implement and debug than multi-layer perceptron :).\r\nI will push a test file soon.\r\n\r\n@ogrisel , @larsmans","created_at":"2014-06-22T08:34:21Z","updated_at":"2014-08-13T08:33:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"325d3475721bdd16c27c2d440e704ff52eaf0981","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/3306/commits","review_comments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/3306/comments","review_comment_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/comments/{number}","comments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/3306/comments","statuses_url":"https://api.github.com/repos/scikit-learn/scikit-learn/statuses/ca554f900f0167362c819bca447caf601dfc07ed","head":{"label":"IssamLaradji:Extreme-Learning-Machines","ref":"Extreme-Learning-Machines","sha":"ca554f900f0167362c819bca447caf601dfc07ed","user":{"login":"IssamLaradji","id":3382128,"avatar_url":"https://avatars.githubusercontent.com/u/3382128?v=2","gravatar_id":"e35d22a037b8b35422d3ee982f133076","url":"https://api.github.com/users/IssamLaradji","html_url":"https://github.com/IssamLaradji","followers_url":"https://api.github.com/users/IssamLaradji/followers","following_url":"https://api.github.com/users/IssamLaradji/following{/other_user}","gists_url":"https://api.github.com/users/IssamLaradji/gists{/gist_id}","starred_url":"https://api.github.com/users/IssamLaradji/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IssamLaradji/subscriptions","organizations_url":"https://api.github.com/users/IssamLaradji/orgs","repos_url":"https://api.github.com/users/IssamLaradji/repos","events_url":"https://api.github.com/users/IssamLaradji/events{/privacy}","received_events_url":"https://api.github.com/users/IssamLaradji/received_events","type":"User","site_admin":false},"repo":{"id":10518207,"name":"scikit-learn","full_name":"IssamLaradji/scikit-learn","owner":{"login":"IssamLaradji","id":3382128,"avatar_url":"https://avatars.githubusercontent.com/u/3382128?v=2","gravatar_id":"e35d22a037b8b35422d3ee982f133076","url":"https://api.github.com/users/IssamLaradji","html_url":"https://github.com/IssamLaradji","followers_url":"https://api.github.com/users/IssamLaradji/followers","following_url":"https://api.github.com/users/IssamLaradji/following{/other_user}","gists_url":"https://api.github.com/users/IssamLaradji/gists{/gist_id}","starred_url":"https://api.github.com/users/IssamLaradji/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IssamLaradji/subscriptions","organizations_url":"https://api.github.com/users/IssamLaradji/orgs","repos_url":"https://api.github.com/users/IssamLaradji/repos","events_url":"https://api.github.com/users/IssamLaradji/events{/privacy}","received_events_url":"https://api.github.com/users/IssamLaradji/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/IssamLaradji/scikit-learn","description":"scikit-learn: machine learning in Python","fork":true,"url":"https://api.github.com/repos/IssamLaradji/scikit-learn","forks_url":"https://api.github.com/repos/IssamLaradji/scikit-learn/forks","keys_url":"https://api.github.com/repos/IssamLaradji/scikit-learn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/IssamLaradji/scikit-learn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/IssamLaradji/scikit-learn/teams","hooks_url":"https://api.github.com/repos/IssamLaradji/scikit-learn/hooks","issue_events_url":"https://api.github.com/repos/IssamLaradji/scikit-learn/issues/events{/number}","events_url":"https://api.github.com/repos/IssamLaradji/scikit-learn/events","assignees_url":"https://api.github.com/repos/IssamLaradji/scikit-learn/assignees{/user}","branches_url":"https://api.github.com/repos/IssamLaradji/scikit-learn/branches{/branch}","tags_url":"https://api.github.com/repos/IssamLaradji/scikit-learn/tags","blobs_url":"https://api.github.com/repos/IssamLaradji/scikit-learn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/IssamLaradji/scikit-learn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/IssamLaradji/scikit-learn/git/refs{/sha}","trees_url":"https://api.github.com/repos/IssamLaradji/scikit-learn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/IssamLaradji/scikit-learn/statuses/{sha}","languages_url":"https://api.github.com/repos/IssamLaradji/scikit-learn/languages","stargazers_url":"https://api.github.com/repos/IssamLaradji/scikit-learn/stargazers","contributors_url":"https://api.github.com/repos/IssamLaradji/scikit-learn/contributors","subscribers_url":"https://api.github.com/repos/IssamLaradji/scikit-learn/subscribers","subscription_url":"https://api.github.com/repos/IssamLaradji/scikit-learn/subscription","commits_url":"https://api.github.com/repos/IssamLaradji/scikit-learn/commits{/sha}","git_commits_url":"https://api.github.com/repos/IssamLaradji/scikit-learn/git/commits{/sha}","comments_url":"https://api.github.com/repos/IssamLaradji/scikit-learn/comments{/number}","issue_comment_url":"https://api.github.com/repos/IssamLaradji/scikit-learn/issues/comments/{number}","contents_url":"https://api.github.com/repos/IssamLaradji/scikit-learn/contents/{+path}","compare_url":"https://api.github.com/repos/IssamLaradji/scikit-learn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/IssamLaradji/scikit-learn/merges","archive_url":"https://api.github.com/repos/IssamLaradji/scikit-learn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/IssamLaradji/scikit-learn/downloads","issues_url":"https://api.github.com/repos/IssamLaradji/scikit-learn/issues{/number}","pulls_url":"https://api.github.com/repos/IssamLaradji/scikit-learn/pulls{/number}","milestones_url":"https://api.github.com/repos/IssamLaradji/scikit-learn/milestones{/number}","notifications_url":"https://api.github.com/repos/IssamLaradji/scikit-learn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/IssamLaradji/scikit-learn/labels{/name}","releases_url":"https://api.github.com/repos/IssamLaradji/scikit-learn/releases{/id}","created_at":"2013-06-06T03:31:53Z","updated_at":"2014-06-24T12:42:31Z","pushed_at":"2014-08-12T17:32:04Z","git_url":"git://github.com/IssamLaradji/scikit-learn.git","ssh_url":"git@github.com:IssamLaradji/scikit-learn.git","clone_url":"https://github.com/IssamLaradji/scikit-learn.git","svn_url":"https://github.com/IssamLaradji/scikit-learn","homepage":"http://scikit-learn.org","size":58326,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"scikit-learn:master","ref":"master","sha":"1f6d6020a8ab22e56133754a37df9da9a7ef1c29","user":{"login":"scikit-learn","id":365630,"avatar_url":"https://avatars.githubusercontent.com/u/365630?v=2","gravatar_id":"8a6ecb57b119c5a5b3d882d08a909278","url":"https://api.github.com/users/scikit-learn","html_url":"https://github.com/scikit-learn","followers_url":"https://api.github.com/users/scikit-learn/followers","following_url":"https://api.github.com/users/scikit-learn/following{/other_user}","gists_url":"https://api.github.com/users/scikit-learn/gists{/gist_id}","starred_url":"https://api.github.com/users/scikit-learn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scikit-learn/subscriptions","organizations_url":"https://api.github.com/users/scikit-learn/orgs","repos_url":"https://api.github.com/users/scikit-learn/repos","events_url":"https://api.github.com/users/scikit-learn/events{/privacy}","received_events_url":"https://api.github.com/users/scikit-learn/received_events","type":"Organization","site_admin":false},"repo":{"id":843222,"name":"scikit-learn","full_name":"scikit-learn/scikit-learn","owner":{"login":"scikit-learn","id":365630,"avatar_url":"https://avatars.githubusercontent.com/u/365630?v=2","gravatar_id":"8a6ecb57b119c5a5b3d882d08a909278","url":"https://api.github.com/users/scikit-learn","html_url":"https://github.com/scikit-learn","followers_url":"https://api.github.com/users/scikit-learn/followers","following_url":"https://api.github.com/users/scikit-learn/following{/other_user}","gists_url":"https://api.github.com/users/scikit-learn/gists{/gist_id}","starred_url":"https://api.github.com/users/scikit-learn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scikit-learn/subscriptions","organizations_url":"https://api.github.com/users/scikit-learn/orgs","repos_url":"https://api.github.com/users/scikit-learn/repos","events_url":"https://api.github.com/users/scikit-learn/events{/privacy}","received_events_url":"https://api.github.com/users/scikit-learn/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/scikit-learn/scikit-learn","description":"scikit-learn: machine learning in Python","fork":false,"url":"https://api.github.com/repos/scikit-learn/scikit-learn","forks_url":"https://api.github.com/repos/scikit-learn/scikit-learn/forks","keys_url":"https://api.github.com/repos/scikit-learn/scikit-learn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scikit-learn/scikit-learn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scikit-learn/scikit-learn/teams","hooks_url":"https://api.github.com/repos/scikit-learn/scikit-learn/hooks","issue_events_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/events{/number}","events_url":"https://api.github.com/repos/scikit-learn/scikit-learn/events","assignees_url":"https://api.github.com/repos/scikit-learn/scikit-learn/assignees{/user}","branches_url":"https://api.github.com/repos/scikit-learn/scikit-learn/branches{/branch}","tags_url":"https://api.github.com/repos/scikit-learn/scikit-learn/tags","blobs_url":"https://api.github.com/repos/scikit-learn/scikit-learn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scikit-learn/scikit-learn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scikit-learn/scikit-learn/git/refs{/sha}","trees_url":"https://api.github.com/repos/scikit-learn/scikit-learn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scikit-learn/scikit-learn/statuses/{sha}","languages_url":"https://api.github.com/repos/scikit-learn/scikit-learn/languages","stargazers_url":"https://api.github.com/repos/scikit-learn/scikit-learn/stargazers","contributors_url":"https://api.github.com/repos/scikit-learn/scikit-learn/contributors","subscribers_url":"https://api.github.com/repos/scikit-learn/scikit-learn/subscribers","subscription_url":"https://api.github.com/repos/scikit-learn/scikit-learn/subscription","commits_url":"https://api.github.com/repos/scikit-learn/scikit-learn/commits{/sha}","git_commits_url":"https://api.github.com/repos/scikit-learn/scikit-learn/git/commits{/sha}","comments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/comments{/number}","issue_comment_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/comments/{number}","contents_url":"https://api.github.com/repos/scikit-learn/scikit-learn/contents/{+path}","compare_url":"https://api.github.com/repos/scikit-learn/scikit-learn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scikit-learn/scikit-learn/merges","archive_url":"https://api.github.com/repos/scikit-learn/scikit-learn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scikit-learn/scikit-learn/downloads","issues_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues{/number}","pulls_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls{/number}","milestones_url":"https://api.github.com/repos/scikit-learn/scikit-learn/milestones{/number}","notifications_url":"https://api.github.com/repos/scikit-learn/scikit-learn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scikit-learn/scikit-learn/labels{/name}","releases_url":"https://api.github.com/repos/scikit-learn/scikit-learn/releases{/id}","created_at":"2010-08-17T09:43:38Z","updated_at":"2014-08-13T02:47:10Z","pushed_at":"2014-08-13T02:58:31Z","git_url":"git://github.com/scikit-learn/scikit-learn.git","ssh_url":"git@github.com:scikit-learn/scikit-learn.git","clone_url":"https://github.com/scikit-learn/scikit-learn.git","svn_url":"https://github.com/scikit-learn/scikit-learn","homepage":"http://scikit-learn.org","size":115772,"stargazers_count":3805,"watchers_count":3805,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":2026,"mirror_url":null,"open_issues_count":461,"forks":2026,"open_issues":461,"watchers":3805,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/3306"},"html":{"href":"https://github.com/scikit-learn/scikit-learn/pull/3306"},"issue":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/3306"},"comments":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/3306/comments"},"review_comments":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/3306/comments"},"review_comment":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/3306/commits"},"statuses":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/statuses/ca554f900f0167362c819bca447caf601dfc07ed"}}}}