{"action":"created","issue":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/12276","repository_url":"https://api.github.com/repos/scikit-learn/scikit-learn","labels_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/12276/labels{/name}","comments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/12276/comments","events_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/12276/events","html_url":"https://github.com/scikit-learn/scikit-learn/issues/12276","id":366724640,"node_id":"MDU6SXNzdWUzNjY3MjQ2NDA=","number":12276,"title":"Calling NearestNeighbors.{kneighbors,radius_neighbors}_graph without first fitting should raise NotFittedError","user":{"login":"jnothman","id":78827,"node_id":"MDQ6VXNlcjc4ODI3","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},"labels":[{"id":723598741,"node_id":"MDU6TGFiZWw3MjM1OTg3NDE=","url":"https://api.github.com/repos/scikit-learn/scikit-learn/labels/good%20first%20issue","name":"good first issue","color":"7057ff","default":true},{"id":723599497,"node_id":"MDU6TGFiZWw3MjM1OTk0OTc=","url":"https://api.github.com/repos/scikit-learn/scikit-learn/labels/help%20wanted","name":"help wanted","color":"33aa3f","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-10-04T10:32:34Z","updated_at":"2018-10-04T14:55:43Z","closed_at":null,"author_association":"MEMBER","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\r\nRunning prediction methods without running `fit` should raise `NotFittedError`. This is not the case for some non-standard methods.\r\n\r\n`check_is_fitted` should be applied for this purpose.\r\n\r\n#### Steps/Code to Reproduce\r\n\r\n```py\r\nfrom sklearn.neighbors import NearestNeighbors\r\nNearestNeighbors().kneighbors_graph([[1]])\r\n```\r\nor\r\n```py\r\nfrom sklearn.neighbors import NearestNeighbors\r\nNearestNeighbors().radius_neighbors_graph([[1]])\r\n```\r\n\r\n\r\n#### Expected Results\r\n\r\nNotFittedError raised\r\n\r\n#### Actual Results\r\nAttributeError raised\r\n\r\n#### Versions\r\n\r\n```\r\nSystem\r\n------\r\n    python: 3.5.2 |Continuum Analytics, Inc.| (default, Jul  2 2016, 17:52:12)  [GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.28)]\r\nexecutable: /Users/joel/anaconda3/envs/scipy3k/bin/python\r\n   machine: Darwin-17.7.0-x86_64-i386-64bit\r\n\r\nBLAS\r\n----\r\n  lib_dirs: /Users/joel/anaconda3/envs/scipy3k/lib\r\n    macros: SCIPY_MKL_H=None, HAVE_CBLAS=None\r\ncblas_libs: mkl_rt, pthread\r\n\r\nPython deps\r\n-----------\r\nsetuptools: 37.0.0\r\n     scipy: 1.0.0\r\n       pip: 18.0\r\n     numpy: 1.14.1\r\n   sklearn: 0.21.dev0\r\n    pandas: 0.23.4\r\n    Cython: 0.28.5\r\n```"},"comment":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/comments/427050632","html_url":"https://github.com/scikit-learn/scikit-learn/issues/12276#issuecomment-427050632","issue_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/12276","id":427050632,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNzA1MDYzMg==","user":{"login":"amueller","id":449558,"node_id":"MDQ6VXNlcjQ0OTU1OA==","avatar_url":"https://avatars3.githubusercontent.com/u/449558?v=4","gravatar_id":"","url":"https://api.github.com/users/amueller","html_url":"https://github.com/amueller","followers_url":"https://api.github.com/users/amueller/followers","following_url":"https://api.github.com/users/amueller/following{/other_user}","gists_url":"https://api.github.com/users/amueller/gists{/gist_id}","starred_url":"https://api.github.com/users/amueller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amueller/subscriptions","organizations_url":"https://api.github.com/users/amueller/orgs","repos_url":"https://api.github.com/users/amueller/repos","events_url":"https://api.github.com/users/amueller/events{/privacy}","received_events_url":"https://api.github.com/users/amueller/received_events","type":"User","site_admin":false},"created_at":"2018-10-04T14:55:43Z","updated_at":"2018-10-04T14:55:43Z","author_association":"MEMBER","body":"Do we want to add a common test for this? Like find all non-standard methods, check the signature, if the only positional argument is X then run this test?"}}
{"actor":{"display_login":"amueller"}}