Back to the 2022 paper

Module 1: Introduction

20227m

Explain the model of over-fitting and under-fitting. Give the example of over-fitting and under-fitting in two-dimensional data.

Worked SolutionAI Assisted

Overfitting and Underfitting:

Overfitting: Model learns training data too well, including noise/outliers; high variance, low bias. Memorization. Errortrain≪ErrortestError_{train} \ll Error_{test}. Example: Degree-10 polynomial fitting 10 points with wiggling curve passing through all points.

Underfitting: Model too simple to capture underlying pattern; high bias, low variance. Errortrain≈ErrortestError_{train} \approx Error_{test} but both high. Example: Linear line fitting parabolic data.

Model complexity view: Train vs Validation error vs capacity (U-shaped test error). Optimal is intermediate capacity (sweet spot) where bias-variance balanced.

2D Example:

Data: Parabolic trend y=x2+noisey = x^2 + noise, points near U-shape.

  • Underfit (linear, degree 1): Straight line cutting through U, misses curvature → large error on both train and test.

    y
    *   *
     \ /     data *
      .      linear ___  (misses curve)
     / \
    *   *
    
  • Good fit (degree 2): Parabola y=w0+w1x+w2x2y= w_0+w_1x+w_2x^2 captures trend smoothly, generalizes.

  • Overfit (degree 9+): Wiggly curve passing exactly through every noisy point, oscillates wildly between points — zero train error but huge test error.

Remedies:

  • Underfit: increase complexity, add features, reduce regularization, longer training.
  • Overfit: more data, regularization (L1/L2), pruning, dropout, early stopping, cross-validation, feature selection, reduce degree.

Visual: Plot xx vs yy, noisy quadratic data; underfit = straight line under, overfit = wiggly interpolating, good = smooth quadratic.

Similar questions

Official AppAndroid App

PYQDeck for Android

Solve BEU previous-year exam papers anywhere, anytime. Fast search, offline paper viewing, and step-by-step solutions designed specifically for your phone.