What does Overfitting mean?
Overfitting describes a model becoming overly adapted to the specific quirks of its training data. Alongside the actual underlying pattern, the model also learns the randomness of the individual examples. This shows up as a gap between two measurements: accuracy stays high on the training data but drops noticeably on held-back test data. In production, this appears as unreliable predictions.
Overfitting is encouraged by too many parameters relative to the amount of data, and by training that runs too long. As a countermeasure, regularization penalizes large weights. Dropout randomly switches off individual units during training, and early stopping halts training as soon as accuracy on a validation set stops improving. Cross-validation checks the result across several different splits of the data. More and more varied training data tends to be more reliable than any of these techniques on its own.
The risk exists wherever few examples meet many features. This affects forecasts based on only a few years of history, medical studies with small sample sizes, and image recognition trained on a few hundred pictures. With very large and diverse datasets, the problem tends to fade into the background.
The advantage of a strictly separate test set over evaluating on the training data lies in what it actually tells you. Only the score on unseen cases indicates how a model will perform in production. Anyone who tracks the gap between the two scores over time can spot the point where further training starts to hurt.
The opposite problem is called underfitting: a model that is too simple fails to capture even the actual pattern in the data. Between the two failure modes lies the range where a model works well, and that point can only be determined using held-back data.