Explore Library
Code QuizIntermediate

Leave-One-Out Setup

Trying to configure leave-one-out cross-validation with the wrong splitter argument.

Codepython
from sklearn.model_selection import KFold, cross_val_score

# Intended: leave-one-out cross-validation
cv = KFold(n_splits=1)
scores = cross_val_score(model, X, y, cv=cv)
print(scores.mean())

What is the bug in this leave-one-out configuration?