{"action":"created","comment":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/comments/277133294","pull_request_review_id":228876436,"id":277133294,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI3NzEzMzI5NA==","diff_hunk":"@@ -318,6 +318,11 @@ Support for Python 3.4 and below has been officially dropped.\n   and now it returns NaN and raises :class:`exceptions.UndefinedMetricWarning`.\n   :issue:`12855` by :user:`Pawel Sendyk <psendyk>`.\n \n+- |Fix| :func:`metrics.label_ranking_average_precision_score` was returning\n+  incorrect values where some samples had degenerate labels and `sample_weight`\n+  was used.","path":"doc/whats_new/v0.21.rst","position":null,"original_position":6,"commit_id":"3b28e0bc99b2a947b2d594b2cb284579ab42501f","original_commit_id":"f4d978311ac139a06ee7566bbd4883441f81bdd8","user":{"login":"dpwe","id":552145,"node_id":"MDQ6VXNlcjU1MjE0NQ==","avatar_url":"https://avatars3.githubusercontent.com/u/552145?v=4","gravatar_id":"","url":"https://api.github.com/users/dpwe","html_url":"https://github.com/dpwe","followers_url":"https://api.github.com/users/dpwe/followers","following_url":"https://api.github.com/users/dpwe/following{/other_user}","gists_url":"https://api.github.com/users/dpwe/gists{/gist_id}","starred_url":"https://api.github.com/users/dpwe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpwe/subscriptions","organizations_url":"https://api.github.com/users/dpwe/orgs","repos_url":"https://api.github.com/users/dpwe/repos","events_url":"https://api.github.com/users/dpwe/events{/privacy}","received_events_url":"https://api.github.com/users/dpwe/received_events","type":"User","site_admin":false},"body":"Sorry for the delay.  I made the change you suggested.","created_at":"2019-04-20T12:22:31Z","updated_at":"2019-04-20T12:22:31Z","html_url":"https://github.com/scikit-learn/scikit-learn/pull/13447#discussion_r277133294","pull_request_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/13447","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/comments/277133294"},"html":{"href":"https://github.com/scikit-learn/scikit-learn/pull/13447#discussion_r277133294"},"pull_request":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/13447"}},"in_reply_to_id":274494378},"pull_request":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/13447","id":261136700,"node_id":"MDExOlB1bGxSZXF1ZXN0MjYxMTM2NzAw","html_url":"https://github.com/scikit-learn/scikit-learn/pull/13447","diff_url":"https://github.com/scikit-learn/scikit-learn/pull/13447.diff","patch_url":"https://github.com/scikit-learn/scikit-learn/pull/13447.patch","issue_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/13447","number":13447,"state":"open","locked":false,"title":"[MRG] Fix label_ranking_average_precision_score: sample_weighting isn't applied to items with zero true labels #13412","user":{"login":"dpwe","id":552145,"node_id":"MDQ6VXNlcjU1MjE0NQ==","avatar_url":"https://avatars3.githubusercontent.com/u/552145?v=4","gravatar_id":"","url":"https://api.github.com/users/dpwe","html_url":"https://github.com/dpwe","followers_url":"https://api.github.com/users/dpwe/followers","following_url":"https://api.github.com/users/dpwe/following{/other_user}","gists_url":"https://api.github.com/users/dpwe/gists{/gist_id}","starred_url":"https://api.github.com/users/dpwe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpwe/subscriptions","organizations_url":"https://api.github.com/users/dpwe/orgs","repos_url":"https://api.github.com/users/dpwe/repos","events_url":"https://api.github.com/users/dpwe/events{/privacy}","received_events_url":"https://api.github.com/users/dpwe/received_events","type":"User","site_admin":false},"body":"Fixes #13412 \r\n\r\n#### What does this implement/fix? Explain your changes.\r\n\r\n`sklearn.metrics.label_ranking_average_precision_score` supports a `sample_weight` argument to allow different contributions of individual trial samples.  However, in the case where certain samples had degenerate labels (all true or none true), the special case logic that gave these samples a precision of 1.0 failed to apply the `sample_weight`s.  This is now corrected, with tests that exercise `sample_weight` without degenerate labels (a test that passed before the code was modified), and with degenerate labels (a test that failed until this change was applied).\r\n\r\n#### Any other comments?\r\n\r\n\r\n<!--\r\nPlease be aware that we are a loose team of volunteers so patience is\r\nnecessary; assistance handling other issues is very welcome. We value\r\nall user contributions, no matter how minor they are. If we are slow to\r\nreview, either the pull request needs some benchmarking, tinkering,\r\nconvincing, etc. or more likely the reviewers are simply busy. In either\r\ncase, we ask for your understanding during the review process.\r\nFor more information, see our FAQ on this topic:\r\nhttp://scikit-learn.org/dev/faq.html#why-is-my-pull-request-not-getting-any-attention.\r\n\r\nThanks for contributing!\r\n-->\r\n","created_at":"2019-03-14T11:56:35Z","updated_at":"2019-04-20T12:22:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2fbc949414467520440fcb75634711ef560502c9","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":12995755,"node_id":"MDU6TGFiZWwxMjk5NTc1NQ==","url":"https://api.github.com/repos/scikit-learn/scikit-learn/labels/Bug","name":"Bug","color":"e10c02","default":false}],"milestone":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/milestones/26","html_url":"https://github.com/scikit-learn/scikit-learn/milestone/26","labels_url":"https://api.github.com/repos/scikit-learn/scikit-learn/milestones/26/labels","id":3421829,"node_id":"MDk6TWlsZXN0b25lMzQyMTgyOQ==","number":26,"title":"0.21","description":"","creator":{"login":"glemaitre","id":7454015,"node_id":"MDQ6VXNlcjc0NTQwMTU=","avatar_url":"https://avatars2.githubusercontent.com/u/7454015?v=4","gravatar_id":"","url":"https://api.github.com/users/glemaitre","html_url":"https://github.com/glemaitre","followers_url":"https://api.github.com/users/glemaitre/followers","following_url":"https://api.github.com/users/glemaitre/following{/other_user}","gists_url":"https://api.github.com/users/glemaitre/gists{/gist_id}","starred_url":"https://api.github.com/users/glemaitre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glemaitre/subscriptions","organizations_url":"https://api.github.com/users/glemaitre/orgs","repos_url":"https://api.github.com/users/glemaitre/repos","events_url":"https://api.github.com/users/glemaitre/events{/privacy}","received_events_url":"https://api.github.com/users/glemaitre/received_events","type":"User","site_admin":false},"open_issues":23,"closed_issues":70,"state":"open","created_at":"2018-06-13T12:48:35Z","updated_at":"2019-04-19T18:16:50Z","due_on":"2019-01-31T08:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/13447/commits","review_comments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/13447/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/13447/comments","statuses_url":"https://api.github.com/repos/scikit-learn/scikit-learn/statuses/3b28e0bc99b2a947b2d594b2cb284579ab42501f","head":{"label":"dpwe:lrap_weighting_zero_labels","ref":"lrap_weighting_zero_labels","sha":"3b28e0bc99b2a947b2d594b2cb284579ab42501f","user":{"login":"dpwe","id":552145,"node_id":"MDQ6VXNlcjU1MjE0NQ==","avatar_url":"https://avatars3.githubusercontent.com/u/552145?v=4","gravatar_id":"","url":"https://api.github.com/users/dpwe","html_url":"https://github.com/dpwe","followers_url":"https://api.github.com/users/dpwe/followers","following_url":"https://api.github.com/users/dpwe/following{/other_user}","gists_url":"https://api.github.com/users/dpwe/gists{/gist_id}","starred_url":"https://api.github.com/users/dpwe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpwe/subscriptions","organizations_url":"https://api.github.com/users/dpwe/orgs","repos_url":"https://api.github.com/users/dpwe/repos","events_url":"https://api.github.com/users/dpwe/events{/privacy}","received_events_url":"https://api.github.com/users/dpwe/received_events","type":"User","site_admin":false},"repo":{"id":175609487,"node_id":"MDEwOlJlcG9zaXRvcnkxNzU2MDk0ODc=","name":"scikit-learn","full_name":"dpwe/scikit-learn","private":false,"owner":{"login":"dpwe","id":552145,"node_id":"MDQ6VXNlcjU1MjE0NQ==","avatar_url":"https://avatars3.githubusercontent.com/u/552145?v=4","gravatar_id":"","url":"https://api.github.com/users/dpwe","html_url":"https://github.com/dpwe","followers_url":"https://api.github.com/users/dpwe/followers","following_url":"https://api.github.com/users/dpwe/following{/other_user}","gists_url":"https://api.github.com/users/dpwe/gists{/gist_id}","starred_url":"https://api.github.com/users/dpwe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpwe/subscriptions","organizations_url":"https://api.github.com/users/dpwe/orgs","repos_url":"https://api.github.com/users/dpwe/repos","events_url":"https://api.github.com/users/dpwe/events{/privacy}","received_events_url":"https://api.github.com/users/dpwe/received_events","type":"User","site_admin":false},"html_url":"https://github.com/dpwe/scikit-learn","description":"scikit-learn: machine learning in Python","fork":true,"url":"https://api.github.com/repos/dpwe/scikit-learn","forks_url":"https://api.github.com/repos/dpwe/scikit-learn/forks","keys_url":"https://api.github.com/repos/dpwe/scikit-learn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dpwe/scikit-learn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dpwe/scikit-learn/teams","hooks_url":"https://api.github.com/repos/dpwe/scikit-learn/hooks","issue_events_url":"https://api.github.com/repos/dpwe/scikit-learn/issues/events{/number}","events_url":"https://api.github.com/repos/dpwe/scikit-learn/events","assignees_url":"https://api.github.com/repos/dpwe/scikit-learn/assignees{/user}","branches_url":"https://api.github.com/repos/dpwe/scikit-learn/branches{/branch}","tags_url":"https://api.github.com/repos/dpwe/scikit-learn/tags","blobs_url":"https://api.github.com/repos/dpwe/scikit-learn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dpwe/scikit-learn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dpwe/scikit-learn/git/refs{/sha}","trees_url":"https://api.github.com/repos/dpwe/scikit-learn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dpwe/scikit-learn/statuses/{sha}","languages_url":"https://api.github.com/repos/dpwe/scikit-learn/languages","stargazers_url":"https://api.github.com/repos/dpwe/scikit-learn/stargazers","contributors_url":"https://api.github.com/repos/dpwe/scikit-learn/contributors","subscribers_url":"https://api.github.com/repos/dpwe/scikit-learn/subscribers","subscription_url":"https://api.github.com/repos/dpwe/scikit-learn/subscription","commits_url":"https://api.github.com/repos/dpwe/scikit-learn/commits{/sha}","git_commits_url":"https://api.github.com/repos/dpwe/scikit-learn/git/commits{/sha}","comments_url":"https://api.github.com/repos/dpwe/scikit-learn/comments{/number}","issue_comment_url":"https://api.github.com/repos/dpwe/scikit-learn/issues/comments{/number}","contents_url":"https://api.github.com/repos/dpwe/scikit-learn/contents/{+path}","compare_url":"https://api.github.com/repos/dpwe/scikit-learn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dpwe/scikit-learn/merges","archive_url":"https://api.github.com/repos/dpwe/scikit-learn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dpwe/scikit-learn/downloads","issues_url":"https://api.github.com/repos/dpwe/scikit-learn/issues{/number}","pulls_url":"https://api.github.com/repos/dpwe/scikit-learn/pulls{/number}","milestones_url":"https://api.github.com/repos/dpwe/scikit-learn/milestones{/number}","notifications_url":"https://api.github.com/repos/dpwe/scikit-learn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dpwe/scikit-learn/labels{/name}","releases_url":"https://api.github.com/repos/dpwe/scikit-learn/releases{/id}","deployments_url":"https://api.github.com/repos/dpwe/scikit-learn/deployments","created_at":"2019-03-14T11:35:34Z","updated_at":"2019-04-14T13:12:47Z","pushed_at":"2019-04-20T12:22:04Z","git_url":"git://github.com/dpwe/scikit-learn.git","ssh_url":"git@github.com:dpwe/scikit-learn.git","clone_url":"https://github.com/dpwe/scikit-learn.git","svn_url":"https://github.com/dpwe/scikit-learn","homepage":"http://scikit-learn.org","size":100784,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":1,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"scikit-learn:master","ref":"master","sha":"a62775e99f2a5ea3d51db7160fad783f6cd8a4c5","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":"2019-04-20T11:24:07Z","pushed_at":"2019-04-20T12:22:13Z","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":101890,"stargazers_count":34589,"watchers_count":34589,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":16923,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":1921,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":16923,"open_issues":1921,"watchers":34589,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/13447"},"html":{"href":"https://github.com/scikit-learn/scikit-learn/pull/13447"},"issue":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/13447"},"comments":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/13447/comments"},"review_comments":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/13447/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/13447/commits"},"statuses":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/statuses/3b28e0bc99b2a947b2d594b2cb284579ab42501f"}},"author_association":"NONE"}}
{"actor":{"display_login":"dpwe"}}