Skip to main content

Overfitting and Underfitting

1 min read Updated May 29, 2026
Share:
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

Frequently Asked Questions

What is overfitting?
It is when a model memorizes training data, including noise, and fails to generalize to new data.
What is underfitting?
It is when a model is too simple to capture the underlying pattern, performing poorly on all data.
How do you prevent overfitting?
Use more data, regularization, dropout, early stopping, or a simpler model, and validate on held-out data.

Related Tutorials

Search tutorials