Machine Learning, Foundations · Chapter 01
What a machine actually learns
1:44 · Narrated with a synthetic voice. Captions are available in the player.
Read the transcript
Start with four flats and their monthly rents. You write down a shape with blanks in it: rent equals some number times the floor area, plus another number. Those blanks are called parameters. Then you write down one number that says how wrong the current choice is, averaged over your data. That number is the loss. Learning is nothing more than moving the parameters until the loss gets smaller. Two numbers moved and a third number went down. Every model in this course, from a two-parameter line to a network with a trillion weights, is the same three-part machine: a shape, a loss, and a procedure for changing the shape to lower the loss. Before you train anything, compute the number your model has to beat. Predict the most common class. Predict that tomorrow equals today. Implement the rule the operations team already uses and score it on the same data. A fraud model reporting ninety-four per cent accuracy sounds impressive until somebody points out that predicting no fraud for everything scores ninety-six. And report the gap rather than the score. Say that the baseline scores six thousand one hundred and the model scores four thousand three hundred, and you have a sentence a non-technical person can act on.