{"action":"created","comment":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/comments/61522099","id":61522099,"diff_hunk":"@@ -169,3 +170,82 @@ def test_gridsearch():\n \n     grid = GridSearchCV(estimator=eclf, param_grid=params, cv=5)\n     grid.fit(iris.data, iris.target)\n+\n+\n+def test_threading_predict_proba_on_toy_problem():\n+    \"\"\"Check multithreading backend of VotingClassifier on toy dataset.\"\"\"\n+    clf1 = LogisticRegression(random_state=123)\n+    clf2 = RandomForestClassifier(random_state=123)\n+    clf3 = GaussianNB()\n+    X = np.array([[-1.1, -1.5], [-1.2, -1.4], [-3.4, -2.2], [1.1, 1.2]])\n+    y = np.array([1, 1, 2, 2])\n+\n+    eclf1 = VotingClassifier(estimators=[\n+        ('lr', clf1), ('rf', clf2), ('gnb', clf3)],\n+        voting='soft', n_jobs=1, backend='threading').fit(X, y)\n+    eclf2 = VotingClassifier(estimators=[\n+        ('lr', clone(clf1)), ('rf', clone(clf2)), ('gnb', clone(clf3))],\n+        voting='soft', n_jobs=-1, backend='multiprocessing').fit(X, y)\n+\n+    assert_array_equal(eclf1.predict(X), eclf2.predict(X))\n+    assert_array_equal(eclf1.predict_proba(X), eclf2.predict_proba(X))\n+\n+\n+def test_multiprocessing_majority_label_iris():\n+    \"\"\"\n+       Check multiprocessing backend of VotingClassifier\n+       by majority label on dataset iris.\n+    \"\"\"\n+    clf1 = LogisticRegression(random_state=123)\n+    clf2 = RandomForestClassifier(random_state=123)\n+    clf3 = GaussianNB()\n+    eclf1 = VotingClassifier(estimators=[\n+        ('lr', clf1), ('rf', clf2), ('gnb', clf3)],\n+        voting='hard', n_jobs=1).fit(X, y)\n+    eclf2 = VotingClassifier(estimators=[\n+        ('lr', clone(clf1)), ('rf', clone(clf2)), ('gnb', clone(clf3))],\n+        voting='hard', n_jobs=-1).fit(X, y)\n+    assert_array_equal(eclf1.predict(X), eclf2.predict(X))\n+\n+\n+def test_multithreading_majority_label_iris():\n+    \"\"\"\n+       Check multithreading backend of VotingClassifier\n+       by majority label on dataset iris.\n+    \"\"\"\n+    clf1 = LogisticRegression(random_state=123)\n+    clf2 = RandomForestClassifier(random_state=123)\n+    clf3 = GaussianNB()\n+    eclf1 = VotingClassifier(estimators=[\n+        ('lr', clf1), ('rf', clf2), ('gnb', clf3)],\n+        voting='soft', n_jobs=1, backend='threading').fit(X, y)\n+    eclf2 = VotingClassifier(estimators=[\n+        ('lr', clone(clf1)), ('rf', clone(clf2)), ('gnb', clone(clf3))],\n+        voting='soft', n_jobs=-1, backend='multiprocessing').fit(X, y)","path":"sklearn/ensemble/tests/test_voting_classifier.py","position":37,"original_position":73,"commit_id":"745d3fa38ecd9a65b04ff3665a44f3e3a1f22274","original_commit_id":"745d3fa38ecd9a65b04ff3665a44f3e3a1f22274","user":{"login":"MechCoder","id":1867024,"avatar_url":"https://avatars.githubusercontent.com/u/1867024?v=3","gravatar_id":"","url":"https://api.github.com/users/MechCoder","html_url":"https://github.com/MechCoder","followers_url":"https://api.github.com/users/MechCoder/followers","following_url":"https://api.github.com/users/MechCoder/following{/other_user}","gists_url":"https://api.github.com/users/MechCoder/gists{/gist_id}","starred_url":"https://api.github.com/users/MechCoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MechCoder/subscriptions","organizations_url":"https://api.github.com/users/MechCoder/orgs","repos_url":"https://api.github.com/users/MechCoder/repos","events_url":"https://api.github.com/users/MechCoder/events{/privacy}","received_events_url":"https://api.github.com/users/MechCoder/received_events","type":"User","site_admin":false},"body":"You should test with a smaller value of `n_jobs`, like 2 for instance","created_at":"2016-04-29T00:12:44Z","updated_at":"2016-04-29T00:12:44Z","html_url":"https://github.com/scikit-learn/scikit-learn/pull/5805#discussion_r61522099","pull_request_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/5805","_links":{"self":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/comments/61522099"},"html":{"href":"https://github.com/scikit-learn/scikit-learn/pull/5805#discussion_r61522099"},"pull_request":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/5805"}}},"pull_request":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/5805","id":50564195,"html_url":"https://github.com/scikit-learn/scikit-learn/pull/5805","diff_url":"https://github.com/scikit-learn/scikit-learn/pull/5805.diff","patch_url":"https://github.com/scikit-learn/scikit-learn/pull/5805.patch","issue_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/5805","number":5805,"state":"open","locked":false,"title":"[MRG] parallelized VotingClassifier","user":{"login":"olologin","id":4762581,"avatar_url":"https://avatars.githubusercontent.com/u/4762581?v=3","gravatar_id":"","url":"https://api.github.com/users/olologin","html_url":"https://github.com/olologin","followers_url":"https://api.github.com/users/olologin/followers","following_url":"https://api.github.com/users/olologin/following{/other_user}","gists_url":"https://api.github.com/users/olologin/gists{/gist_id}","starred_url":"https://api.github.com/users/olologin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olologin/subscriptions","organizations_url":"https://api.github.com/users/olologin/orgs","repos_url":"https://api.github.com/users/olologin/repos","events_url":"https://api.github.com/users/olologin/events{/privacy}","received_events_url":"https://api.github.com/users/olologin/received_events","type":"User","site_admin":false},"body":"First version, looks like it's working :)\r\nAlso, i added sample_weight parameter into fit method, don't know if it's appropriate.","created_at":"2015-11-12T20:37:16Z","updated_at":"2016-04-29T00:12:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f578734e79d50b2a53af847b45b979447fd5f711","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/5805/commits","review_comments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/5805/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/5805/comments","statuses_url":"https://api.github.com/repos/scikit-learn/scikit-learn/statuses/745d3fa38ecd9a65b04ff3665a44f3e3a1f22274","head":{"label":"olologin:votingclassifier_multithreading","ref":"votingclassifier_multithreading","sha":"745d3fa38ecd9a65b04ff3665a44f3e3a1f22274","user":{"login":"olologin","id":4762581,"avatar_url":"https://avatars.githubusercontent.com/u/4762581?v=3","gravatar_id":"","url":"https://api.github.com/users/olologin","html_url":"https://github.com/olologin","followers_url":"https://api.github.com/users/olologin/followers","following_url":"https://api.github.com/users/olologin/following{/other_user}","gists_url":"https://api.github.com/users/olologin/gists{/gist_id}","starred_url":"https://api.github.com/users/olologin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olologin/subscriptions","organizations_url":"https://api.github.com/users/olologin/orgs","repos_url":"https://api.github.com/users/olologin/repos","events_url":"https://api.github.com/users/olologin/events{/privacy}","received_events_url":"https://api.github.com/users/olologin/received_events","type":"User","site_admin":false},"repo":{"id":40370575,"name":"scikit-learn","full_name":"olologin/scikit-learn","owner":{"login":"olologin","id":4762581,"avatar_url":"https://avatars.githubusercontent.com/u/4762581?v=3","gravatar_id":"","url":"https://api.github.com/users/olologin","html_url":"https://github.com/olologin","followers_url":"https://api.github.com/users/olologin/followers","following_url":"https://api.github.com/users/olologin/following{/other_user}","gists_url":"https://api.github.com/users/olologin/gists{/gist_id}","starred_url":"https://api.github.com/users/olologin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olologin/subscriptions","organizations_url":"https://api.github.com/users/olologin/orgs","repos_url":"https://api.github.com/users/olologin/repos","events_url":"https://api.github.com/users/olologin/events{/privacy}","received_events_url":"https://api.github.com/users/olologin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/olologin/scikit-learn","description":"scikit-learn: machine learning in Python","fork":true,"url":"https://api.github.com/repos/olologin/scikit-learn","forks_url":"https://api.github.com/repos/olologin/scikit-learn/forks","keys_url":"https://api.github.com/repos/olologin/scikit-learn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/olologin/scikit-learn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/olologin/scikit-learn/teams","hooks_url":"https://api.github.com/repos/olologin/scikit-learn/hooks","issue_events_url":"https://api.github.com/repos/olologin/scikit-learn/issues/events{/number}","events_url":"https://api.github.com/repos/olologin/scikit-learn/events","assignees_url":"https://api.github.com/repos/olologin/scikit-learn/assignees{/user}","branches_url":"https://api.github.com/repos/olologin/scikit-learn/branches{/branch}","tags_url":"https://api.github.com/repos/olologin/scikit-learn/tags","blobs_url":"https://api.github.com/repos/olologin/scikit-learn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/olologin/scikit-learn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/olologin/scikit-learn/git/refs{/sha}","trees_url":"https://api.github.com/repos/olologin/scikit-learn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/olologin/scikit-learn/statuses/{sha}","languages_url":"https://api.github.com/repos/olologin/scikit-learn/languages","stargazers_url":"https://api.github.com/repos/olologin/scikit-learn/stargazers","contributors_url":"https://api.github.com/repos/olologin/scikit-learn/contributors","subscribers_url":"https://api.github.com/repos/olologin/scikit-learn/subscribers","subscription_url":"https://api.github.com/repos/olologin/scikit-learn/subscription","commits_url":"https://api.github.com/repos/olologin/scikit-learn/commits{/sha}","git_commits_url":"https://api.github.com/repos/olologin/scikit-learn/git/commits{/sha}","comments_url":"https://api.github.com/repos/olologin/scikit-learn/comments{/number}","issue_comment_url":"https://api.github.com/repos/olologin/scikit-learn/issues/comments{/number}","contents_url":"https://api.github.com/repos/olologin/scikit-learn/contents/{+path}","compare_url":"https://api.github.com/repos/olologin/scikit-learn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/olologin/scikit-learn/merges","archive_url":"https://api.github.com/repos/olologin/scikit-learn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/olologin/scikit-learn/downloads","issues_url":"https://api.github.com/repos/olologin/scikit-learn/issues{/number}","pulls_url":"https://api.github.com/repos/olologin/scikit-learn/pulls{/number}","milestones_url":"https://api.github.com/repos/olologin/scikit-learn/milestones{/number}","notifications_url":"https://api.github.com/repos/olologin/scikit-learn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/olologin/scikit-learn/labels{/name}","releases_url":"https://api.github.com/repos/olologin/scikit-learn/releases{/id}","deployments_url":"https://api.github.com/repos/olologin/scikit-learn/deployments","created_at":"2015-08-07T16:41:42Z","updated_at":"2016-04-23T19:58:35Z","pushed_at":"2016-04-23T19:58:04Z","git_url":"git://github.com/olologin/scikit-learn.git","ssh_url":"git@github.com:olologin/scikit-learn.git","clone_url":"https://github.com/olologin/scikit-learn.git","svn_url":"https://github.com/olologin/scikit-learn","homepage":"http://scikit-learn.org","size":64904,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"d21a297d24efe3bce9e2ba95d10458dd78112120","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}","deployments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/deployments","created_at":"2010-08-17T09:43:38Z","updated_at":"2016-04-28T23:59:26Z","pushed_at":"2016-04-28T20:29:41Z","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":113088,"stargazers_count":11107,"watchers_count":11107,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6450,"mirror_url":null,"open_issues_count":1167,"forks":6450,"open_issues":1167,"watchers":11107,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/5805"},"html":{"href":"https://github.com/scikit-learn/scikit-learn/pull/5805"},"issue":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/5805"},"comments":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/5805/comments"},"review_comments":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/5805/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/5805/commits"},"statuses":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/statuses/745d3fa38ecd9a65b04ff3665a44f3e3a1f22274"}}}}