Map 1 · Supervised learning · Step 5
Control complexity
How simple can the model be and still capture the pattern?
Key formula
Fact or figure
gives ordinary least squares; as every coefficient goes to 0. In an SVM, C works the other way round: a small C means strong regularisation.
Skip this step and…
With hundreds of candidate features and only a few thousand customers, an unpenalised model fits the training set beautifully and next month badly.
Telco example
LASSO keeps 12 of Telco's 40 features and sets the rest exactly to zero. λ is chosen by 5-fold cross-validation on standardised training data.
Learn it
Taught in Section 5 (Regularisation and Model Selection) and Section 6 (Clustering and Support Vector Machines) of the course. The map follows the machine learning workflow, the order you build a model in; the course teaches in the order that is easiest to learn, so the numbers can jump.
- 5.1 Why Regularisation is NeededRegularisation 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.
- 5.2 Model Complexity and Feature SelectionComplexity has many dials: number of features, coefficient size, depth, K. Why adding features always helps in-sample, why it eventually hurts out-of-sample, and how feature selection fits in.
- 5.3 Best Subset and Stepwise SelectionBest subset selection tries every combination of predictors; forward and backward stepwise approximate it greedily. The algorithms step by step, how many models each fits, and a worked forward-stepwise example.
- 5.4 Ridge Regression (L2)Ridge adds a penalty on the sum of squared coefficients. Its closed-form solution, why it shrinks, why it always has a solution, how it handles correlated predictors, and two worked examples.
- 5.5 LASSO Regression (L1)LASSO penalises the sum of absolute coefficients, which shrinks some exactly to zero: built-in variable selection. Soft thresholding, a worked comparison with ridge, and when to prefer each.
- 5.6 Understanding λ (Lambda)What happens at λ = 0, small, intermediate, large and infinite λ. Why regularisation never beats OLS on training error, and how bias, variance and coefficients move along the way.
- 5.7 Ridge versus LASSOWhy LASSO produces exact zeros and ridge does not, explained with the constraint geometry of a disc versus a diamond. A full side-by-side comparison with subset selection, plus an interactive shrinkage explorer.
- 5.8 Mathematical Objectives and Worked CalculationsNorms, penalised objectives and how to compute ridge, LASSO and subset "errors" by hand, including choosing between two candidate fits, and penalised logistic regression.
- 5.9 Selecting λ Using Cross-validationλ is a hyperparameter: choose it by cross-validation on standardised training data, then test once. The full procedure, the one-standard-error rule, a case study, and the mistakes to avoid.
- 6.7 The C Parameter and KernelsC trades margin width against training violations, exactly like an inverse regularisation strength. Kernels let an SVM draw curved boundaries by working in a richer feature space. Linear, polynomial and RBF kernels, and tuning C and γ.