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.

20 minInteractive lessonChapter 1: Classical MLLesson 3 of 25

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

Take the lesson

Short cards, one idea at a time, with quick checks as you go.