Machine Learning, FoundationsLesson 34 of 92

Module 4 · Generalisation, and the discipline of held-out data

Cross-validation: using every row twice, legally

In this lesson

  • 9 min read
  • 7 reading sections
  • Knowledge check
  • Lesson 3 of 10 in this chapter

This chapter’s goalDesign a validation scheme that matches the structure of the data (grouped, stratified or time-ordered as required) run a hyperparameter search inside it without contaminating the estimate, and state from a learning curve whether the next improvement should come from more data, better features or a different model.

This chapter’s media

The film explains chapter ideas. The audiobook narrates the complete teaching text.

FormatEnglishहिंदी
Chapter filmWatch1:49Not available
Full audiobookNot availableNot available

A little at a time

Explore an idea, try it, then check what stays.

Step 1 of 9Free · no account needed
Lesson steps

The problem with one split

Hold out 20% and score on it. Now do it again with a different random seed. The two scores differ: sometimes by half a point, sometimes by four, depending on how much data you have.

With 500 rows, a 20% test set is 100 rows. If the model gets 83 right you report 83%, and the 95% interval around that runs from roughly 74% to 90%. That range is wide enough to cover “ship it” and “abandon it”. A single split is a measurement with a large and usually unreported error bar.

Cross-validation reduces that error by measuring more than once.

Your place and first choices stay on this browser. Classroom credit is recorded separately.

Every lesson here is open. Your progress is recorded once you pass the How a Language Model Actually Works exam.

Stuck on something?Ask Funke, your AI tutor

How to cite: Addaly (2026) ‘Cross-validation: using every row twice, legally’, in Machine Learning, Foundations. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/machine-learning-foundations/cross-validation (Accessed: 29 November 2026).