Skip to main content

How do you handle overfitting and underfitting?

Mid Python
Quick Answer Overfitting: model learns training data too well, poor on new data. Underfitting: model too simple, poor on both. Fixes for overfitting: more training data, regularization (L1/L2), dropout (neural nets), simpler model, cross-validation. Fixes for underfitting: more features, more complex model, less regularization. Learning curves (train vs validation error vs dataset size) diagnose the problem.

Answer

Overfitting: Reduce complexity, regularization, cross-validation.
Underfitting: Increase model complexity or features.
S
SugharaIQ Editorial Team Verified Answer

This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.

Want to bookmark, take notes, or join discussions?

Sign in to access all features and personalize your learning experience.

Sign In Create Account

Source: SugharaIQ

Ready to level up? Start Practice