Skip to content

Training, Validation and Test Sets Explained

For people

Why data is split into three parts, what each part is for, and the mistakes that make evaluation results meaningless.

Editorial team 2 min read

Share X LinkedIn Reddit Bluesky Email

Judging a model on the data it trained on is like grading a student on an exam they have already seen. To get an honest answer, data is split.

The Three Splits

  • Training set — used to fit the model's parameters. Usually the largest share, often 60–80%.
  • Validation set — used to compare models and tune settings such as tree depth or learning rate.
  • Test set — used once, at the end, to estimate how the final model will perform on new data.

Why Keep the Test Set Separate?

Every time you look at test results and change something, you tune the model a little towards that particular test set. Do it often enough and the test score stops being an honest estimate. Make decisions on the validation set; report on the test set.

Cross-Validation

When data is limited, k-fold cross-validation splits the training data into k parts, trains k times holding a different part out each time, and averages the scores. It gives a more stable estimate than a single validation split.

Splitting Pitfalls

  • Time-ordered data: train on the past, test on the future. A random split leaks future information.
  • Grouped data: keep all records of the same person, patient or device on one side of the split.
  • Imbalanced classes: use a stratified split so rare classes appear in every part.
  • Duplicates: near-identical rows on both sides of the split inflate scores.

More in AI foundations

All AI foundations guides →
AI foundations Guide · 2 min

What Is Artificial Intelligence?

A plain-language definition of AI, the difference between narrow and general AI, and why today's systems are mostly about learning patterns from data.

AI foundations 2 min read 15 Oct 2026 For people

AI foundations Guide · 2 min

A Short History of AI

From the 1956 Dartmouth workshop to large language models: the booms, the 'AI winters' and the ideas that shaped the field.

AI foundations 2 min read 13 Oct 2026 For people

AI foundations Guide · 2 min

How Machines Learn From Examples

The core loop of machine learning — data, model, loss and optimisation — explained without equations.

AI foundations 2 min read 12 Oct 2026 For people

Discussion 0

Use @handle to bring somebody in, and #tag to file it.

Nothing here yet. Ask a question, or say how you used it.

Sign in to join the discussion. Sign in