GitHub PullRequestReviewCommentEvent at 2014-10-17 09:31:21
Repository: scikit-learn
Actor: MechCoder
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/comments/19008907","id":19008907,"diff_hunk":"@@ -44,3 +44,16 @@ def _rankdata(a, method=\"average\"):\n \n except TypeError as e:\n     rankdata = _rankdata\n+\n+\n+def _weighted_percentile(array, sample_weight, percentile=50):\n+    \"\"\"Compute the weighted ``percentile`` of ``array`` with ``sample_weight``. \"\"\"\n+    sorted_idx = np.argsort(array)\n+\n+    # Find index of median prediction for each sample\n+    weight_cdf = sample_weight[sorted_idx].cumsum()\n+    percentile_or_above = weight_cdf >= (percentile / 100.0) * weight_cdf[-1]\n+    percentile_idx = percentile_or_above.argmax()","path":"sklearn/utils/stats.py","position":13,"original_position":13,"commit_id":"e0f4cd92f28deea9bc1492a5083039157358ce72","original_commit_id":"da31344751000e967ce98d08d1b9bb29d208082b","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":"okay, unless @pprett thinks if it is ok, to change this over here.","created_at":"2014-10-17T09:31:21Z","updated_at":"2014-10-17T09:31:21Z","html_url":"https://github.com/scikit-learn/scikit-learn/pull/3779#discussion_r19008907","pull_request_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/3779","_links":{"self":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/comments/19008907"},"html":{"href":"https://github.com/scikit-learn/scikit-learn/pull/3779#discussion_r19008907"},"pull_request":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/3779"}}},"pull_request":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/3779","id":22858537,"html_url":"https://github.com/scikit-learn/scikit-learn/pull/3779","diff_url":"https://github.com/scikit-learn/scikit-learn/pull/3779.diff","patch_url":"https://github.com/scikit-learn/scikit-learn/pull/3779.patch","issue_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/3779","number":3779,"state":"open","locked":false,"title":"[MRG] Add sample_weight support to Dummy Regressor","user":{"login":"arjoly","id":1274722,"avatar_url":"https://avatars.githubusercontent.com/u/1274722?v=2","gravatar_id":"","url":"https://api.github.com/users/arjoly","html_url":"https://github.com/arjoly","followers_url":"https://api.github.com/users/arjoly/followers","following_url":"https://api.github.com/users/arjoly/following{/other_user}","gists_url":"https://api.github.com/users/arjoly/gists{/gist_id}","starred_url":"https://api.github.com/users/arjoly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arjoly/subscriptions","organizations_url":"https://api.github.com/users/arjoly/orgs","repos_url":"https://api.github.com/users/arjoly/repos","events_url":"https://api.github.com/users/arjoly/events{/privacy}","received_events_url":"https://api.github.com/users/arjoly/received_events","type":"User","site_admin":false},"body":"","created_at":"2014-10-16T14:25:10Z","updated_at":"2014-10-17T09:31:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"91423317c9751dc316a44c135a995cee04ef955b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/3779/commits","review_comments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/3779/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/3779/comments","statuses_url":"https://api.github.com/repos/scikit-learn/scikit-learn/statuses/e0f4cd92f28deea9bc1492a5083039157358ce72","head":{"label":"arjoly:sw-dummy-regressor","ref":"sw-dummy-regressor","sha":"e0f4cd92f28deea9bc1492a5083039157358ce72","user":{"login":"arjoly","id":1274722,"avatar_url":"https://avatars.githubusercontent.com/u/1274722?v=2","gravatar_id":"","url":"https://api.github.com/users/arjoly","html_url":"https://github.com/arjoly","followers_url":"https://api.github.com/users/arjoly/followers","following_url":"https://api.github.com/users/arjoly/following{/other_user}","gists_url":"https://api.github.com/users/arjoly/gists{/gist_id}","starred_url":"https://api.github.com/users/arjoly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arjoly/subscriptions","organizations_url":"https://api.github.com/users/arjoly/orgs","repos_url":"https://api.github.com/users/arjoly/repos","events_url":"https://api.github.com/users/arjoly/events{/privacy}","received_events_url":"https://api.github.com/users/arjoly/received_events","type":"User","site_admin":false},"repo":{"id":6792691,"name":"scikit-learn","full_name":"arjoly/scikit-learn","owner":{"login":"arjoly","id":1274722,"avatar_url":"https://avatars.githubusercontent.com/u/1274722?v=2","gravatar_id":"","url":"https://api.github.com/users/arjoly","html_url":"https://github.com/arjoly","followers_url":"https://api.github.com/users/arjoly/followers","following_url":"https://api.github.com/users/arjoly/following{/other_user}","gists_url":"https://api.github.com/users/arjoly/gists{/gist_id}","starred_url":"https://api.github.com/users/arjoly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arjoly/subscriptions","organizations_url":"https://api.github.com/users/arjoly/orgs","repos_url":"https://api.github.com/users/arjoly/repos","events_url":"https://api.github.com/users/arjoly/events{/privacy}","received_events_url":"https://api.github.com/users/arjoly/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/arjoly/scikit-learn","description":"scikit-learn: machine learning in Python","fork":true,"url":"https://api.github.com/repos/arjoly/scikit-learn","forks_url":"https://api.github.com/repos/arjoly/scikit-learn/forks","keys_url":"https://api.github.com/repos/arjoly/scikit-learn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/arjoly/scikit-learn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/arjoly/scikit-learn/teams","hooks_url":"https://api.github.com/repos/arjoly/scikit-learn/hooks","issue_events_url":"https://api.github.com/repos/arjoly/scikit-learn/issues/events{/number}","events_url":"https://api.github.com/repos/arjoly/scikit-learn/events","assignees_url":"https://api.github.com/repos/arjoly/scikit-learn/assignees{/user}","branches_url":"https://api.github.com/repos/arjoly/scikit-learn/branches{/branch}","tags_url":"https://api.github.com/repos/arjoly/scikit-learn/tags","blobs_url":"https://api.github.com/repos/arjoly/scikit-learn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/arjoly/scikit-learn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/arjoly/scikit-learn/git/refs{/sha}","trees_url":"https://api.github.com/repos/arjoly/scikit-learn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/arjoly/scikit-learn/statuses/{sha}","languages_url":"https://api.github.com/repos/arjoly/scikit-learn/languages","stargazers_url":"https://api.github.com/repos/arjoly/scikit-learn/stargazers","contributors_url":"https://api.github.com/repos/arjoly/scikit-learn/contributors","subscribers_url":"https://api.github.com/repos/arjoly/scikit-learn/subscribers","subscription_url":"https://api.github.com/repos/arjoly/scikit-learn/subscription","commits_url":"https://api.github.com/repos/arjoly/scikit-learn/commits{/sha}","git_commits_url":"https://api.github.com/repos/arjoly/scikit-learn/git/commits{/sha}","comments_url":"https://api.github.com/repos/arjoly/scikit-learn/comments{/number}","issue_comment_url":"https://api.github.com/repos/arjoly/scikit-learn/issues/comments/{number}","contents_url":"https://api.github.com/repos/arjoly/scikit-learn/contents/{+path}","compare_url":"https://api.github.com/repos/arjoly/scikit-learn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/arjoly/scikit-learn/merges","archive_url":"https://api.github.com/repos/arjoly/scikit-learn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/arjoly/scikit-learn/downloads","issues_url":"https://api.github.com/repos/arjoly/scikit-learn/issues{/number}","pulls_url":"https://api.github.com/repos/arjoly/scikit-learn/pulls{/number}","milestones_url":"https://api.github.com/repos/arjoly/scikit-learn/milestones{/number}","notifications_url":"https://api.github.com/repos/arjoly/scikit-learn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/arjoly/scikit-learn/labels{/name}","releases_url":"https://api.github.com/repos/arjoly/scikit-learn/releases{/id}","created_at":"2012-11-21T08:55:17Z","updated_at":"2014-09-24T18:27:21Z","pushed_at":"2014-10-16T15:29:33Z","git_url":"git://github.com/arjoly/scikit-learn.git","ssh_url":"git@github.com:arjoly/scikit-learn.git","clone_url":"https://github.com/arjoly/scikit-learn.git","svn_url":"https://github.com/arjoly/scikit-learn","homepage":"http://scikit-learn.org","size":66173,"stargazers_count":3,"watchers_count":3,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":0,"forks":3,"open_issues":0,"watchers":3,"default_branch":"master"}},"base":{"label":"scikit-learn:master","ref":"master","sha":"b698d9f55aeaba16e41cbcb04d7cc2681543d9df","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-17T09:28:43Z","pushed_at":"2014-10-16T21:03:05Z","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":121797,"stargazers_count":4076,"watchers_count":4076,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2315,"mirror_url":null,"open_issues_count":514,"forks":2315,"open_issues":514,"watchers":4076,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/3779"},"html":{"href":"https://github.com/scikit-learn/scikit-learn/pull/3779"},"issue":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/3779"},"comments":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/3779/comments"},"review_comments":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/3779/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/3779/commits"},"statuses":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/statuses/e0f4cd92f28deea9bc1492a5083039157358ce72"}}}}