Overfitting and Underfitting
On this page (13sections)
Introduction
Overfitting and underfitting describe two ways a model can fail to generalize. An overfit model memorizes the training data, including its noise, and performs poorly on new data. An underfit model is too simple to capture the underlying pattern and performs poorly everywhere. The goal is the balance between them, often called the bias-variance trade-off.
Definition
Overfitting occurs when a model learns the training data too well but fails to generalize, while underfitting occurs when a model is too simple to capture the underlying patterns.
Types
Overfitting
Model performs well on training data but poorly on test data
Underfitting
Model performs poorly on both training and test data
Regularization
Techniques to prevent overfitting
Model Complexity
Balancing model complexity with data availability
Use Cases
- Model diagnosis and improvement
- Feature selection decisions
- Hyperparameter tuning
- Model architecture design
- Training strategy optimization
Implementation
Techniques like regularization, cross-validation, and early stopping help prevent overfitting.
In Practice
You detect overfitting when training accuracy is high but validation accuracy is low. Remedies include gathering more data, simplifying the model, adding regularization, using dropout, and early stopping. Underfitting calls for a more expressive model or better features.
Key Points
- Bias-variance tradeoff is fundamental
- More data can help with overfitting
- Regularization techniques are essential
- Validation sets help detect overfitting
References
- Understanding Overfitting — Detailed explanation of overfitting and underfitting