Interactive Lab · Model Evaluation

92%, real skill, or a lucky split?

You trained a model, held out a test set, and scored 92%. Ship it? Not so fast. That number came from one particular slice of data, reshuffle the deck and the very same model might read 85% or 96%. A single split gives you one noisy number. k-fold cross-validation rotates the held-out block through the whole dataset and averages the folds, so you get an estimate you can actually trust. Watch the validation block move.

🎬 Watch the 90-second explainer, then slide k and reshuffle below ↓

▶ The playground, pick k, then reshuffle

single 80/20 split
k-fold cross-validation
held-out validation fold training folds (k−1 of them)
2 · fast, coarsethorough · 10
CV score (mean of folds)
±,
rows 20 per-fold mean std (spread)

🧭 Where this fits

Cross-validation is how practitioners avoid shipping a lucky model: it's the default in scikit-learn pipelines, the backbone of Kaggle leaderboards, and the reason a fraud model's reported 94% can be trusted. The ± spread you just saw is what separates a real improvement from noise in every model-comparison meeting.

The code that's actually running



  

🔮 Predict, then test

Click single 80/20 split, then hit Reshuffle data five or six times, watch that one score jump around (85%… 96%… 88%…). Now switch to 5-fold and reshuffle again: the per-fold scores still wiggle, but the mean barely moves. Why is the mean-of-folds a more trustworthy number than any single split? And what is the ± spread quietly telling you that a single number never could?

The takeaway

Your new mental model of cross-validation