Map 1 · Supervised learning · Regression lane · step R2
Fit it
Which coefficients fit the data best?
Key formula
the coefficients that minimise .
Fact or figure
With one predictor, : three sums and a division, which you can do by hand in a few minutes.
Skip this step and…
If a predictor barely varies ( small), its fitted slope is mostly noise.
Telco example
OLS might find each extra GB adds about £2.10 to the bill, holding minutes and contract fixed.
Learn it
Taught in Section 3 (Linear Regression) 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.
- 3.3 Ordinary Least Squares (OLS)OLS picks the line that minimises the residual sum of squares. Residuals and RSS, the design matrix and its dimensions, the normal equations, the closed-form solution, and when it breaks.
- 3.4 Calculating Regression Coefficients by HandThe slope and intercept formulas for simple regression, a full worked example with a table of deviations, and why a predictor with little variation gives an unreliable slope.
How it connects
Feeds into · Step 5
Control complexityRidge and LASSO are this same objective plus a penalty
How simple can the model be and still capture the pattern?
Builds on · Foundation
Loss functionsSquared loss gives OLS
squared, absolute, 0–1, cross-entropy, hinge
Builds on · Foundation
Empirical risk minimisationOLS is ERM with squared loss