ML0004 Underfitting

What is underfitting, how do you recognize it, and how can you fix it?

Answer

Underfitting occurs when a model is too simple to capture the underlying patterns in the data, so it performs poorly on both the training data and new, unseen data: it has not even learned the training set. An underfit model exhibits high bias and low variance: its predictions are consistently wrong in the same way, regardless of the particular training sample. Common causes are an overly simple model, inadequate training (stopped too early), over-regularization, and poor feature selection. The fixes mirror the causes: increase model complexity, train longer, reduce regularization, and engineer more informative features.

(1) Definition: The model lacks the capacity to fit the signal, so error stays high on training and test data alike.
(2) Recognition: High training error is the key signature; contrast with overfitting, where training error is low and only validation error suffers.
(3) Fixes: Add capacity (more layers, higher-degree features), train longer, weaken regularization, and improve the feature set.

Three fits to the same data: underfit line, good low-degree fit, and overfit high-degree curve

Figure 1: The same data fitted three ways. The underfit line misses the pattern entirely; the good fit follows the trend; the overfit curve chases every noisy point.

Mathematical Formulation:
\mathrm{Err}(x_0) = \mathrm{Bias}^2\big(\hat{f}(x_0)\big) + \mathrm{Var}\big(\hat{f}(x_0)\big) + \sigma^2
\text{underfitting} \;\Rightarrow\; \mathrm{Bias}^2 \text{ dominates the total error}

Where:

  • \mathrm{Err}(x_0) is the expected prediction error of the model \hat{f} at a new point x_0.
  • \mathrm{Bias}^2 measures how far the average prediction sits from the truth: the term that dominates when a model underfits.
  • \mathrm{Var} measures how much the prediction swings across different training sets: the term that dominates in overfitting.
  • \sigma^2 is the irreducible noise in the data, which no model can remove.

Login to view more content


Log in to track your progress

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *