-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
Erroneous optional status for y parameter in RepeatedStratifiedKFold.split #29369
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
Comments
Thanks for the issue, indeed it looks like a genuine problem. A PR fixing this and adding a test would be more than welcome. I am going to set the label "Help wanted" and "Easy". |
/take |
@Anurag-Varma Not sure why but the |
Anurag-Varma
added a commit
to Anurag-Varma/scikit-learn
that referenced
this issue
Jul 3, 2024
Fixed the exception issue for sklearn.model_selection.RepeatedStratifiedKFold
Anurag-Varma
added a commit
to Anurag-Varma/scikit-learn
that referenced
this issue
Jul 5, 2024
Fixed the exception issue for sklearn.model_selection.RepeatedStratifiedKFold
Anurag-Varma
added a commit
to Anurag-Varma/scikit-learn
that referenced
this issue
Jul 5, 2024
Fixed the exception issue for sklearn.model_selection.RepeatedStratifiedKFold
Anurag-Varma
added a commit
to Anurag-Varma/scikit-learn
that referenced
this issue
Jul 9, 2024
Fixed the exception issue for sklearn.model_selection.RepeatedStratifiedKFold
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
For context, there is a small difference in the
split
function between the variants of theKFold
class:In class
sklearn.model_selection.KFold
, the split function has an optional parametery
(same for classsklearn.model_selection.RepeatedKFold
).In class
sklearn.model_selection.StratifiedKFold
, the same parametery
is mandatory because "Stratification is done based on the y labels". As expected, omittingy
when callingsplit
causes an explicit error:However
sklearn.model_selection.RepeatedStratifiedKFold
is also a stratified variant which requires parametery
, but the parameter is erroneously left as optional. This seems due to the fact this is implemented through a general class_UnsupportedGroupCVMixin
. As a result, not providingy
causes an unclear error message inconsistent with the one forStratifiedKFold
in the same context.Steps/Code to Reproduce
Expected Results
Same error message 'missing 1 required positional argument' in both cases.
Actual Results
expected error in first example, erroneous behavior in second example.
Versions
The text was updated successfully, but these errors were encountered: