-
-
Notifications
You must be signed in to change notification settings - Fork 25.3k
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
Spurious cv FutureWarning with cross_val_score and LeaveOneGroupOut #12370
Comments
how is that spurious? You're not using cv, right? |
Yes. And adding the cv fixes the problem. Sorry for the noise. @KamalakerDadi : this is not the problem in nilearn. |
I meant even if you specify cv. For instance, specifying |
Nope. I don't think so. Sorry. |
I meant even if you specify cv. For instance, specifying cv=LeaveOneGroupOut()
I tried, and couldn't reproduce on the code above. Can you can a small
example that reproduces?
|
Here it is. May be it shouldn't be used this way ? from sklearn.datasets import make_blobs
from sklearn.model_selection import GridSearchCV, cross_val_score, ShuffleSplit
from sklearn.svm import SVC
X, y = make_blobs(n_samples=40, centers=2, random_state=6)
cv = ShuffleSplit()
svm_cv = GridSearchCV(SVC(C=1., kernel='linear'), param_grid={'C': [.1, .5]})
cross_val_score(svm_cv, X, y, cv=cv) |
You're doing a nested cross validation here @KamalakerDadi, for each fold in |
Thanks @adrinjalali it makes sense. |
The following code raises a FutureWarning:
Ouput:
This seems spurious to me.
The text was updated successfully, but these errors were encountered: