Why do you keep a test set apart from the training data?
- Exam domain
- Machine learning foundations
- Difficulty
- Medium
- In this mock
- 5 questions on this domainPractise this domain
Why D is the answer
To measure how the model performs on data it has not seen
The test set estimates how the model will do on new data. If the model trains on it, the score is inflated and no longer tells you anything.
Remember: Test set: honest score on unseen data.
In detail
- Test data stays unseen until the final check.
- Validation data is for tuning; test data is for the final score.
Every option, checked
Knowing why each wrong option fails is how you rule it out on exam day.
A. To store labels that the model is not allowed to readWrong
The test set has labels so you can score predictions against them.
B. To make training faster by using less of the dataWrong
Speed is not the reason; the split is about honest measurement.
C. To add extra examples to training once the first epoch is doneWrong
Adding test data to training defeats the purpose of the split.
D. To measure how the model performs on data it has not seenRight
Test set: honest score on unseen data.
Use case
An illustrative scenario, not a real incident.
Illustrative: a team reports its model's accuracy on a held-out month of data, not on the months it trained on.
See it in different ways
flowchart LR S0["Collect labelled data"] --> S1["Split train and test"] --> S2["Train"] --> S3["Evaluate on test data"] --> S4["Deploy"]
How to read this chart
- Read it in order: Collect labelled data, then Split train and test, then Train, then Evaluate on test data, then Deploy.
flowchart TD
Q{"What is the data for?"}
Q -->|"Fit the weights"| A0["Training set"]
Q -->|"Tune settings"| A1["Validation set"]
Q -->|"Final score"| A2["Test set"]How to read this chart
- At "What is the data for?": if "Fit the weights", go to "Training set"; if "Tune settings", go to "Validation set"; if "Final score", go to "Test set".