What is a train-validation-test split?
A train-validation-test split is the process of dividing a dataset into three separate parts so a machine learning model can be trained, tuned, and evaluated on different examples.
Each split has a different role.
Training set
The training set is used to fit the model.
The learning algorithm uses these examples to adjust the model's learned parameters.
Validation set
The validation set is used during model development.
It helps with tasks such as:
- comparing model choices
- tuning hyperparameters
- selecting features
- choosing preprocessing options
- detecting overfitting
The model is not normally trained directly on these examples.
Test set
The test set is used for the final evaluation after model development is complete.
It should remain untouched while the model is being trained and tuned so it can provide a cleaner estimate of performance on unseen data.
Simple example
Suppose a dataset contains 10,000 samples.
A possible split might be:
- 7,000 samples for training
- 1,500 samples for validation
- 1,500 samples for testing
This is only an example. The best proportions depend on factors such as dataset size, task complexity, and how much data is needed for reliable evaluation.
Why use three separate sets?
If the same examples influence both learning and final evaluation, the measured performance may be overly optimistic.
Keeping the three roles separate helps answer three different questions:
- Training: What patterns can the model learn?
- Validation: Which model or settings should we choose?
- Test: How well does the final model perform on unseen data?
In short, a train-validation-test split separates data for learning, model selection, and final evaluation so model performance can be measured more reliably.
Learning Sequence
Machine Learning Curriculum
Explore Related Questions
Deepen your understanding across related Machine Learning topics.