Back to Glossary
Machine Learning Fundamentals

Overfitting

Overfitting occurs when a machine learning model learns the training data too well, capturing noise and specific details that do not generalize to new, unseen data. This results in high accuracy on the training set but poor performance on the test set.

Explanation

In essence, an overfit model memorizes the training data instead of learning the underlying patterns. This happens when the model is too complex relative to the amount of training data available, or when the training process continues for too long. The model might learn spurious correlations or be highly sensitive to outliers present only in the training data. Techniques to combat overfitting include: 1) increasing the size of the training dataset, 2) simplifying the model (e.g., reducing the number of layers or parameters in a neural network), 3) using regularization techniques (such as L1 or L2 regularization) that penalize complex models, 4) employing dropout, which randomly disables neurons during training, 5) early stopping, which halts training when performance on a validation set begins to degrade, and 6) data augmentation, which artificially expands the training set by creating modified versions of existing samples. Detecting overfitting typically involves monitoring the model's performance on both the training and a validation/test dataset. A significant gap between the two indicates overfitting.

Related Terms