2.6.8 · D1Model Evaluation & Selection

Foundations — Precision-recall tradeoff and curves

1,709 words8 min readBack to topic

Before you can read the parent note Precision-Recall Tradeoff and Curves, you need to earn every symbol it throws at you. This page builds each one from nothing: plain words → a picture → why the topic cannot live without it. Read top to bottom; each brick rests on the last.


1. The raw ingredients: a prediction and a truth

Every idea here starts from a single act: the model looks at one item and guesses a label, while reality holds the true label. We need names for both.

Why the topic needs this: precision and recall are comparisons between and . With only one of them there is nothing to measure.


2. The score — why a number, not a yes/no

Real classifiers rarely commit straight to . They first emit a number measuring how positive the item looks.

Look at the figure: every item is a dot placed on a horizontal number line from to by its score. Fraud dots (pink) tend to sit right, normal dots (blue) tend to sit left — but they overlap in the middle. That overlap is the reason no single cutoff can be perfect, and it is the seed of the entire tradeoff.


3. The threshold — turning a score into a decision

Now we turn the dial into a verdict. We pick a line on the number line; everything to its right is called positive.

See 3.2.04-Decision-thresholds-and-calibration for how is chosen in practice.


4. The four buckets: TP, FP, FN, TN

Once the bar is placed, every dot falls into exactly one of four boxes, depending on what it truly is () versus what we said (). These four counts are the atoms of every metric on the page.

The figure is the confusion matrix — a 2×2 grid, rows = truth, columns = prediction. Each dot from figure s02 lands in one cell. This grid is built fully in 2.6.01-Confusion-matrix-and-basic-metrics; here we only need its four numbers.

Why the topic needs these: precision and recall are just ratios of these four buckets. Nothing else. Learn the buckets and the formulas become obvious.


5. Precision and Recall — two ratios of the buckets

Now we can define the two stars of the topic. Both are fractions between and ; both use TP on top; they differ only in what they divide by.

We use the symbols for recall and for precision when drawing the curve — just shorthand for the two fractions above. The parent plots points : recall across the bottom, precision up the side.


6. The curve and its summary number

Sweeping from high to low gives many pairs; joining them is the precision-recall curve. To compress a whole curve into one number we measure the area under it.

Related tools you'll meet next: 2.6.07-ROC-curves-and-AUC (a different curve using TN), 2.6.09-F1-score-and-Fbeta-score (blending and into one score), and 4.1.08-Cost-sensitive-learning (choosing by real-world costs).


How the foundations feed the topic

true label y

four buckets TP FP FN TN

predicted label y-hat

score s of x

threshold tau

precision

recall

PR curve points r p

AUC-PR area under curve

compare to positive-rate baseline


Equipment checklist

Cover the right side; can you answer before revealing?

What does mean and how does the hat differ from ?
is the model's predicted label; is the true label. The hat always signals "an estimate of the thing under it".
What does the score represent, and why keep it instead of a yes/no?
A number in measuring how positive an item looks; keeping it lets us re-decide by moving the threshold later.
State the rule that turns and into a prediction.
Predict positive () when , else negative.
Decode FN from its two words.
"False Negative" = we wrongly said negative = a truly-positive item we missed.
Write precision and recall and name their denominators.
(all items we called positive); (all truly positive items).
As decreases, which way do precision and recall move?
Recall rises (fixed denominator, more TP); precision usually falls (denominator grows with false positives).
What does AUC-PR summarise, and what is its no-skill baseline?
The area under the PR curve across all thresholds; the baseline equals the fraction of positive examples, not .