Overfitting and Underfitting
⏱ Estimated reading time: 1 min
In machine learning, overfitting and underfitting are common problems that occur during model training. They affect the accuracy and generalization of the model.
1. Overfitting
-
Definition: The model learns the training data too well, including noise and irrelevant details.
-
Problem: Performs excellently on training data but poorly on new/unseen data.
-
Causes:
-
Too complex model (many parameters)
-
Insufficient training data
-
-
Solutions:
-
Use more training data
-
Apply regularization (L1, L2)
-
Prune decision trees
-
Use simpler models
-
Example: A student memorizes answers for a specific test but fails a different test on the same topic.
2. Underfitting
-
Definition: The model is too simple to capture the underlying patterns in the data.
-
Problem: Performs poorly on both training and test data.
-
Causes:
-
Model is too simple (few parameters)
-
Important features are missing
-
Training for too few epochs
-
-
Solutions:
-
Use a more complex model
-
Add relevant features
-
Train for more iterations
-
Example: A student who does not study enough performs poorly in all tests.
3. Visual Representation
| Model Type | Training Accuracy | Test Accuracy | Description |
|---|---|---|---|
| Underfitting | Low | Low | Too simple, fails to capture patterns |
| Good Fit | High | High | Properly captures patterns |
| Overfitting | Very High | Low | Learns noise, fails to generalize |
Register Now
Share this Post
← Back to Tutorials