{"action":"created","issue":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/9921","repository_url":"https://api.github.com/repos/scikit-learn/scikit-learn","labels_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/9921/labels{/name}","comments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/9921/comments","events_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/9921/events","html_url":"https://github.com/scikit-learn/scikit-learn/issues/9921","id":265317864,"number":9921,"title":"metrics.ndcg_score is busted","user":{"login":"ianlcassidy","id":6929405,"avatar_url":"https://avatars0.githubusercontent.com/u/6929405?v=4","gravatar_id":"","url":"https://api.github.com/users/ianlcassidy","html_url":"https://github.com/ianlcassidy","followers_url":"https://api.github.com/users/ianlcassidy/followers","following_url":"https://api.github.com/users/ianlcassidy/following{/other_user}","gists_url":"https://api.github.com/users/ianlcassidy/gists{/gist_id}","starred_url":"https://api.github.com/users/ianlcassidy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ianlcassidy/subscriptions","organizations_url":"https://api.github.com/users/ianlcassidy/orgs","repos_url":"https://api.github.com/users/ianlcassidy/repos","events_url":"https://api.github.com/users/ianlcassidy/events{/privacy}","received_events_url":"https://api.github.com/users/ianlcassidy/received_events","type":"User","site_admin":false},"labels":[{"id":12995755,"url":"https://api.github.com/repos/scikit-learn/scikit-learn/labels/Bug","name":"Bug","color":"e10c02","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/milestones/25","html_url":"https://github.com/scikit-learn/scikit-learn/milestone/25","labels_url":"https://api.github.com/repos/scikit-learn/scikit-learn/milestones/25/labels","id":2711856,"number":25,"title":"0.19.1","description":"","creator":{"login":"jnothman","id":78827,"avatar_url":"https://avatars2.githubusercontent.com/u/78827?v=4","gravatar_id":"","url":"https://api.github.com/users/jnothman","html_url":"https://github.com/jnothman","followers_url":"https://api.github.com/users/jnothman/followers","following_url":"https://api.github.com/users/jnothman/following{/other_user}","gists_url":"https://api.github.com/users/jnothman/gists{/gist_id}","starred_url":"https://api.github.com/users/jnothman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jnothman/subscriptions","organizations_url":"https://api.github.com/users/jnothman/orgs","repos_url":"https://api.github.com/users/jnothman/repos","events_url":"https://api.github.com/users/jnothman/events{/privacy}","received_events_url":"https://api.github.com/users/jnothman/received_events","type":"User","site_admin":false},"open_issues":9,"closed_issues":41,"state":"open","created_at":"2017-08-20T23:27:32Z","updated_at":"2017-10-16T02:32:58Z","due_on":"2017-09-08T07:00:00Z","closed_at":null},"comments":9,"created_at":"2017-10-13T14:54:49Z","updated_at":"2017-10-16T02:53:18Z","closed_at":null,"author_association":"NONE","body":"<!--\r\nIf your issue is a usage question, submit it here instead:\r\n- StackOverflow with the scikit-learn tag: http://stackoverflow.com/questions/tagged/scikit-learn\r\n- Mailing List: https://mail.python.org/mailman/listinfo/scikit-learn\r\nFor more information, see User Questions: http://scikit-learn.org/stable/support.html#user-questions\r\n-->\r\n\r\n<!-- Instructions For Filing a Bug: https://github.com/scikit-learn/scikit-learn/blob/master/CONTRIBUTING.md#filing-bugs -->\r\n\r\n#### Description\r\n<!-- Example: Joblib Error thrown when calling fit on LatentDirichletAllocation with evaluate_every > 0-->\r\n`metrics.ndcg_score` is busted\r\n\r\n\r\n#### Steps/Code to Reproduce\r\n```python\r\nfrom sklearn import metrics\r\n\r\n# test 1\r\ny_true = [0, 1, 2, 1]\r\ny_score = [[0.15, 0.55, 0.2], [0.7, 0.2, 0.1], [0.06, 0.04, 0.9], [0.1, 0.3, 0.6]]\r\nmetrics.ndcg_score(y_true, y_score)\r\n\r\n# test 2\r\ny_true = [0, 1, 0, 1]\r\ny_score = [[0.15, 0.85], [0.7, 0.3], [0.06, 0.94], [0.7, 0.3]]\r\nmetrics.ndcg_score(y_true, y_score)\r\n```\r\n\r\n#### Expected Results\r\nNo error is thrown.\r\n\r\n#### Actual Results\r\n```\r\n---------------------------------------------------------------------------\r\nValueError                                Traceback (most recent call last)\r\n<ipython-input-3-35bb0e2c9b0e> in <module>()\r\n----> 1 metrics.ndcg_score(y_true, y_score)\r\n\r\n/Users/iancassidy/virtualenvs/upside/lib/python2.7/site-packages/sklearn/metrics/ranking.py in ndcg_score(y_true, y_score, k)\r\n    849 \r\n    850     if binarized_y_true.shape != y_score.shape:\r\n--> 851         raise ValueError(\"y_true and y_score have different value ranges\")\r\n\r\nValueError: y_true and y_score have different value ranges\r\n```\r\n\r\n#### Versions\r\n<!--\r\nPlease run the following snippet and paste the output below.\r\nimport platform; print(platform.platform())\r\nimport sys; print(\"Python\", sys.version)\r\nimport numpy; print(\"NumPy\", numpy.__version__)\r\nimport scipy; print(\"SciPy\", scipy.__version__)\r\nimport sklearn; print(\"Scikit-Learn\", sklearn.__version__)\r\n-->\r\n```\r\nDarwin-16.7.0-x86_64-i386-64bit\r\n('Python', '2.7.10 (default, Feb  7 2017, 00:08:15) \\n[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)]')\r\n('NumPy', '1.13.3')\r\n('SciPy', '0.19.1')\r\n('Scikit-Learn', '0.19.0')\r\n```\r\n\r\n\r\n<!-- Thanks for contributing! -->\r\n"},"comment":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/comments/336767272","html_url":"https://github.com/scikit-learn/scikit-learn/issues/9921#issuecomment-336767272","issue_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/9921","id":336767272,"user":{"login":"jnothman","id":78827,"avatar_url":"https://avatars2.githubusercontent.com/u/78827?v=4","gravatar_id":"","url":"https://api.github.com/users/jnothman","html_url":"https://github.com/jnothman","followers_url":"https://api.github.com/users/jnothman/followers","following_url":"https://api.github.com/users/jnothman/following{/other_user}","gists_url":"https://api.github.com/users/jnothman/gists{/gist_id}","starred_url":"https://api.github.com/users/jnothman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jnothman/subscriptions","organizations_url":"https://api.github.com/users/jnothman/orgs","repos_url":"https://api.github.com/users/jnothman/repos","events_url":"https://api.github.com/users/jnothman/events{/privacy}","received_events_url":"https://api.github.com/users/jnothman/received_events","type":"User","site_admin":false},"created_at":"2017-10-16T02:53:18Z","updated_at":"2017-10-16T02:53:18Z","author_association":"OWNER","body":"I've not read all of the commentary here yet, but I don't see the relevance\nof NDCG to 1d predictions...\n"}}
{"actor":{"display_login":"jnothman"}}