Chapter 1: Classical ML
The exact best line: two equations, and MAE
A slider only gets close. Two short equations give the exact best line, and interviewers ask for them. You also need an error number in price units, not squared units.
What you will learn
- Find the best line exactly by solving two equations in two unknowns
- Compute MAE for a set of predictions
Key terms
- Intercept
- the prediction at size 0, where the line starts
- Slope
- how much the prediction rises per size unit
- Residual
- real price minus predicted price
- MAE
- mean absolute error: the average size of the misses
Prerequisites
Take Fitting a line: what 'best fit' means and how to read the slope first. It comes right before this lesson in the course.
Where this lesson picks up: Last lesson you tilted a line through Ash, Birch and Cedar by hand and got close to the best slope. Can algebra find the best line exactly?
What comes next
How can a line's output become a probability for a yes/no label?
Next lesson: From a line to a probability: the sigmoid
More lessons in this part
- Welcome to Classical ML: a model from start to finish 7 min
- Framing: what to predict, for whom, when, and what to beat 24 min
- Fitting a line: what 'best fit' means and how to read the slope 20 min
- From a line to a probability: the sigmoid 7 min
- Training logistic regression: log loss, its gradient, and why not squared error 7 min
- Thresholds, precision and recall: the cut-off is a product decision 16 min
- Honest splits and leakage: random, group and time-based 18 min
Take the lesson
Short cards, one idea at a time, with quick checks as you go.