MMOOZZGG.com

Glossary

What is overfitting in machine learning

In short

Overfitting is a training error in which a model memorizes the training examples together with their random details and then performs badly on new data.

Machine learning · overfitting

MMOOZZGG.com editorsChecked: 1 min read

For a child

Imagine a boy who learned by heart all the answers in one book of math problems. In class he answers quickly and without mistakes. But the teacher gives him a new problem, a similar one with different numbers, and the boy is lost: he remembered the answers but did not understand how to solve them. The same thing happens to computers, and it is called overfitting.

In plain words

A model learns from examples so that it can later handle similar but new cases. Sometimes it learns too hard: it remembers not the general rule but every detail of the specific examples, even random noise. On familiar data such a model looks excellent, and on new data it makes mistakes. It is easy to notice: you hide part of the examples in advance and test the model on them. If the result there is much worse, the model has overfitted. It is like a student who aces a practice test because he has seen it before and then fails the real exam.

For business

An overfitted model is dangerous because it looks excellent in a presentation. A vendor shows accuracy on the data the model learned from, and after launch the sales forecast or the scoring of applications misses. The loss comes later, when goods have already been bought or good customers refused based on those forecasts. The protection is simple and cheap: ask for a check on held-out data the model has not seen, ideally from a later period, such as the last quarter. Compare accuracy on training and on the check: a large gap means a problem. The risk is higher when there is little data and the model is large, so with a small sample it is wiser to start with a simple model. Why AI makes mistakes and who is responsible is covered in the section on risks.

For a specialist

Overfitting is a state in which a model reaches a low error on the training set, but its error on new data (the generalization error) is clearly higher. The cause is too much model capacity for the amount and variety of data: the model fits the noise. In bias-variance terms (the bias-variance tradeoff), this is high variance; the opposite case is called underfitting. Diagnosis: learning curves and the gap between training and validation metrics. Remedies: L1 and L2 regularization (weight decay), dropout, early stopping on a validation metric, data augmentation, a larger sample, a simpler architecture, and cross-validation when choosing a model. Srivastava, Hinton and co-authors described dropout (JMLR, 2014): during training, neurons are switched off at random, so they stop adapting to each other. Zhang and co-authors (ICLR 2017) showed that convolutional networks easily fit even random labels, so a low training error alone does not prove that a model generalizes.

Do not confuse. Do not confuse it with retraining a model on fresh data: that is a planned update, not an error.

Example

A credit scoring model was trained on one year of applications. On them it predicted defaults almost without errors, but on the next quarter’s applications it was wrong many times more often: it had memorized the features of the old sample, not the signs of risk.

Related terms

Questions and answers

How do you know a model is overfitting? Compare quality on the training data and on held-out data the model has not seen. If the training result is high and the check result is clearly lower, that is overfitting.
How do you prevent overfitting? You need more data, a check on a held-out set and early stopping when quality on the check stops improving. Regularization, dropout and a simpler model help when data is scarce.

Sources

Not sure whether your company needs this?

AI solutions map
Contact us