Underfitting (Intuition) Math Example 2

Follow the full solution, then compare it with the other examples linked below.

Example 2

medium
Compare two regression models on the same data: Model 1 (linear): training R2=0.40R^2=0.40, test R2=0.38R^2=0.38. Model 2 (cubic): training R2=0.95R^2=0.95, test R2=0.35R^2=0.35. Diagnose each model.

Solution

  1. 1
    Model 1: similar training and test R2R^2 (0.40 vs 0.38) โ€” model generalizes well but fits poorly; this is underfitting (high bias, low variance)
  2. 2
    Model 2: very high training R2R^2 (0.95) but poor test R2R^2 (0.35) โ€” doesn't generalize; this is overfitting (low bias, high variance)
  3. 3
    Recommendation: neither model is optimal; try intermediate complexity (quadratic) which may balance fit and generalization
  4. 4
    Both training AND test errors should be low for the ideal model

Answer

Model 1: underfitting (low Rยฒ everywhere). Model 2: overfitting (high train, low test Rยฒ). Need intermediate complexity.
Diagnosing over vs. underfitting requires comparing training and test performance. Small training-test gap with low performance = underfitting. Large training-test gap = overfitting. The goal is high performance with a small gap.

About Underfitting (Intuition)

Underfitting occurs when a model is too simple to capture the true pattern in the data, performing poorly on both training data and new data.

Learn more about Underfitting (Intuition) โ†’

More Underfitting (Intuition) Examples