Lesson 5.1 · 8 min read · about 50 min to master at a very slow pace

Why Regularisation is Needed

Regularisation trades a little training fit for a simpler, more robust model. The two competing objectives, the benefits of parsimony, and the kinds of datasets where regularisation matters most.

Not startedJump to quiz

Two goals in tension

Recall the U-shaped curve from 2.3: error on unseen data falls and then rises as complexity grows. Regularisation is a way to choose where to sit on that curve. It balances two conflicting objectives:

  1. Performance on the training data: minimise in-sample error (RSS, misclassification).
  2. Robustness to new data: minimise model complexity (number of variables, size of coefficients, tree depth, number of clusters). A simpler model is less likely to fit noise.

The regularised problem in one line

The tuning parameter sets the exchange rate between the two.

There are two main families of penalty: subset selection (penalise how many coefficients are non-zero) and shrinkage (penalise how large they are: ridge and LASSO).

Why simpler models are worth it

BenefitWhy
PerformanceMore likely to capture the true pattern than quirks of the training data
RobustnessLess likely to change dramatically when new data arrive
ComputationEasier to implement, maintain and re-estimate
InterpretabilityEasier to explain and act on
PracticalityFewer inputs to collect: lower storage, privacy and data costs (fewer sensors to buy)

When it matters most

  • Many predictors relative to observations ( or ). Genomics may have thousands of patients but a million gene features. Plain OLS fails outright when .
  • Highly correlated predictors (multicollinearity): OLS coefficients become unstable (3.9).
  • Noisy data: more noise to accidentally fit.

In these cases OLS has high variance or no unique solution, while a regularised model still finds something robust.

00.511.52penalty strength λ (simpler →)errorλ = 0: OLS (lowest training error)best λ
Training errorTest error
Increasing λ raises training error steadily, but test error first falls (less variance) and then rises (too much bias).

Stuck? Common doubts

Questions real learners asked while studying this lesson. They stay closed so they don't spoil your own thinking: open only the ones you need.

First passHow does regularisation change the objective?

It adds a second term. Ordinary least squares minimises ; ridge minimises and LASSO . The first term rewards fitting the data; the second charges for large coefficients. gives back OLS, and a large pushes the coefficients towards zero. The intercept is not penalised.

Cheatsheet

Regularised objective

, .

When to regularise

or · correlated predictors · noisy data.

See every cheatsheet by category →

Check your understanding

Score 75% or more to master this lesson and earn XP. Answer first, then check.

Q1conceptWhich two objectives does regularisation balance?
Q2applyWhich of these datasets most needs regularisation?
Q3conceptWhich of these is NOT a benefit of a more parsimonious model?
Q4conceptWhat does a regularised regression reduce to when ?
Q5conceptWhy does plain OLS break down when there are more predictors than observations?