Basis Lab

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.

FIG 1The straight line, then the squash
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 first line is the whole of the previous lesson, unchanged. The second is a fixed function with no knobs in it, so the knobs are still what they were and the only new thing is how the output is read. At a straight line output of zero it gives a half, and it approaches one and zero from either side without ever reaching them, so the model can never be absolutely certain.

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 contents

This 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

The rest of this course

  1. 01A Guess With Knobs On It
  2. 02Measuring How Wrong It Isopening only
  3. 03Which Way to Turn the Knobsopening only
  4. 04The Answer Without Any Stepsopening only
  5. 05More Than One Inputopening only
  6. 06Predicting Yes or Noyou are here
  7. 07When It Learns the Noiseopening only
  8. 08The Same Four Parts, Much Biggeropening only

Read alongside