GitHub PullRequestReviewCommentEvent at 2014-10-07 16:00:20
Repository: scikit-learn
Actor: MechCoder
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/comments/18528790","id":18528790,"diff_hunk":"@@ -170,14 +256,30 @@ def mean_squared_error(y_true, y_pred, sample_weight=None):\n     >>> y_pred = [[0, 2],[-1, 2],[8, -5]]\n     >>> mean_squared_error(y_true, y_pred)  # doctest: +ELLIPSIS\n     0.708...\n+    >>> mean_squared_error(y_true, y_pred, output_weights=None)\n+    ... # doctest: +ELLIPSIS\n+    array([ 0.416...,  1.        ])\n+    >>> mean_squared_error(y_true, y_pred, output_weights=[0.3, 0.7])\n+    ... # doctest: +ELLIPSIS\n+    0.824...\n \n     \"\"\"\n-    y_type, y_true, y_pred = _check_reg_targets(y_true, y_pred)\n-    return np.average(((y_pred - y_true) ** 2).mean(axis=1),\n-                      weights=sample_weight)\n-\n-\n-def explained_variance_score(y_true, y_pred, sample_weight=None):\n+    y_type, y_true, y_pred, output_weights = _check_reg_targets(\n+        y_true, y_pred, output_weights)\n+    output_errors = np.average((y_true - y_pred) ** 2, axis=0,\n+                                   weights=sample_weight)\n+    if output_weights is None:\n+        return output_errors\n+    elif output_weights == 'uniform':\n+        # pass None as weights to np.average: uniform mean\n+        output_weights = None\n+","path":"sklearn/metrics/regression.py","position":240,"original_position":240,"commit_id":"e40235e8ccc83086ace334a2e2a36ca4241543a6","original_commit_id":"e40235e8ccc83086ace334a2e2a36ca4241543a6","user":{"login":"MechCoder","id":1867024,"avatar_url":"https://avatars.githubusercontent.com/u/1867024?v=2","gravatar_id":"","url":"https://api.github.com/users/MechCoder","html_url":"https://github.com/MechCoder","followers_url":"https://api.github.com/users/MechCoder/followers","following_url":"https://api.github.com/users/MechCoder/following{/other_user}","gists_url":"https://api.github.com/users/MechCoder/gists{/gist_id}","starred_url":"https://api.github.com/users/MechCoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MechCoder/subscriptions","organizations_url":"https://api.github.com/users/MechCoder/orgs","repos_url":"https://api.github.com/users/MechCoder/repos","events_url":"https://api.github.com/users/MechCoder/events{/privacy}","received_events_url":"https://api.github.com/users/MechCoder/received_events","type":"User","site_admin":false},"body":"Same comment here.","created_at":"2014-10-07T16:00:20Z","updated_at":"2014-10-07T16:00:20Z","html_url":"https://github.com/scikit-learn/scikit-learn/pull/3474#discussion_r18528790","pull_request_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/3474","_links":{"self":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/comments/18528790"},"html":{"href":"https://github.com/scikit-learn/scikit-learn/pull/3474#discussion_r18528790"},"pull_request":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/3474"}}},"pull_request":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/3474","id":18742185,"html_url":"https://github.com/scikit-learn/scikit-learn/pull/3474","diff_url":"https://github.com/scikit-learn/scikit-learn/pull/3474.diff","patch_url":"https://github.com/scikit-learn/scikit-learn/pull/3474.patch","issue_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/3474","number":3474,"state":"open","locked":false,"title":"[MRG+1] Multi-output scoring, or 2493 cont'd for real","user":{"login":"eickenberg","id":1306635,"avatar_url":"https://avatars.githubusercontent.com/u/1306635?v=2","gravatar_id":"","url":"https://api.github.com/users/eickenberg","html_url":"https://github.com/eickenberg","followers_url":"https://api.github.com/users/eickenberg/followers","following_url":"https://api.github.com/users/eickenberg/following{/other_user}","gists_url":"https://api.github.com/users/eickenberg/gists{/gist_id}","starred_url":"https://api.github.com/users/eickenberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eickenberg/subscriptions","organizations_url":"https://api.github.com/users/eickenberg/orgs","repos_url":"https://api.github.com/users/eickenberg/repos","events_url":"https://api.github.com/users/eickenberg/events{/privacy}","received_events_url":"https://api.github.com/users/eickenberg/received_events","type":"User","site_admin":false},"body":"This time taking into account the refactoring of metrics.py into several files.\r\n\r\nThis replaces https://github.com/scikit-learn/scikit-learn/pull/3456, which I closed.","created_at":"2014-07-22T21:11:49Z","updated_at":"2014-10-07T16:00:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"24abf33529abd62c3bb9bd07105e276c36132521","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/3474/commits","review_comments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/3474/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/3474/comments","statuses_url":"https://api.github.com/repos/scikit-learn/scikit-learn/statuses/e40235e8ccc83086ace334a2e2a36ca4241543a6","head":{"label":"eickenberg:2493b2","ref":"2493b2","sha":"e40235e8ccc83086ace334a2e2a36ca4241543a6","user":{"login":"eickenberg","id":1306635,"avatar_url":"https://avatars.githubusercontent.com/u/1306635?v=2","gravatar_id":"","url":"https://api.github.com/users/eickenberg","html_url":"https://github.com/eickenberg","followers_url":"https://api.github.com/users/eickenberg/followers","following_url":"https://api.github.com/users/eickenberg/following{/other_user}","gists_url":"https://api.github.com/users/eickenberg/gists{/gist_id}","starred_url":"https://api.github.com/users/eickenberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eickenberg/subscriptions","organizations_url":"https://api.github.com/users/eickenberg/orgs","repos_url":"https://api.github.com/users/eickenberg/repos","events_url":"https://api.github.com/users/eickenberg/events{/privacy}","received_events_url":"https://api.github.com/users/eickenberg/received_events","type":"User","site_admin":false},"repo":{"id":3110055,"name":"scikit-learn","full_name":"eickenberg/scikit-learn","owner":{"login":"eickenberg","id":1306635,"avatar_url":"https://avatars.githubusercontent.com/u/1306635?v=2","gravatar_id":"","url":"https://api.github.com/users/eickenberg","html_url":"https://github.com/eickenberg","followers_url":"https://api.github.com/users/eickenberg/followers","following_url":"https://api.github.com/users/eickenberg/following{/other_user}","gists_url":"https://api.github.com/users/eickenberg/gists{/gist_id}","starred_url":"https://api.github.com/users/eickenberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eickenberg/subscriptions","organizations_url":"https://api.github.com/users/eickenberg/orgs","repos_url":"https://api.github.com/users/eickenberg/repos","events_url":"https://api.github.com/users/eickenberg/events{/privacy}","received_events_url":"https://api.github.com/users/eickenberg/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/eickenberg/scikit-learn","description":"scikit-learn: machine learning in Python","fork":true,"url":"https://api.github.com/repos/eickenberg/scikit-learn","forks_url":"https://api.github.com/repos/eickenberg/scikit-learn/forks","keys_url":"https://api.github.com/repos/eickenberg/scikit-learn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eickenberg/scikit-learn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eickenberg/scikit-learn/teams","hooks_url":"https://api.github.com/repos/eickenberg/scikit-learn/hooks","issue_events_url":"https://api.github.com/repos/eickenberg/scikit-learn/issues/events{/number}","events_url":"https://api.github.com/repos/eickenberg/scikit-learn/events","assignees_url":"https://api.github.com/repos/eickenberg/scikit-learn/assignees{/user}","branches_url":"https://api.github.com/repos/eickenberg/scikit-learn/branches{/branch}","tags_url":"https://api.github.com/repos/eickenberg/scikit-learn/tags","blobs_url":"https://api.github.com/repos/eickenberg/scikit-learn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eickenberg/scikit-learn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eickenberg/scikit-learn/git/refs{/sha}","trees_url":"https://api.github.com/repos/eickenberg/scikit-learn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eickenberg/scikit-learn/statuses/{sha}","languages_url":"https://api.github.com/repos/eickenberg/scikit-learn/languages","stargazers_url":"https://api.github.com/repos/eickenberg/scikit-learn/stargazers","contributors_url":"https://api.github.com/repos/eickenberg/scikit-learn/contributors","subscribers_url":"https://api.github.com/repos/eickenberg/scikit-learn/subscribers","subscription_url":"https://api.github.com/repos/eickenberg/scikit-learn/subscription","commits_url":"https://api.github.com/repos/eickenberg/scikit-learn/commits{/sha}","git_commits_url":"https://api.github.com/repos/eickenberg/scikit-learn/git/commits{/sha}","comments_url":"https://api.github.com/repos/eickenberg/scikit-learn/comments{/number}","issue_comment_url":"https://api.github.com/repos/eickenberg/scikit-learn/issues/comments/{number}","contents_url":"https://api.github.com/repos/eickenberg/scikit-learn/contents/{+path}","compare_url":"https://api.github.com/repos/eickenberg/scikit-learn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eickenberg/scikit-learn/merges","archive_url":"https://api.github.com/repos/eickenberg/scikit-learn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eickenberg/scikit-learn/downloads","issues_url":"https://api.github.com/repos/eickenberg/scikit-learn/issues{/number}","pulls_url":"https://api.github.com/repos/eickenberg/scikit-learn/pulls{/number}","milestones_url":"https://api.github.com/repos/eickenberg/scikit-learn/milestones{/number}","notifications_url":"https://api.github.com/repos/eickenberg/scikit-learn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eickenberg/scikit-learn/labels{/name}","releases_url":"https://api.github.com/repos/eickenberg/scikit-learn/releases{/id}","created_at":"2012-01-05T12:54:04Z","updated_at":"2014-07-14T15:12:03Z","pushed_at":"2014-08-20T09:47:20Z","git_url":"git://github.com/eickenberg/scikit-learn.git","ssh_url":"git@github.com:eickenberg/scikit-learn.git","clone_url":"https://github.com/eickenberg/scikit-learn.git","svn_url":"https://github.com/eickenberg/scikit-learn","homepage":"http://scikit-learn.org","size":54045,"stargazers_count":2,"watchers_count":2,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":2,"default_branch":"master"}},"base":{"label":"scikit-learn:master","ref":"master","sha":"4b82379c20ecb6f5a7fd68443202a17e66e72307","user":{"login":"scikit-learn","id":365630,"avatar_url":"https://avatars.githubusercontent.com/u/365630?v=2","gravatar_id":"","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":"","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-10-07T08:46:34Z","pushed_at":"2014-10-07T15:14: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":121341,"stargazers_count":4025,"watchers_count":4025,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2271,"mirror_url":null,"open_issues_count":512,"forks":2271,"open_issues":512,"watchers":4025,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/3474"},"html":{"href":"https://github.com/scikit-learn/scikit-learn/pull/3474"},"issue":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/3474"},"comments":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/3474/comments"},"review_comments":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/3474/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/3474/commits"},"statuses":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/statuses/e40235e8ccc83086ace334a2e2a36ca4241543a6"}}}}