{"action":"created","comment":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/comments/22938931","id":22938931,"diff_hunk":"@@ -903,6 +904,28 @@ def test_non_euclidean_kneighbors():\n                   radius, metric='euclidean')\n \n \n+def test_kneighbors_parallel():\n+    X = iris.data\n+    y = iris.target\n+    X_train, X_test, y_train, y_test = train_test_split(X, y)\n+    for algorithm in ALGORITHMS:\n+        clf = neighbors.KNeighborsClassifier(n_neighbors=3,\n+                                             algorithm=algorithm)\n+        clf.fit(X_train, y_train)\n+        y_1 = clf.predict(X_test)\n+        dist_1, ind_1 = clf.kneighbors(X_test)\n+        A_1 = clf.kneighbors_graph(X_test, mode='distance').todense()\n+        for n_jobs in [2]:","path":"sklearn/neighbors/tests/test_neighbors.py","position":25,"original_position":25,"commit_id":"44ad7342839eda19ec9f4ab3cec57aa2009b0e6b","original_commit_id":"44ad7342839eda19ec9f4ab3cec57aa2009b0e6b","user":{"login":"ogrisel","id":89061,"avatar_url":"https://avatars.githubusercontent.com/u/89061?v=3","gravatar_id":"","url":"https://api.github.com/users/ogrisel","html_url":"https://github.com/ogrisel","followers_url":"https://api.github.com/users/ogrisel/followers","following_url":"https://api.github.com/users/ogrisel/following{/other_user}","gists_url":"https://api.github.com/users/ogrisel/gists{/gist_id}","starred_url":"https://api.github.com/users/ogrisel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ogrisel/subscriptions","organizations_url":"https://api.github.com/users/ogrisel/orgs","repos_url":"https://api.github.com/users/ogrisel/repos","events_url":"https://api.github.com/users/ogrisel/events{/privacy}","received_events_url":"https://api.github.com/users/ogrisel/received_events","type":"User","site_admin":false},"body":"Please test for more cases, e.g. `for n_jobs in [-1, 2, 3, 17]`.","created_at":"2015-01-14T14:28:02Z","updated_at":"2015-01-14T14:28:02Z","html_url":"https://github.com/scikit-learn/scikit-learn/pull/4009#discussion_r22938931","pull_request_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/4009","_links":{"self":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/comments/22938931"},"html":{"href":"https://github.com/scikit-learn/scikit-learn/pull/4009#discussion_r22938931"},"pull_request":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/4009"}}},"pull_request":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/4009","id":26604219,"html_url":"https://github.com/scikit-learn/scikit-learn/pull/4009","diff_url":"https://github.com/scikit-learn/scikit-learn/pull/4009.diff","patch_url":"https://github.com/scikit-learn/scikit-learn/pull/4009.patch","issue_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/4009","number":4009,"state":"open","locked":false,"title":"[MRG+1] ENH: Parallelize kneighbors method with multithreading","user":{"login":"nmayorov","id":7074023,"avatar_url":"https://avatars.githubusercontent.com/u/7074023?v=3","gravatar_id":"","url":"https://api.github.com/users/nmayorov","html_url":"https://github.com/nmayorov","followers_url":"https://api.github.com/users/nmayorov/followers","following_url":"https://api.github.com/users/nmayorov/following{/other_user}","gists_url":"https://api.github.com/users/nmayorov/gists{/gist_id}","starred_url":"https://api.github.com/users/nmayorov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmayorov/subscriptions","organizations_url":"https://api.github.com/users/nmayorov/orgs","repos_url":"https://api.github.com/users/nmayorov/repos","events_url":"https://api.github.com/users/nmayorov/events{/privacy}","received_events_url":"https://api.github.com/users/nmayorov/received_events","type":"User","site_admin":false},"body":"I used the most simple approach with the <del>`'multiprocessing'`</del> `'threading'` joblib backend. A simple benchmark could be seen [here](http://nbviewer.ipython.org/gist/nmayorov/7531d9b59608ae2d76dc).\r\n\r\nThis is the issue #3536.","created_at":"2014-12-26T18:12:48Z","updated_at":"2015-01-14T14:28:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"85bdbb8d493d2623a4f4f2e84dc50ac4b495ed52","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/4009/commits","review_comments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/4009/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/4009/comments","statuses_url":"https://api.github.com/repos/scikit-learn/scikit-learn/statuses/44ad7342839eda19ec9f4ab3cec57aa2009b0e6b","head":{"label":"nmayorov:neighbors_parallel","ref":"neighbors_parallel","sha":"44ad7342839eda19ec9f4ab3cec57aa2009b0e6b","user":{"login":"nmayorov","id":7074023,"avatar_url":"https://avatars.githubusercontent.com/u/7074023?v=3","gravatar_id":"","url":"https://api.github.com/users/nmayorov","html_url":"https://github.com/nmayorov","followers_url":"https://api.github.com/users/nmayorov/followers","following_url":"https://api.github.com/users/nmayorov/following{/other_user}","gists_url":"https://api.github.com/users/nmayorov/gists{/gist_id}","starred_url":"https://api.github.com/users/nmayorov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmayorov/subscriptions","organizations_url":"https://api.github.com/users/nmayorov/orgs","repos_url":"https://api.github.com/users/nmayorov/repos","events_url":"https://api.github.com/users/nmayorov/events{/privacy}","received_events_url":"https://api.github.com/users/nmayorov/received_events","type":"User","site_admin":false},"repo":{"id":18151685,"name":"scikit-learn","full_name":"nmayorov/scikit-learn","owner":{"login":"nmayorov","id":7074023,"avatar_url":"https://avatars.githubusercontent.com/u/7074023?v=3","gravatar_id":"","url":"https://api.github.com/users/nmayorov","html_url":"https://github.com/nmayorov","followers_url":"https://api.github.com/users/nmayorov/followers","following_url":"https://api.github.com/users/nmayorov/following{/other_user}","gists_url":"https://api.github.com/users/nmayorov/gists{/gist_id}","starred_url":"https://api.github.com/users/nmayorov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmayorov/subscriptions","organizations_url":"https://api.github.com/users/nmayorov/orgs","repos_url":"https://api.github.com/users/nmayorov/repos","events_url":"https://api.github.com/users/nmayorov/events{/privacy}","received_events_url":"https://api.github.com/users/nmayorov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nmayorov/scikit-learn","description":"scikit-learn: machine learning in Python","fork":true,"url":"https://api.github.com/repos/nmayorov/scikit-learn","forks_url":"https://api.github.com/repos/nmayorov/scikit-learn/forks","keys_url":"https://api.github.com/repos/nmayorov/scikit-learn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nmayorov/scikit-learn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nmayorov/scikit-learn/teams","hooks_url":"https://api.github.com/repos/nmayorov/scikit-learn/hooks","issue_events_url":"https://api.github.com/repos/nmayorov/scikit-learn/issues/events{/number}","events_url":"https://api.github.com/repos/nmayorov/scikit-learn/events","assignees_url":"https://api.github.com/repos/nmayorov/scikit-learn/assignees{/user}","branches_url":"https://api.github.com/repos/nmayorov/scikit-learn/branches{/branch}","tags_url":"https://api.github.com/repos/nmayorov/scikit-learn/tags","blobs_url":"https://api.github.com/repos/nmayorov/scikit-learn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nmayorov/scikit-learn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nmayorov/scikit-learn/git/refs{/sha}","trees_url":"https://api.github.com/repos/nmayorov/scikit-learn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nmayorov/scikit-learn/statuses/{sha}","languages_url":"https://api.github.com/repos/nmayorov/scikit-learn/languages","stargazers_url":"https://api.github.com/repos/nmayorov/scikit-learn/stargazers","contributors_url":"https://api.github.com/repos/nmayorov/scikit-learn/contributors","subscribers_url":"https://api.github.com/repos/nmayorov/scikit-learn/subscribers","subscription_url":"https://api.github.com/repos/nmayorov/scikit-learn/subscription","commits_url":"https://api.github.com/repos/nmayorov/scikit-learn/commits{/sha}","git_commits_url":"https://api.github.com/repos/nmayorov/scikit-learn/git/commits{/sha}","comments_url":"https://api.github.com/repos/nmayorov/scikit-learn/comments{/number}","issue_comment_url":"https://api.github.com/repos/nmayorov/scikit-learn/issues/comments/{number}","contents_url":"https://api.github.com/repos/nmayorov/scikit-learn/contents/{+path}","compare_url":"https://api.github.com/repos/nmayorov/scikit-learn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nmayorov/scikit-learn/merges","archive_url":"https://api.github.com/repos/nmayorov/scikit-learn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nmayorov/scikit-learn/downloads","issues_url":"https://api.github.com/repos/nmayorov/scikit-learn/issues{/number}","pulls_url":"https://api.github.com/repos/nmayorov/scikit-learn/pulls{/number}","milestones_url":"https://api.github.com/repos/nmayorov/scikit-learn/milestones{/number}","notifications_url":"https://api.github.com/repos/nmayorov/scikit-learn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nmayorov/scikit-learn/labels{/name}","releases_url":"https://api.github.com/repos/nmayorov/scikit-learn/releases{/id}","created_at":"2014-03-26T19:52:15Z","updated_at":"2014-09-30T12:15:47Z","pushed_at":"2015-01-11T17:36:32Z","git_url":"git://github.com/nmayorov/scikit-learn.git","ssh_url":"git@github.com:nmayorov/scikit-learn.git","clone_url":"https://github.com/nmayorov/scikit-learn.git","svn_url":"https://github.com/nmayorov/scikit-learn","homepage":"http://scikit-learn.org","size":58567,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"scikit-learn:master","ref":"master","sha":"963fdce5628a8004be78a3d71d16cf63fc719ee2","user":{"login":"scikit-learn","id":365630,"avatar_url":"https://avatars.githubusercontent.com/u/365630?v=3","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=3","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":"2015-01-14T13:30:16Z","pushed_at":"2015-01-14T13:30:16Z","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":109237,"stargazers_count":4830,"watchers_count":4830,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2786,"mirror_url":null,"open_issues_count":562,"forks":2786,"open_issues":562,"watchers":4830,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/4009"},"html":{"href":"https://github.com/scikit-learn/scikit-learn/pull/4009"},"issue":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/4009"},"comments":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/4009/comments"},"review_comments":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/4009/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/4009/commits"},"statuses":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/statuses/44ad7342839eda19ec9f4ab3cec57aa2009b0e6b"}}}}