Log inStart free
LESSON 4.57 · 6 STAGES · 3 CONTROLS · 3 CHECKSPRO · PREVIEW

Probability calibration

See if a classifier's 0.9 comes true nine times in ten, and fix it.


Pro lesson. Stage 1 is free to watch. Pro opens all 6 stages, 3 controls and 3 checks, in this lesson and every other.

Go Pro · $8.25/mo
EXPLAINER · 4.57 · CALIBRATION BAY200 TEST POINTS · ACCURACY 0.68
01
Stage 1 of 6 · Probabilities
Each test point gets a probability of class 1. Dots are class 1; squares are class 0.
Explain it simply

Each point gets a number from 0 to 1: the model's chance that it is a dot. Dots sit above the line and squares below, at their number. Naive Bayes reads three features that tell the same story, and it counts that story three times. The model is right on 136 of 200 points.

200 test points along a probability axis from 0 to 1. 97 dots above the line, 103 squares below. Accuracy 0.68.

test pointsbin meansgaps, lossescalibration mapcalibrated line
accuracyraw0.68test-set scoresy = 1y = 0test points · exact probabilityreliability diagramp = σ(f) · 200 test points · accuracy 0.68accuracyraw0.68test-set scoresy = 1y = 0test points · exact probabilityreliability diagramp = σ(f) · 200 test points · accuracy 0.68
Toy: 200 test points, 3 near-copy features, seed 109
STAGE 1 / 6
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
p=σ(f)=11+e−f\sy{p}{out}{p} = \sigma(\sy{f}{out}{f}) = \frac{1}{1 + e^{-\sy{f}{out}{f}}}
accuracy=0.68\text{accuracy} = 0.68

The sigmoid turns the model's log-odds into a probability of class 1.

Common mix-ups

MYTHA model with good accuracy gives honest probabilities.

The fix, and 1 more mix-up with the diagram to show them, come with Pro.

Predict, then reveal
3 CHECKS · PRO
Q01Is the strong-L2 model's cobalt line flatter or steeper than the diagonal?

Make your guess, then test it in the diagram. All 3 checks come with Pro.

PRO LESSON · YOU WATCHED STAGE 1 OF 6
Unlock the full explainer
  • 5 more stages and 3 live controls
  • 2 mix-up cards and 3 predict-then-reveal checks
  • Watch it as a narrated video, in three voices
  • Every Pro lesson and capstone · 656 in total

$99 a year, or $15 a month. Cancel any time.