What is Overfitting?
A state in which a model memorizes fine details and chance noise in the training data, so that its error on the training data is small but its error on new data (generalization error) is large. It tends to occur when a complex model with many parameters is trained on little data. It is reduced by adding data, simplifying the model, regularization, dropout, early stopping and similar methods.
Japanese name: 過学習
Overfitting appears in 3 practice questions across 1 topic, including Machine Learning Basics.
Field: Machine Learning Basics
How to recognize it
Overfitting is recognized by comparing performance with a validation set kept separate from the training data. A learning curve, which plots the training and validation losses against the number of training steps, shows the training loss continuing to fall while the validation loss starts to rise from some point. A widening gap of this kind is overfitting. Conversely, when both losses stay large and do not fall, the model is underfitting: it is too simple, or otherwise unable to capture the trend.
How to reduce it
The most reliable remedy is more training data. When data cannot be added, data augmentation, such as rotating or flipping images, increases the apparent amount of data. On the model side, methods include simplifying the model by reducing parameters, regularization that adds a penalty on weight size to the loss, dropout that randomly disables neurons during training, and early stopping that ends training when the validation loss starts to rise. Ensemble learning, which averages the predictions of several models, also reduces the variability of predictions.
FAQ
How do overfitting and underfitting differ?
Overfitting is fitting the training data so closely that the error on new data becomes large, while the error on the training data is small. Underfitting is a state in which the error is large even on the training data, because the model is too simple or has not been trained enough. In terms of bias and variance, underfitting corresponds to high bias and overfitting to high variance.
If accuracy on the training data is 100%, is the model overfitting?
That alone does not decide it. If the model also performs well enough on validation and test data, there is no problem. Suspect overfitting when there is a large gap between performance on the training data and on the validation data.