The Simplest Model That Learns
Predicting Yes or No
Last timeMore Than One Input
Predicting a probability needs a squashed output and a matching score, and swapping those two pieces leaves the slopes and the stepping method exactly as they were.
A number where a probability is wanted
Will this customer renew? Did this transaction go wrong? Is this email
unwanted? The truth is a yes or a no, and what is wanted from the model is not
a yes or a no but a probability, because a nine in ten chance and a six in ten
chance call for different handling.
The straight line output is useless for this directly. It produces any number
at all, including minus four and eleven hundred, and neither is a probability.
The fix is to leave the straight line entirely alone and pass its output
through a function that squashes every real number into the range from zero to
one.
- the straight line output, any number at all
- the predicted probability, always strictly between zero and one
- the knobs, exactly as in the previous lesson
The curve is steep in the middle and flat at both ends, so near the boundary a small change in the inputs moves the probability a great deal and far from it barely at all. That makes the straight line output readable as a confidence. Positive means
more likely than not, large positive means confident yes, large negative means
confident no, and zero is the boundary where the model is balanced.
Why the squared score will not do
The obvious move is to keep the squared score, measuring the gap between the
predicted probability and the outcome written as one or zero. It is a legal
score and it is a bad one.
The reason is what it charges for confident mistakes. If the model says the
probability is 0.999 and the answer is no, the squared score charges almost
exactly one. If the model says 0.6 and the answer is no, it charges 0.36. So
being catastrophically, confidently wrong is less than three times as bad as
being mildly wrong, and the worst possible charge is one, no matter how
absurd the prediction.
The lesson stops here
6 more paragraphs to go
You have read the opening. The rest of the argument, the problems that check whether it landed, and the lines worth keeping at the end all come with a plan.
The first lesson of every course in the library reads the whole way through, free, so you can see exactly what the rest of them are.
See the planThe contentsThis is the reading half
Starting the course gives you your own copy of it. Every idea on every page has problems standing under it, marked with a reason rather than a tick, and any sentence you do not believe can be opened and argued with. None of that can happen on a page nobody owns.
The contents