Level 2 · Module 11 · 10 minutes
Three piles of data: training, validation and test
- Explain the separate jobs of training, validation and test data.
- Explain why the test pile must not be used for comparisons or tuning.
- Describe why time order and repeated entities need special splits.
A model needs data it has not seen in order to prove it has learned something general. Testing on the same rows used for training rewards memorisation, not learning. The standard answer is to divide the rows into three piles with different jobs.
The job of each pile
- Training rows adjust the model's internal numbers. The model sees both the features and the correct answers.
- Validation rows are used while building. They help you compare settings, choose a version or decide when to stop.
- Test rows are kept aside until the end. They give the final estimate of how the chosen model will behave on new cases.
Most rows go to training, and smaller shares go to validation and test. The exact shares matter less than the discipline: do not let the test pile influence any choice.
Why validation is separate from test
If you compare several models on the test pile, you start learning its quirks. Choose enough versions and the winner will be the version that happens to suit those particular rows, not the one that generalises. The test pile stops being an honest judge. Validation exists so that comparisons and tuning consume a pile you are allowed to see, leaving the test pile untouched for a single final check.
Order and groups can matter
For time-based data, split by time: train on earlier periods and test on later ones. A random split lets the model learn from the future, which would be impossible in real use. For data with repeated people or places, keep all rows for one entity in the same pile, or the model can recognise the entity instead of learning the pattern. These issues are covered again in the lesson on leakage.
What the scores mean
A good validation score tells you that a choice was reasonable. A good test score tells you what to expect on new rows from the same situation. Neither says anything about a different population or a process that has changed since the data was collected, which is why monitoring continues after a model is in use.
Practice versus real training
Sorting written records into three labelled piles is a simplified teaching picture of splitting. Real training software assigns each row to one pile and records the choice, and a commercial pipeline keeps that record so every score can be reproduced. In this lesson no model is trained; the split is made on paper only.
Common misconception
Validation and test data serve the same purpose, so one pile is enough. Validation is used repeatedly while building, so it can be overused and become a quiet training signal. The test pile must stay untouched for a single final estimate. Using one pile for both jobs lets your choices fit that pile and inflates your final score.
Guided practice
Take a written list of hypothetical weekly sales for one year, marked as rows. On paper, divide the weeks into a training pile and a test pile using time order, and explain where a validation pile would go. Then repeat the division as if you were allowed to shuffle the weeks at random and write down what problem that would create. No model is trained in this exercise.
Knowledge check
Independent practice
Write a short example from your own work or daily life and decide whether it is AI, ordinary software or a mixture. Then explain why. Save it in your notes; no account is required.
Last reviewed: · Report a problem