Skip to content

documentation for random_state in model_selection/split #15575

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Feb 11, 2020

Conversation

edwardcqian
Copy link
Contributor

@edwardcqian edwardcqian commented Nov 9, 2019

Reference Issues/PRs
part of this issue: #15222

What does this implement/fix? Explain your changes.
This PR improves the documentation for KFold, StratifiedKFold, _RepeatedSplits, RepeatedKFold, RepeatedStratifiedKFold, ShuffleSplit, GroupShuffleSplit, StratifiedShuffleSplit, and train_test_split by identifying the effects of randomness. Only the sklearn/model_selection/_split.py file was changed.

@edwardcqian edwardcqian changed the title added docs for KFold documentation for random_state in model_selection/split Nov 9, 2019
@cmarmo
Copy link
Contributor

cmarmo commented Jan 8, 2020

Dear @edwardcqian , sorry, this PR went probably lost during the 0.22 release process.
We are planning to reuse the issue you addressed in the next sprints: could you please let us know if are still willing to finalize this PR? If yes, maybe @NicolasHug could take a look at it?
Thanks for your patience and collaboration.

@NicolasHug
Copy link
Member

Thanks for the PR @edwardcqian, it looks good. On top of @cmarmo 's comments, please add something like :

Set to an int for reproducible splits across calls to split

for every docstring.

Copy link
Member

@glemaitre glemaitre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some other nitpicks

@cmarmo
Copy link
Contributor

cmarmo commented Jan 22, 2020

Thanks @edwardcqian! Could you please sync with master, as there are some conflicts to manage.

@NicolasHug
Copy link
Member

Also please address #15575 (comment)

Copy link
Member

@NicolasHug NicolasHug left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nevermind, it looks like it was addressed in another PR.

Last comment and LGMT

@cmarmo
Copy link
Contributor

cmarmo commented Jan 27, 2020

@edwardcqian in the meanwhile some conflicts arised: could you please sync with master? Then maybe @glemaitre could finalize his review? Thanks to both of you!

@glemaitre glemaitre self-requested a review February 11, 2020 16:33
Comment on lines 1094 to 1095
Passes `random_state` to the arbitrary repeating cross validator. Pass
an int for reproducible output across multiple function calls.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new line

Comment on lines 1198 to 1199
Random state used to control the randomness of each repeated
cross-validation instance.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Controls the randomness of each repeated cross-validation instance.

@@ -1247,8 +1249,8 @@ class RepeatedStratifiedKFold(_RepeatedSplits):
Number of times cross-validator needs to be repeated.

random_state : int or RandomState instance, default=None
Pass an int for reproducible output across multiple
function calls.
Random state to be used to generate random state for each repetition.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Controls the generation of the random states for each repetition."

@glemaitre glemaitre merged commit 0904058 into scikit-learn:master Feb 11, 2020
@glemaitre
Copy link
Member

@edwardcqian I pushed a couple of fixes and merged. Thanks for your contribution

thomasjpfan pushed a commit to thomasjpfan/scikit-learn that referenced this pull request Feb 22, 2020
panpiort8 pushed a commit to panpiort8/scikit-learn that referenced this pull request Mar 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants