Gradient
Lesson 6.1ModelMath~45 min

Your first model

Fit a line to data by hand, then measure “how wrong” with mean squared error.

Module 6 · 0/11 done

A real prediction problem

Here are 22 houses: their size and the price they sold for. A new house comes on the market — 150 m². What should it cost? There’s clearly a pattern (bigger costs more), but it’s noisy: location, condition and luck all play a part.

Our model is the simplest one there is, a straight line: y^=w x+b\amber{\hat{y}} = \green{w}\,\blue{x} + \green{b}. This is called linear regression (“regression” just means predicting a number). Training it means finding the line that best fits the data. But what does “best” mean?