Success on familiar examples can mislead
Overfitting occurs when a model fits the examples used to develop it in ways that do not transfer well to new examples. A system can remember accidental details while appearing to learn a useful relationship. Google’s overfitting lesson describes the warning pattern: training performance improves while validation performance stops improving or deteriorates.
The problem is not limited to very large models. A spreadsheet analyst who tries many formulas until one explains last month’s sales can also select a pattern that will disappear next month. Flexibility includes the choices made by the person experimenting, not just the number of adjustable parameters inside a model.
An example with photographs
Imagine a team building a classifier for cracked and intact tiles. It photographs cracked tiles on a dark workbench and intact tiles on a light table. A classifier might learn the background rather than the crack. It can score well on a random sample of similarly collected images but fail when an intact tile is placed on the dark bench.
The right response is not simply to run the same split again. Create an evaluation set that varies backgrounds, lighting, and tile types in ways that reflect intended use. Examine individual failures. If the input process creates a shortcut, the apparent accuracy says little about the feature the application actually needs.
Consider a second issue: several photographs show the same tile from different angles. If one view enters training and another enters the test set, the test is less independent than it first appears. Splitting by tile, rather than by photograph, may better test performance on unseen physical objects. The correct split follows the real deployment question.
Give each dataset a job
A training set fits parameters. A validation set supports development choices. A final test set estimates performance after those choices have been made. The scikit-learn cross-validation guide explains how tuning decisions can leak information from a repeatedly consulted test set into model selection.
Cross-validation can use several training and validation partitions to reduce dependence on a single split. It does not make unsuitable data representative. For time-dependent predictions, training on future records and testing on earlier ones can answer the wrong question even if the folds are balanced. Preserve the direction of information that will exist in real use.
Recognize the limits of a remedy
Simplifying a model, collecting more representative data, adding regularization, or stopping training earlier can help in appropriate circumstances. These approaches address different causes. More examples of the same background shortcut may reinforce the shortcut. A simpler model can still use a leaked identifier. A good review asks what information is entering the prediction and why it should remain useful.
An illustrative tile project might compare a very flexible classifier with a simpler model using the same independent test. If both fail mainly on glossy surfaces, their common weakness suggests a coverage problem worth investigating. If one improves without harming other groups, that is a bounded empirical finding about those samples, not proof of universal reliability.
Plan for change after release
New material, cameras, or lighting can shift the inputs after evaluation. A test score from one collection period does not guarantee future behavior. Define how failures will be noticed, whether a human can review uncertain cases, and when a fresh evaluation is required.
The practical lesson is to protect the question the test is supposed to answer. An honest modest score on independent examples is more useful for decisions than an impressive score produced by accidental familiarity. Explore evaluating intelligence for task-specific evidence and machine learning for how training chooses a model’s parameters.