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.
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:
- Performance on the training data: minimise in-sample error (RSS, misclassification).
- 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
| Benefit | Why |
|---|---|
| Performance | More likely to capture the true pattern than quirks of the training data |
| Robustness | Less likely to change dramatically when new data arrive |
| Computation | Easier to implement, maintain and re-estimate |
| Interpretability | Easier to explain and act on |
| Practicality | Fewer 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.
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
Check your understanding
Score 75% or more to master this lesson and earn XP. Answer first, then check.