Explore Library
Code QuizIntermediate

Aggregating Cross-Validation Scores

Cross-validation results are summarized with the wrong reduction, hiding the spread across folds.

Codepython
import numpy as np
from sklearn.model_selection import cross_val_score

scores = cross_val_score(model, X, y, cv=5)

mean_score = np.mean(scores)
std_score = np.mean(scores)

print(f"Accuracy: {mean_score:.3f} +/- {std_score:.3f}")

What is the bug in how the cross-validation scores are aggregated?