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
train_test_split documentation: add example for stratify
param
#18735
Conversation
Source (of inspiration): https://stackoverflow.com/a/38889389/4883320
stratify
paramstratify
param
Thanks for the PR @kirisakow , we usually don't include these details in the docstring, but rather in the user guide. In this case I think we can just add a "For more details on stratification, see the <User Guide -- Link here> " and link to https://scikit-learn.org/dev/modules/cross_validation.html#cross-validation-iterators-with-stratification-based-on-class-labels We may also add a note that train_test_split behaves exactly like SSS in this subsection: |
Thank you for explanation and counter-proposal @NicolasHug. I was actually afraid my suggestion would meet a snobbish reaction and would be dismissed |
Hi @kirisakow, thanks for your pull request.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @kirisakow , minor suggestion on top of @cmarmo 's comment. Otherwise LGTM
Fix line length
@cmarmo, @NicolasHug, done! Please, accept my apologies for my clumsiness. |
Co-authored-by: Nicolas Hug <contact@nicolas-hug.com>
Co-authored-by: Nicolas Hug <contact@nicolas-hug.com>
Thanks @kirisakow ! |
Thank YOU, both of you, for your kind support! |
Reference Issues/PRs
None
What does this implement/fix? Explain your changes.
Provided an understandable example to the
train_test_split
function documentation, namely concerning thestratify
parameter. Inspired by this reply on StackOverflow.