{"action":"created","comment":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/comments/233181773","pull_request_review_id":174536349,"id":233181773,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMzE4MTc3Mw==","diff_hunk":"@@ -126,7 +126,13 @@ def __call__(self, clf, X, y, sample_weight=None):\n         y_type = type_of_target(y)\n         y_pred = clf.predict_proba(X)\n         if y_type == \"binary\":\n-            y_pred = y_pred[:, 1]\n+            if y_pred.shape[1] == 2:\n+                y_pred = y_pred[:, 1]\n+            else:\n+                raise ValueError('got predict_proba of shape;'","path":"sklearn/metrics/scorer.py","position":8,"original_position":8,"commit_id":"e9e492e004503b39984925190c3c7c768afbbfbc","original_commit_id":"e9e492e004503b39984925190c3c7c768afbbfbc","user":{"login":"reshamas","id":2507232,"node_id":"MDQ6VXNlcjI1MDcyMzI=","avatar_url":"https://avatars0.githubusercontent.com/u/2507232?v=4","gravatar_id":"","url":"https://api.github.com/users/reshamas","html_url":"https://github.com/reshamas","followers_url":"https://api.github.com/users/reshamas/followers","following_url":"https://api.github.com/users/reshamas/following{/other_user}","gists_url":"https://api.github.com/users/reshamas/gists{/gist_id}","starred_url":"https://api.github.com/users/reshamas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reshamas/subscriptions","organizations_url":"https://api.github.com/users/reshamas/orgs","repos_url":"https://api.github.com/users/reshamas/repos","events_url":"https://api.github.com/users/reshamas/events{/privacy}","received_events_url":"https://api.github.com/users/reshamas/received_events","type":"User","site_admin":false},"body":"Or, I think you mean this:\r\n\r\n>predict_proba has shape (n_samples, y_pred.shape[1]) which returns only 1 vector of probabilities (because it is a single class) but 2 classes in the data are required.","created_at":"2018-11-13T19:06:37Z","updated_at":"2018-11-13T19:06:37Z","html_url":"https://github.com/scikit-learn/scikit-learn/pull/12486#discussion_r233181773","pull_request_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/12486","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/comments/233181773"},"html":{"href":"https://github.com/scikit-learn/scikit-learn/pull/12486#discussion_r233181773"},"pull_request":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/12486"}},"in_reply_to_id":232839757},"pull_request":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/12486","id":226761213,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI2NzYxMjEz","html_url":"https://github.com/scikit-learn/scikit-learn/pull/12486","diff_url":"https://github.com/scikit-learn/scikit-learn/pull/12486.diff","patch_url":"https://github.com/scikit-learn/scikit-learn/pull/12486.patch","issue_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/12486","number":12486,"state":"open","locked":false,"title":"Check predict_proba shape in ThresholdScorer","user":{"login":"reshamas","id":2507232,"node_id":"MDQ6VXNlcjI1MDcyMzI=","avatar_url":"https://avatars0.githubusercontent.com/u/2507232?v=4","gravatar_id":"","url":"https://api.github.com/users/reshamas","html_url":"https://github.com/reshamas","followers_url":"https://api.github.com/users/reshamas/followers","following_url":"https://api.github.com/users/reshamas/following{/other_user}","gists_url":"https://api.github.com/users/reshamas/gists{/gist_id}","starred_url":"https://api.github.com/users/reshamas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reshamas/subscriptions","organizations_url":"https://api.github.com/users/reshamas/orgs","repos_url":"https://api.github.com/users/reshamas/repos","events_url":"https://api.github.com/users/reshamas/events{/privacy}","received_events_url":"https://api.github.com/users/reshamas/received_events","type":"User","site_admin":false},"body":"#### Reference Issues/PRs\r\nContinues #12221, fixes #7598\r\n\r\n#### What does this implement/fix? Explain your changes.\r\n\r\n#### Any other comments?\r\nthis time, I ran flake8, fixed formatting\r\n\r\ncc:  @AMDonati\r\n\r\n@amueller Can you point me to the GMM test? I did not see on in here:\r\nscikit-learn/sklearn/tests\r\n\r\n>Looks good in general, but you need to add a regression test (you could use the GMM one or just a classification one with a single class maybe)\r\n","created_at":"2018-10-30T01:08:40Z","updated_at":"2018-11-13T19:06:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"086df2af5030b846d0a277fe4a1edec3d2054103","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/12486/commits","review_comments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/12486/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/12486/comments","statuses_url":"https://api.github.com/repos/scikit-learn/scikit-learn/statuses/e9e492e004503b39984925190c3c7c768afbbfbc","head":{"label":"reshamas:check_if_classifier","ref":"check_if_classifier","sha":"e9e492e004503b39984925190c3c7c768afbbfbc","user":{"login":"reshamas","id":2507232,"node_id":"MDQ6VXNlcjI1MDcyMzI=","avatar_url":"https://avatars0.githubusercontent.com/u/2507232?v=4","gravatar_id":"","url":"https://api.github.com/users/reshamas","html_url":"https://github.com/reshamas","followers_url":"https://api.github.com/users/reshamas/followers","following_url":"https://api.github.com/users/reshamas/following{/other_user}","gists_url":"https://api.github.com/users/reshamas/gists{/gist_id}","starred_url":"https://api.github.com/users/reshamas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reshamas/subscriptions","organizations_url":"https://api.github.com/users/reshamas/orgs","repos_url":"https://api.github.com/users/reshamas/repos","events_url":"https://api.github.com/users/reshamas/events{/privacy}","received_events_url":"https://api.github.com/users/reshamas/received_events","type":"User","site_admin":false},"repo":{"id":155299523,"node_id":"MDEwOlJlcG9zaXRvcnkxNTUyOTk1MjM=","name":"scikit-learn","full_name":"reshamas/scikit-learn","private":false,"owner":{"login":"reshamas","id":2507232,"node_id":"MDQ6VXNlcjI1MDcyMzI=","avatar_url":"https://avatars0.githubusercontent.com/u/2507232?v=4","gravatar_id":"","url":"https://api.github.com/users/reshamas","html_url":"https://github.com/reshamas","followers_url":"https://api.github.com/users/reshamas/followers","following_url":"https://api.github.com/users/reshamas/following{/other_user}","gists_url":"https://api.github.com/users/reshamas/gists{/gist_id}","starred_url":"https://api.github.com/users/reshamas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reshamas/subscriptions","organizations_url":"https://api.github.com/users/reshamas/orgs","repos_url":"https://api.github.com/users/reshamas/repos","events_url":"https://api.github.com/users/reshamas/events{/privacy}","received_events_url":"https://api.github.com/users/reshamas/received_events","type":"User","site_admin":false},"html_url":"https://github.com/reshamas/scikit-learn","description":"scikit-learn: machine learning in Python","fork":true,"url":"https://api.github.com/repos/reshamas/scikit-learn","forks_url":"https://api.github.com/repos/reshamas/scikit-learn/forks","keys_url":"https://api.github.com/repos/reshamas/scikit-learn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/reshamas/scikit-learn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/reshamas/scikit-learn/teams","hooks_url":"https://api.github.com/repos/reshamas/scikit-learn/hooks","issue_events_url":"https://api.github.com/repos/reshamas/scikit-learn/issues/events{/number}","events_url":"https://api.github.com/repos/reshamas/scikit-learn/events","assignees_url":"https://api.github.com/repos/reshamas/scikit-learn/assignees{/user}","branches_url":"https://api.github.com/repos/reshamas/scikit-learn/branches{/branch}","tags_url":"https://api.github.com/repos/reshamas/scikit-learn/tags","blobs_url":"https://api.github.com/repos/reshamas/scikit-learn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/reshamas/scikit-learn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/reshamas/scikit-learn/git/refs{/sha}","trees_url":"https://api.github.com/repos/reshamas/scikit-learn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/reshamas/scikit-learn/statuses/{sha}","languages_url":"https://api.github.com/repos/reshamas/scikit-learn/languages","stargazers_url":"https://api.github.com/repos/reshamas/scikit-learn/stargazers","contributors_url":"https://api.github.com/repos/reshamas/scikit-learn/contributors","subscribers_url":"https://api.github.com/repos/reshamas/scikit-learn/subscribers","subscription_url":"https://api.github.com/repos/reshamas/scikit-learn/subscription","commits_url":"https://api.github.com/repos/reshamas/scikit-learn/commits{/sha}","git_commits_url":"https://api.github.com/repos/reshamas/scikit-learn/git/commits{/sha}","comments_url":"https://api.github.com/repos/reshamas/scikit-learn/comments{/number}","issue_comment_url":"https://api.github.com/repos/reshamas/scikit-learn/issues/comments{/number}","contents_url":"https://api.github.com/repos/reshamas/scikit-learn/contents/{+path}","compare_url":"https://api.github.com/repos/reshamas/scikit-learn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/reshamas/scikit-learn/merges","archive_url":"https://api.github.com/repos/reshamas/scikit-learn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/reshamas/scikit-learn/downloads","issues_url":"https://api.github.com/repos/reshamas/scikit-learn/issues{/number}","pulls_url":"https://api.github.com/repos/reshamas/scikit-learn/pulls{/number}","milestones_url":"https://api.github.com/repos/reshamas/scikit-learn/milestones{/number}","notifications_url":"https://api.github.com/repos/reshamas/scikit-learn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/reshamas/scikit-learn/labels{/name}","releases_url":"https://api.github.com/repos/reshamas/scikit-learn/releases{/id}","deployments_url":"https://api.github.com/repos/reshamas/scikit-learn/deployments","created_at":"2018-10-30T00:24:40Z","updated_at":"2018-10-30T00:24:49Z","pushed_at":"2018-11-11T13:52:42Z","git_url":"git://github.com/reshamas/scikit-learn.git","ssh_url":"git@github.com:reshamas/scikit-learn.git","clone_url":"https://github.com/reshamas/scikit-learn.git","svn_url":"https://github.com/reshamas/scikit-learn","homepage":"http://scikit-learn.org","size":95938,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"scikit-learn:master","ref":"master","sha":"862288591d8e5053cb26c1893955400b3be399e2","user":{"login":"scikit-learn","id":365630,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2NTYzMA==","avatar_url":"https://avatars2.githubusercontent.com/u/365630?v=4","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,"node_id":"MDEwOlJlcG9zaXRvcnk4NDMyMjI=","name":"scikit-learn","full_name":"scikit-learn/scikit-learn","private":false,"owner":{"login":"scikit-learn","id":365630,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2NTYzMA==","avatar_url":"https://avatars2.githubusercontent.com/u/365630?v=4","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},"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}","deployments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/deployments","created_at":"2010-08-17T09:43:38Z","updated_at":"2018-11-13T18:30:33Z","pushed_at":"2018-11-13T18:10:35Z","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":96719,"stargazers_count":31678,"watchers_count":31678,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15635,"mirror_url":null,"archived":false,"open_issues_count":1804,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":15635,"open_issues":1804,"watchers":31678,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/12486"},"html":{"href":"https://github.com/scikit-learn/scikit-learn/pull/12486"},"issue":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/12486"},"comments":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/12486/comments"},"review_comments":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/12486/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/12486/commits"},"statuses":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/statuses/e9e492e004503b39984925190c3c7c768afbbfbc"}},"author_association":"NONE"}}
{"actor":{"display_login":"reshamas"}}