-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
How to do LeaveOneOut cross validation #15900
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
(Would we be able to define r2 better if we could fit metrics on a
dataset??)
… |
I guess this is not a problem, because we'll get nan if we rely on default r2 when using GridSearchCV to solve regression problems
|
Though I think it's not good to return nan. I tried to google things like |
Currrently, we have two ways to do LOO cv in scikit-learn
The first one is in GridSearchCV, where we calculate the score of each fold (i.e., each sample) and then take the average.
The second one is in RidgeCV, where we calculate the prediction of each fold (i.e., each sample), put them together and calculate the score.
I think this inconsistency is annoying.
Another issue is that whether we should consider sample_weight when averaging the scores in the first option and when calculating the scores in the second option. We do so in RidgeCV, but don't do so in GridSearchCV.
Related to RidgeCV issues ping @glemaitre
The text was updated successfully, but these errors were encountered: