{"action":"created","comment":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/comments/94131244","pull_request_review_id":14661270,"id":94131244,"diff_hunk":"@@ -804,6 +806,69 @@ def test_leave_one_p_group_out_error_on_fewer_number_of_groups():\n                          LeavePGroupsOut(n_groups=3).split(X, y, groups))\n \n \n+def test_repeated_kfold_value_errors():\n+    # n_repeats is not integer or <= 1\n+    assert_raises(ValueError, RepeatedKFold, n_repeats=1)\n+    assert_raises(ValueError, RepeatedKFold, n_repeats=1.5)\n+\n+\n+def test_repeated_kfold_determinstic_split():\n+    X = [[1, 2], [3, 4], [5, 6], [7, 8], [9, 10]]\n+    random_state = 258173307\n+    splits = RepeatedKFold(\n+        n_splits=2,\n+        n_repeats=2,\n+        random_state=random_state).split(X)\n+\n+    train, test = next(splits)\n+    assert_array_equal(train, [0, 3])\n+    assert_array_equal(test, [1, 2, 4])\n+\n+    train, test = next(splits)\n+    assert_array_equal(train, [1, 2, 4])\n+    assert_array_equal(test, [0, 3])\n+\n+    train, test = next(splits)\n+    assert_array_equal(train, [3, 4])\n+    assert_array_equal(test, [0, 1, 2])\n+\n+    train, test = next(splits)\n+    assert_array_equal(train, [0, 1, 2])\n+    assert_array_equal(test, [3, 4])\n+\n+\n+def test_repeated_stratified_kfold_errors():\n+    # n_repeats is not integer or <= 1\n+    assert_raises(ValueError, RepeatedStratifiedKFold, n_repeats=1)","path":"sklearn/model_selection/tests/test_split.py","position":46,"original_position":46,"commit_id":"c631b31450951a939c1d378501b3b13ce11ccad8","original_commit_id":"c631b31450951a939c1d378501b3b13ce11ccad8","user":{"login":"jnothman","id":78827,"avatar_url":"https://avatars.githubusercontent.com/u/78827?v=3","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},"body":"do this in a loop together with the `RepeatedKFold` case.","created_at":"2016-12-29T12:32:11Z","updated_at":"2016-12-29T12:32:50Z","html_url":"https://github.com/scikit-learn/scikit-learn/pull/8120#discussion_r94131244","pull_request_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/8120","_links":{"self":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/comments/94131244"},"html":{"href":"https://github.com/scikit-learn/scikit-learn/pull/8120#discussion_r94131244"},"pull_request":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/8120"}}},"pull_request":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/8120","id":99414466,"html_url":"https://github.com/scikit-learn/scikit-learn/pull/8120","diff_url":"https://github.com/scikit-learn/scikit-learn/pull/8120.diff","patch_url":"https://github.com/scikit-learn/scikit-learn/pull/8120.patch","issue_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/8120","number":8120,"state":"open","locked":false,"title":"[MRG] Repeated K-Fold and Repeated Stratified K-Fold","user":{"login":"neerajgangwar","id":553989,"avatar_url":"https://avatars.githubusercontent.com/u/553989?v=3","gravatar_id":"","url":"https://api.github.com/users/neerajgangwar","html_url":"https://github.com/neerajgangwar","followers_url":"https://api.github.com/users/neerajgangwar/followers","following_url":"https://api.github.com/users/neerajgangwar/following{/other_user}","gists_url":"https://api.github.com/users/neerajgangwar/gists{/gist_id}","starred_url":"https://api.github.com/users/neerajgangwar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neerajgangwar/subscriptions","organizations_url":"https://api.github.com/users/neerajgangwar/orgs","repos_url":"https://api.github.com/users/neerajgangwar/repos","events_url":"https://api.github.com/users/neerajgangwar/events{/privacy}","received_events_url":"https://api.github.com/users/neerajgangwar/received_events","type":"User","site_admin":false},"body":"<!--\r\nThanks for contributing a pull request! Please ensure you have taken a look at\r\nthe contribution guidelines: https://github.com/scikit-learn/scikit-learn/blob/master/CONTRIBUTING.md#Contributing-Pull-Requests\r\n-->\r\n#### Reference Issue\r\nFixes #7948 \r\n\r\n\r\n#### What does this implement/fix? Explain your changes.\r\nImplements RepeatedKFold and RepeatedStratifiedKFold\r\n\r\n#### Any other comments?\r\nFor previous discussion on this, please refer to #7960 \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":"2016-12-27T07:33:32Z","updated_at":"2016-12-29T12:32:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bc9cc2acb447be28df8a4127c2277d6c10b5bc8d","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/8120/commits","review_comments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/8120/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/8120/comments","statuses_url":"https://api.github.com/repos/scikit-learn/scikit-learn/statuses/c631b31450951a939c1d378501b3b13ce11ccad8","head":{"label":"neerajgangwar:feature/repeated-splits","ref":"feature/repeated-splits","sha":"c631b31450951a939c1d378501b3b13ce11ccad8","user":{"login":"neerajgangwar","id":553989,"avatar_url":"https://avatars.githubusercontent.com/u/553989?v=3","gravatar_id":"","url":"https://api.github.com/users/neerajgangwar","html_url":"https://github.com/neerajgangwar","followers_url":"https://api.github.com/users/neerajgangwar/followers","following_url":"https://api.github.com/users/neerajgangwar/following{/other_user}","gists_url":"https://api.github.com/users/neerajgangwar/gists{/gist_id}","starred_url":"https://api.github.com/users/neerajgangwar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neerajgangwar/subscriptions","organizations_url":"https://api.github.com/users/neerajgangwar/orgs","repos_url":"https://api.github.com/users/neerajgangwar/repos","events_url":"https://api.github.com/users/neerajgangwar/events{/privacy}","received_events_url":"https://api.github.com/users/neerajgangwar/received_events","type":"User","site_admin":false},"repo":{"id":70310875,"name":"scikit-learn","full_name":"neerajgangwar/scikit-learn","owner":{"login":"neerajgangwar","id":553989,"avatar_url":"https://avatars.githubusercontent.com/u/553989?v=3","gravatar_id":"","url":"https://api.github.com/users/neerajgangwar","html_url":"https://github.com/neerajgangwar","followers_url":"https://api.github.com/users/neerajgangwar/followers","following_url":"https://api.github.com/users/neerajgangwar/following{/other_user}","gists_url":"https://api.github.com/users/neerajgangwar/gists{/gist_id}","starred_url":"https://api.github.com/users/neerajgangwar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neerajgangwar/subscriptions","organizations_url":"https://api.github.com/users/neerajgangwar/orgs","repos_url":"https://api.github.com/users/neerajgangwar/repos","events_url":"https://api.github.com/users/neerajgangwar/events{/privacy}","received_events_url":"https://api.github.com/users/neerajgangwar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/neerajgangwar/scikit-learn","description":"scikit-learn: machine learning in Python","fork":true,"url":"https://api.github.com/repos/neerajgangwar/scikit-learn","forks_url":"https://api.github.com/repos/neerajgangwar/scikit-learn/forks","keys_url":"https://api.github.com/repos/neerajgangwar/scikit-learn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/neerajgangwar/scikit-learn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/neerajgangwar/scikit-learn/teams","hooks_url":"https://api.github.com/repos/neerajgangwar/scikit-learn/hooks","issue_events_url":"https://api.github.com/repos/neerajgangwar/scikit-learn/issues/events{/number}","events_url":"https://api.github.com/repos/neerajgangwar/scikit-learn/events","assignees_url":"https://api.github.com/repos/neerajgangwar/scikit-learn/assignees{/user}","branches_url":"https://api.github.com/repos/neerajgangwar/scikit-learn/branches{/branch}","tags_url":"https://api.github.com/repos/neerajgangwar/scikit-learn/tags","blobs_url":"https://api.github.com/repos/neerajgangwar/scikit-learn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/neerajgangwar/scikit-learn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/neerajgangwar/scikit-learn/git/refs{/sha}","trees_url":"https://api.github.com/repos/neerajgangwar/scikit-learn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/neerajgangwar/scikit-learn/statuses/{sha}","languages_url":"https://api.github.com/repos/neerajgangwar/scikit-learn/languages","stargazers_url":"https://api.github.com/repos/neerajgangwar/scikit-learn/stargazers","contributors_url":"https://api.github.com/repos/neerajgangwar/scikit-learn/contributors","subscribers_url":"https://api.github.com/repos/neerajgangwar/scikit-learn/subscribers","subscription_url":"https://api.github.com/repos/neerajgangwar/scikit-learn/subscription","commits_url":"https://api.github.com/repos/neerajgangwar/scikit-learn/commits{/sha}","git_commits_url":"https://api.github.com/repos/neerajgangwar/scikit-learn/git/commits{/sha}","comments_url":"https://api.github.com/repos/neerajgangwar/scikit-learn/comments{/number}","issue_comment_url":"https://api.github.com/repos/neerajgangwar/scikit-learn/issues/comments{/number}","contents_url":"https://api.github.com/repos/neerajgangwar/scikit-learn/contents/{+path}","compare_url":"https://api.github.com/repos/neerajgangwar/scikit-learn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/neerajgangwar/scikit-learn/merges","archive_url":"https://api.github.com/repos/neerajgangwar/scikit-learn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/neerajgangwar/scikit-learn/downloads","issues_url":"https://api.github.com/repos/neerajgangwar/scikit-learn/issues{/number}","pulls_url":"https://api.github.com/repos/neerajgangwar/scikit-learn/pulls{/number}","milestones_url":"https://api.github.com/repos/neerajgangwar/scikit-learn/milestones{/number}","notifications_url":"https://api.github.com/repos/neerajgangwar/scikit-learn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/neerajgangwar/scikit-learn/labels{/name}","releases_url":"https://api.github.com/repos/neerajgangwar/scikit-learn/releases{/id}","deployments_url":"https://api.github.com/repos/neerajgangwar/scikit-learn/deployments","created_at":"2016-10-08T06:55:36Z","updated_at":"2016-10-08T06:55:45Z","pushed_at":"2016-12-29T05:01:49Z","git_url":"git://github.com/neerajgangwar/scikit-learn.git","ssh_url":"git@github.com:neerajgangwar/scikit-learn.git","clone_url":"https://github.com/neerajgangwar/scikit-learn.git","svn_url":"https://github.com/neerajgangwar/scikit-learn","homepage":"http://scikit-learn.org","size":77848,"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":"f95e5b1a0d2139a94393954675d4a84920653176","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-12-29T11:52:55Z","pushed_at":"2016-12-29T10:59:34Z","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":78703,"stargazers_count":15569,"watchers_count":15569,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8724,"mirror_url":null,"open_issues_count":1165,"forks":8724,"open_issues":1165,"watchers":15569,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/8120"},"html":{"href":"https://github.com/scikit-learn/scikit-learn/pull/8120"},"issue":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/8120"},"comments":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/8120/comments"},"review_comments":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/8120/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/8120/commits"},"statuses":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/statuses/c631b31450951a939c1d378501b3b13ce11ccad8"}}}}
{"actor":{"display_login":"jnothman"}}