The exam someone has already practiced
Imagine a student memorizing the answers to a small practice sheet. A perfect score on that sheet does not establish that they can solve new problems. The analogy is imperfect, but it captures why reusing familiar examples is a weak test of generalization.
In a fictional classification task, a model might exploit an incidental background color that happens to align with labels in the training images. On new images with different backgrounds, that shortcut fails.
The test set can stop being a test
If a developer repeatedly checks a test score and changes the system to improve it, information from that test is now guiding development. Calling the file “test” does not preserve its independence.
The scikit-learn documentation explains held-out evaluation and the danger of data leakage. Splitting data is only part of the solution; preprocessing and model selection also need to respect the split.
What a performance gap does and does not tell you
Poor performance on new data can reflect overfitting, a shift in the population, changed measurement, or other differences. The gap identifies a problem; further investigation identifies its cause.
More training data, simpler models, regularization, or different features can help in particular cases. None is a universal repair without understanding why the current model fails.
Read a score with its origin
Ask whether the score comes from training, development validation, or an independent test, and whether the test resembles the intended use. A slightly lower score on a credible independent evaluation can provide more useful information than a spectacular score on examples that shaped the model. The number's provenance is part of what the number means.
