Why should you standardise the features before fitting ridge or lasso regression, but not necessarily before ordinary least squares?
Supervised learning, Regularisation
Level L1 Beginner. Length One-liner. Nature Th Theoretical.
What's being asked
Whether you see that the penalty depends on the scale of each coefficient while the least-squares fit does not.
Key idea
The penalty (or ) treats all coefficients alike, but a feature measured in small units needs a large coefficient, so it is penalised unfairly. OLS predictions are unchanged by rescaling a feature.
Steps
- State that rescaling a feature by rescales its coefficient by , so OLS fitted values stay the same.
- Note that the penalty is not scale-free: a feature in metres versus millimetres gets a coefficient 1000 times bigger and a much heavier penalty.
- Conclude: centre and scale each feature to mean 0 and variance 1 (and do not penalise the intercept), so the penalty is applied fairly.
Common mistakes
- Penalising the intercept. This makes the fit depend on where the targets are centred.
- Computing the mean and variance on the full data, including the validation or test set. Use only the training fold.
How long your answer should be
One or two sentences.
Last checked on 4 December 2026.
Read this
Previous in Supervised learning: What is the perceptron learning rule for labels , and how does one update move the prediction in the right direction?
Next in Supervised learning: How does Adaline (trained with the delta or LMS rule) differ from the perceptron, in the quantity used for the update and in the loss being minimised?