Validation set

A validation set is a portion of data held back from training and used repeatedly during development to tune a model and catch overfitting, before a final check on the test set.

When building a model, data is usually split three ways. The training set teaches the model. The validation set checks it during development. The test set gives a final verdict. Google's machine learning glossary describes the validation set as the subset used for initial evaluation of a trained model, typically checked several times before the model meets the test set.

The validation set does the day-to-day work of model building. Developers use it to compare settings such as the learning rate, to choose between model designs and to decide when to stop training. A common sign of overfitting is training loss that keeps falling while validation loss starts to rise; early stopping halts training at that point. Google's glossary defines validation loss as the model's loss on the validation set at a given point in training.

Using the validation set for tuning is what makes a separate test set necessary. Google's Machine Learning Crash Course explains that repeatedly adjusting a model against the same data lets it fit that data's quirks, so the validation set's scores become optimistic. Its example split is 70% training, 15% validation and 15% test, and it recommends removing any validation or test examples that duplicate training examples.

Validation sets also wear out. The more decisions they guide, the less they say about performance on genuinely new data, and the crash course suggests gathering fresh data to refresh them. Where data is scarce, cross-validation tests the model against several non-overlapping subsets withheld from training, rather than a single fixed validation set.

Common questions

What is the difference between a validation set and a test set?

Both are held out from training. The validation set is used many times during development to tune and compare models. The test set is reserved for a final, one-off estimate of performance on unseen data. Using the test set for tuning would make it a second validation set.

Why do you need a validation set?

Without one, the only way to choose settings or spot overfitting would be to check against the test set, which would leak information into design decisions and make the final score unreliable. The validation set absorbs that repeated use.

How big should a validation set be?

There is no fixed rule. Google's Machine Learning Crash Course uses a 70/15/15 split of training, validation and test data as an example. The set needs to be large and representative enough that differences between candidate models are not just noise.

Finding more

Search for "training validation test split", "validation loss" or "cross-validation". Course material such as Google's Machine Learning Crash Course, library documentation and machine learning textbooks explain the practice reliably. When reading results, check that the reported score comes from a test set rather than the validation set used for tuning.

Working out what this means for your business?

Aileron Shift builds the systems behind this site: AI newsrooms that research, write and publish on their own, marketing automation and WordPress hosting for companies that need to move faster than their competitors.