8000 MNT Replaced kwargs by named args for train_test_split by hugolmn · Pull Request #17216 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

MNT Replaced kwargs by named args for train_test_split #17216

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 4 commits into from
May 14, 2020
Merged

MNT Replaced kwargs by named args for train_test_split #17216

merged 4 commits into from
May 14, 2020

Conversation

hugolmn
Copy link
Contributor
@hugolmn hugolmn commented May 14, 2020

What does this implement/fix? Explain your changes.

By using **options in the argument list, named arguments where not immediately shown when pressing shift+tab in jupyter. I replaced it by using named arguments and their default values described in the docstring.

Copy link
Member
@rth rth left a comment

Choose a reason for hiding this comment

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

Thanks @hugolmn ! Looking at git blame https://github.com/scikit-learn/scikit-learn/blame/85d24b3cb5897ce4b864d9f229d8b9fcae8d5ce7/sklearn/model_selection/_split.py#L2075 I can't see any obvious reasons why it was done in such a convoluted way.

Looks good to me assuming CI passes.

@rth
Copy link
Member
rth commented May 14, 2020

Hmm, actually key word only argument don't seem to work with first *args argument. Which makes sense, as one cannot pass e.g. test_size positionally. Then we are back to not understanding why it was done that way initially.

@NicolasHug NicolasHug changed the title Replaced kwargs by named args for train_test_split MNT Replaced kwargs by named args for train_test_split May 14, 2020
@NicolasHug NicolasHug merged commit 8abe0a8 into scikit-learn:master May 14, 2020
@NicolasHug
Copy link
Member

Thanks @hugolmn

@hugolmn hugolmn deleted the hugolmn-train_test_split-definition branch May 14, 2020 13:25
@thomasjpfan
Copy link
Member

This is amazing! I have ran into this many times when using train_test_split. Thank you @hugolmn !!

gio8tisu pushed a commit to gio8tisu/scikit-learn that referenced this pull request May 15, 2020
viclafargue pushed a commit to viclafargue/scikit-learn that referenced this pull request Jun 26, 2020
jayzed82 pushed a commit to jayzed82/scikit-learn that referenced this pull request Oct 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0