Visual explainer
Cross-Validation
How rotating the held-out slice over five folds turns one lucky split into an honest average.
You split 80/20 once and the hardest cases all hide in the 20. Your score reads 0.25 while the honest value is 0.208. One slice decided, and luck decided the slice for you.
Cut Five Strips
Cut your hundred points into five strips of twenty. Each round trains on 80 and tests on a different 20. Every point gets tested exactly once and trains four times over.
Average Five Scores
Run all five rounds and write down each error: 0.22, 0.18, 0.25, 0.20, 0.19. They sum to 1.04, so divide by 5 for exactly 0.208. No single round gets the final word anymore.
Deal Rare Cases Evenly
Ten positives in a hundred means random folds often test on zero of them. Stratifying deals exactly two rare cases into every fold of twenty. No fold grades on the majority class alone.
Steadier For Five Times Cost
Your five scores span just 0.07 around a mean of 0.208, plus or minus 0.025. The single split gambled everything on 0.25. You bought that steadiness with five trainings instead of one.
Count Your Trainings
Five folds is the usual pick for tabular data. Ten folds suits tiny datasets where every point matters. But when one training takes days, you flip to a single split and accept the noise.
Where It Breaks
Scale with the whole dataset mean before splitting and the held-out fold already whispers through your training. Scores read a lying 0.12. Split first, fit the scaler on the 80, then apply it to the 20.
The Quick Version
- One split traps hard cases, reports 0.25.
- Five strips of twenty share the work.
- Scores average to exactly 0.208.
- Each fold keeps two rare positives.
- Five trainings buy plus or minus 0.025.
- Giant nets flip back to one split.
- Scale inside folds, never before them.