Repository navigation
Add shape of stratify in train_test_split documentation - #34510
Conversation
|
Thank you for opening your first pull request to scikit-learn! 🎉 To help get your contribution reviewed, please make sure that:
|
StefanieSenger
left a comment
There was a problem hiding this comment.
Thanks for your PR, @mathaziz!
Just a little nit comment, and then we're good to go.
| then stratify must be None. | ||
|
|
||
| stratify : array-like, default=None | ||
| stratify : array-like of shape (shape[0],), default=None |
There was a problem hiding this comment.
Little nit: I think it would be better to use n_samples instead of shape[0]. Otherwise, we would have to define shape of what, and the name of the *arrays can differ.
There was a problem hiding this comment.
Indeed, it is inconsistent with the standard, so I replaced shape[0] with n_samples.
To do that however, I also changed the description of the first parameter *arrays to introduce n_samples.
I took inspiration from the resample documentation : https://github.com/scikit-learn/scikit-learn/blob/cc50648cc/sklearn/utils/_indexing.py#L418
StefanieSenger
left a comment
There was a problem hiding this comment.
Tests now pass. I will merge.
Congrats on your first contribution to scikit-learn, @mathaziz! 🎉 🎉 🎉
(The tests run on different architecture on the CI, and the assertion was only off by a very small number. I don't think it's worth investigating this.)
|
Great, thanks @StefanieSenger for your help! A first contribution among many to comes🤞🏼 |
…#34510) Co-authored-by: Abdellaziz <[email protected]>
…#34510) Co-authored-by: Abdellaziz <[email protected]>
Reference Issues/PRs
FIxes #34504What does this implement/fix? Explain your changes.
Added information in the documentation
First time contributor introduction
I did this fix while participating to the EuroPython 2026 SprintsAI usage disclosure
Any other comments?
Very nice first issue
Thanks