Stage 1 · Beginner · M2
Drawing the Line
Spam filters, credit scores and cancer screens are all one question: which side of the line?
14 lessons · 131 minSteady
About this chapter
A straight line cannot answer yes or no, and watching it fail is the fastest way to understand the fix. Bolt a soft curve on the end and you have the model that still ends most neural network classifiers, including the ones with billions of weights. The second half is the part most teachers rush: four boxes instead of one accuracy number, the two ratios everybody quotes, and a threshold chosen from what a mistake actually costs. You leave able to say what your model gets wrong, and to defend the line you drew.
What you will be able to do
- 18 min
From a Line to a Label
Say why a straight line fitted to yes and no labels gives answers nobody can use.
- 28 min
The Soft Switch
Read the sigmoid's output as a chance, and turn a chance back into the score behind it.
- 310 min
Logistic Regression
Read a fitted logistic model: its weight, its bias, and where it changes its mind.
- 49 min
The Loss That Punishes Confidence
Charge a classifier for one answer, and say why squared error is too gentle here.
- 510 min
Where the Numbers Came From
Walk a classifier downhill from nothing to a fitted weight and bias.
- 612 min
Boundaries You Can See
Predict which data shapes a straight boundary can handle, and bend it when it cannot.
- 79 min
The Model That Never Trains
Classify by asking the nearest examples, and say what that costs you.
- 89 min
The Four Boxes
Split a classifier's mistakes into the two kinds and name each box in your own task.
- 910 min
Caught and Cried Wolf
Compute precision and recall, and say which one your own task depends on.
- 1010 min
Choosing a Cut From Money
Pick a threshold that costs least, instead of the one that ships by default.
- 1110 min
Every Threshold at Once
Read an ROC curve and say in one sentence what the area under it means.
- 129 min
When the Answer Is Almost Always No
Judge a classifier when one class is one in a thousand, and say what breaks.
- 139 min
More Than Two Answers
Give every class its own line, turn the scores into chances, and read the nine boxes that replace the four.
- 148 min
The Last Layer of Everything
Point at the unit you built at the end of any neural network classifier, however large.