{"action":"created","issue":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/4294","labels_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/4294/labels{/name}","comments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/4294/comments","events_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/4294/events","html_url":"https://github.com/scikit-learn/scikit-learn/pull/4294","id":58896940,"number":4294,"title":"[WIP] Reorganize grid_search, cross_validation and learning_curve into model_selection","user":{"login":"rvraghav93","id":9487348,"avatar_url":"https://avatars.githubusercontent.com/u/9487348?v=3","gravatar_id":"","url":"https://api.github.com/users/rvraghav93","html_url":"https://github.com/rvraghav93","followers_url":"https://api.github.com/users/rvraghav93/followers","following_url":"https://api.github.com/users/rvraghav93/following{/other_user}","gists_url":"https://api.github.com/users/rvraghav93/gists{/gist_id}","starred_url":"https://api.github.com/users/rvraghav93/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rvraghav93/subscriptions","organizations_url":"https://api.github.com/users/rvraghav93/orgs","repos_url":"https://api.github.com/users/rvraghav93/repos","events_url":"https://api.github.com/users/rvraghav93/events{/privacy}","received_events_url":"https://api.github.com/users/rvraghav93/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":73,"created_at":"2015-02-25T12:54:52Z","updated_at":"2015-06-23T14:26:34Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/4294","html_url":"https://github.com/scikit-learn/scikit-learn/pull/4294","diff_url":"https://github.com/scikit-learn/scikit-learn/pull/4294.diff","patch_url":"https://github.com/scikit-learn/scikit-learn/pull/4294.patch"},"body":"fixes #1848 \r\n<hr>\r\n**TODO**\r\n- [ ] Reorganize the classes / functions into the `model_selection` module.\r\n- [ ] Use split in all the files that use cv ? (or fix `check_cv` to return the split-ed generator itself so both old style and new style classes can be used)\r\n- [x] Refactor the tests.\r\n- [x] Fix all the imports\r\n- [ ] Make all the general tests pass\r\n- [ ] Make all the `model_selction` tests pass\r\n\r\n<hr>\r\n\r\n**After MRG+1**\r\n- [ ] Clean up the old style classes to use as much from the new members as possible after getting \r\nMRG+1 (duplicate as little code as possible)\r\n- [ ] Clean up the documentation\r\n- [ ]  Fix the examples\r\n\r\n\r\n<hr>\r\n**NOTE:**\r\nThe current implementation will still not support nesting `EstimatorCV` inside `GridSearchCV`... This will become possible only after allowing `sample_properties` to pass from `GridSearchCV` to `EstimatorCV`...\r\n<hr>\r\n**PRs whose changes to g_s / c_v / l_c have been manually incorporated into this:**\r\n\r\n#4714 - Svm decision function shape - 1 commit\r\n#4829 - merge _check_cv into check_cv ... -  1 commit\r\n#4857 - Document missing attribute `random_state` in `RandomizedSearchCV` - 1 commit\r\n<hr>\r\nThis PR is slightly based upon @pignacio's work in #3340."},"comment":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/comments/114523116","html_url":"https://github.com/scikit-learn/scikit-learn/pull/4294#issuecomment-114523116","issue_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/4294","id":114523116,"user":{"login":"rvraghav93","id":9487348,"avatar_url":"https://avatars.githubusercontent.com/u/9487348?v=3","gravatar_id":"","url":"https://api.github.com/users/rvraghav93","html_url":"https://github.com/rvraghav93","followers_url":"https://api.github.com/users/rvraghav93/followers","following_url":"https://api.github.com/users/rvraghav93/following{/other_user}","gists_url":"https://api.github.com/users/rvraghav93/gists{/gist_id}","starred_url":"https://api.github.com/users/rvraghav93/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rvraghav93/subscriptions","organizations_url":"https://api.github.com/users/rvraghav93/orgs","repos_url":"https://api.github.com/users/rvraghav93/repos","events_url":"https://api.github.com/users/rvraghav93/events{/privacy}","received_events_url":"https://api.github.com/users/rvraghav93/received_events","type":"User","site_admin":false},"created_at":"2015-06-23T14:26:34Z","updated_at":"2015-06-23T14:26:34Z","body":"2 quick questions - \r\n\r\n1. Can I refactor `check_cv` to take in an optional parameter `return_generator` \r\n2. Since some algorithms need the length of the folds, can I have a function `get_n_folds(X, y=None, labels=None)` to return the same?\r\n\r\nso with 1 and 2 we can do - \r\n```\r\n>>> cv, cv_iter = check_cv(cv, X, y, labels, classifier=is_classifier, return_generator = True)\r\n>>> for tr, te in cv_iter:\r\n...\r\n>>> len = cv.get_n_folds(X, y, labels)\r\n```\r\n\r\nDoes this sound good? "}}