← Back to Course

Regularization: Underfitting vs Overfitting

See how polynomial degree and regularization affect model fitting and the bias-variance tradeoff

How to Use

Generate random data from a sine curve with noise. The three panels show underfitting (degree 1), a good fit (degree 4), and overfitting (degree 15). Use the sliders below to pick your own polynomial degree and regularization strength. Watch how the error curves change.

Underfitting (Degree 1)

High bias, low variance

Good Fit (Degree 4)

Balanced bias-variance

Overfitting (Degree 15)

Low bias, high variance

Your Fit (Degree 4, λ=0.00)

Error vs Degree