Skip to main content
AI & ML Code Completion Hard +35 XP

Cross Validation

Complete the k-fold cross validation call.

AI & MLFill in the blank
from sklearn.model_selection import cross_val_score
scores = ___(model, X, y, cv=5)

Type the missing code

Show answer and explanation

Answer: cross_val_score

cross_val_score performs k-fold CV: splits data into k folds, trains/tests k times, returns k accuracy scores for robust evaluation.

Hint: Which function performs k-fold cross validation?

What this challenge tests

Code Completion in AI & ML: cross-validation, model-evaluation.

Related challenges