# Test Set

> Data kept locked away. You use it once, at the end, for a fair final score.

**Field:** Artificial Intelligence  
**Category:** Machine Learning  
**Also known as:** Test Split, Hold-out Test Set

## Think of it like

Think of it like the final exam. You only sit it once, at the very end.

## Definition

The test set is data kept locked away until the model is finished. It is used once, for the final score. Because the model never saw it, the score shows how well it will do on new data. If you peek at it while you build the model, it stops being a fair test. Many teams keep it hidden even from the people training the model.

## Example

Lucy's team finishes its spam model. Only then do they run it on 2,000 emails nobody has touched. It catches 96 percent of the spam.

## Why it matters

It is your best guess of how the model will do for real users. A score from anywhere else is too hopeful.

## Common mistake

Checking the test set after every change. Each peek makes it a little less fair. Soon it is no longer a real test.

## Three principles

- **Locked away.** Not seen during building.
- **Used once.** For the final score.
- **Honest guess.** How it will do on new data.

## Related terms

- [Validation Set](https://learn.benibix.com/term/ai/validation-set)
- [Training Set](https://learn.benibix.com/term/ai/training-set)
- [Data Leakage](https://learn.benibix.com/term/ai/data-leakage)
- [Generalization](https://learn.benibix.com/term/ai/generalization)
- [Model Evaluation](https://learn.benibix.com/term/ai/model-evaluation)

## Told apart from

- [Validation Set vs Test Set](https://learn.benibix.com/compare/validation-set-vs-test-set): People often think these are two names for the same held-out data. Both are kept out of training, but they have different jobs. The validation set is checked again and again while you tune. The test set is opened once, at the end. Tuning on the test set makes your final score a lie.

## Taught in

- [Training and Test Sets](https://learn.benibix.com/learn/ai-machine-learning/training-and-test-sets): Machine Learning, 2/18

![One long bar of data cut into three parts: a big training set, a smaller validation set and a smaller test set. A dashed arrow from the test set back into the training set is marked data leakage.](https://learn.benibix.com/diagrams/ml-data-splits.svg)

---

Source: https://learn.benibix.com/term/ai/test-set
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
