AI Grounds

Open AI Grounds on a desktop

These interactive lessons need a larger screen. Please continue on a desktop or laptop computer.

Guided discovery

Confusion Matrix & Thresholds

Move the cutoff. Keep scores and actual classes fixed.

A clinic flags patients for a follow-up test. Missing a true case hurts more than reviewing extra patients. Positive decision: Flag for follow-up. Actual positive class: Needs follow-up; actual negative: Routine. Each preset loads its default cutoff.

Predict positive when model score is at least the cutoff. Scores use the same percentage scale. Use arrow keys on the slider. Press Enter or leave the number field to apply an exact edit.

Scores stay fixed

Circle = actual positive; square = actual negative. A–L identify examples in All 12 decisions. Shading marks predicted positive: score ≥ cutoff, including equality.

050100+−A: Ava, score 94%, actual positive, True positiveAB: Milo, score 89%, actual positive, True positiveBC: Rin, score 84%, actual negative, False positiveCD: Noor, score 77%, actual positive, True positiveDE: Iris, score 71%, actual positive, True positiveEF: Jules, score 66%, actual negative, False positiveFG: Theo, score 58%, actual positive, False negativeGH: Lena, score 51%, actual negative, True negativeHI: Kai, score 46%, actual negative, True negativeIJ: Mina, score 39%, actual positive, False negativeJK: Owen, score 33%, actual negative, True negativeKL: Zara, score 27%, actual negative, True negativeLModel score (%)

Confusion matrix

Predicted rows × actual columns, for all 12 examples.
DecisionActual positiveActual negative
Predicted positive
Score ≥ 62%
4True positive (TP)2False positive (FP)
Predicted negative
Score < 62%
2False negative (FN)4True negative (TN)

Precision

Among predicted positives, the fraction actually positive.

66.67%

TP / (TP + FP) = 4 / 6

A stricter cutoff does not guarantee higher precision.

Recall

Among actual positives, the fraction predicted positive.

66.67%

TP / (TP + FN) = 4 / 6

On fixed data, raising the cutoff cannot increase recall.

Positive queue

Examples predicted positive at this cutoff.

6 / 12

TP + FP = 4 + 2

Scores and actual classes remain unchanged.

All 12 decisions
Score percentages are rankings, not necessarily calibrated probabilities.
ID / exampleScore (%)ActualPredictedBucket
A · Ava94positivepositiveTrue positive (TP)
B · Milo89positivepositiveTrue positive (TP)
C · Rin84negativepositiveFalse positive (FP)
D · Noor77positivepositiveTrue positive (TP)
E · Iris71positivepositiveTrue positive (TP)
F · Jules66negativepositiveFalse positive (FP)
G · Theo58positivenegativeFalse negative (FN)
H · Lena51negativenegativeTrue negative (TN)
I · Kai46negativenegativeTrue negative (TN)
J · Mina39positivenegativeFalse negative (FN)
K · Owen33negativenegativeTrue negative (TN)
L · Zara27negativenegativeTrue negative (TN)
More metrics

F1: 66.67%. 2TP / (2TP + FP + FN) = 8 / 12. Zero denominator is undefined; otherwise a zero numerator gives zero, including no predicted positives when actual positives exist.

Accuracy: 66.67%. (TP + TN) / total = 8 / 12. It counts correct positives and negatives, without weighting their different mistake costs.

Metric percentages are rounded to two decimal places. This is a fixed illustrative batch. A score need not be a calibrated probability. Different mistake costs can justify different cutoffs; these examples do not identify an optimal real-world policy.

Medical Screen, cutoff 62%. TP 4, FP 2, FN 2, TN 4; precision 66.67%, recall 66.67%; predicted positive 6. Scores and actual classes fixed.