2.6.6 · D1Model Evaluation & Selection

Foundations — Confusion matrix interpretation

1,598 words7 min readBack to topic

Before we can read that table, we must build — from nothing — every word and symbol it silently assumes. We will not use a single term before it has a plain meaning and a picture.


1. What is a "class"? (the yes/no pile)

The words "positive" and "negative" have nothing to do with good or bad. They are just labels for the two piles:

  • Positive = the thing we are hunting for (spam, fraud, disease, cat).
  • Negative = everything else (not-spam, not-fraud, healthy, not-cat).

WHY the topic needs this: the confusion matrix is built entirely on the words positive and negative. If you don't know which pile is "positive", every metric flips meaning.


2. Two truths, two guesses (ground truth vs prediction)

There are two separate opinions about every item, and keeping them apart is the single most important idea on this page.

WHY the topic needs this: the matrix places reality on the rows and the model's guess on the columns. Every cell is a specific pairing of "what it was" with "what we said".


3. The four outcomes: TP, FP, FN, TN

Two truths (positive/negative) times two guesses (positive/negative) gives possible outcomes. Each has a two-part name: the first word says whether the guess was right (True) or wrong (False); the second word repeats what the model guessed.

Read the name in two beats:

  1. True/False = did the model get it right? (True = right, False = wrong)
  2. Positive/Negative = what did the model say?

So "False Negative" = the model said Negative, and that was False (wrong) → it was really positive, and we missed it.

WHY the topic needs this: these four counts ARE the confusion matrix. Everything else is arithmetic on TP, FP, FN, TN.


4. Counting = a whole number ()

Each of TP, FP, FN, TN is a count: how many items fell into that outcome. A count is a whole number that is zero or bigger — you can have false alarms, but never .

WHY: because every item lands in exactly one bucket, sums like (all real positives) or (all predicted positives) are meaningful slices we will divide by later.


5. The table itself: rows, columns, cells

Read it like a map: to find a cell, first pick your row (what it truly was), then slide across to the column (what we guessed).

WHY the topic needs this: "diagonal = correct, off-diagonal = error" is the reading rule for every confusion matrix, binary or multi-class.


6. What is a "ratio"? (the / bar and the % sign)

Every metric you will meet is a ratio: one count divided by another count. The horizontal bar in means " out of ", asking "what fraction?"

Example: means "80 out of every 100".

WHY the topic needs this: accuracy, precision, recall, specificity, and F1 are all just clever choices of which count on top, which count on the bottom. Learn the four buckets and every formula becomes obvious.

Recall

Why is the answer to a metric ratio always between 0 and 1? Because the numerator (correct-ish count) is always a subset of the denominator (a larger group it belongs to), so top bottom.


7. Which count on the bottom? (the whole point of each metric)

The denominator (bottom) is the group you are asking a question about. Different denominators = different questions.

Metric Bottom (the group asked about) Question
Accuracy everything "of all items, how many right?"
Precision predicted positives () "when I say yes, how often right?"
Recall actual positives () "of real yeses, how many found?"
Specificity actual negatives () "of real nos, how many rejected?"

WHY: the parent note derives every formula by choosing a denominator. Once you see "denominator = the group I'm judging", the formulas stop being memorised and start being obvious.


Prerequisite map

Class: positive vs negative

Four outcomes TP FP FN TN

Two opinions: truth vs prediction

Confusion matrix table

Counts: whole numbers >= 0

Ratios and percentages

Metrics: accuracy precision recall

Confusion matrix interpretation

Each foundation feeds the next: piles + two opinions give the four outcomes, the outcomes fill the table, counts + ratios turn the table into metrics, and the metrics are what the parent topic interprets.


Equipment checklist

Cover the right side and test yourself. You are ready when every line is instant.

The word "positive" in classification means
the target category we are hunting for — NOT "good".
In "False Negative", the word "Negative" refers to
what the model guessed (it guessed negative, and was wrong → really positive, so we missed it).
The rows of a confusion matrix represent
reality / ground truth (what the item actually is).
The columns of a confusion matrix represent
the model's predictions (what it guessed).
The diagonal cells of the matrix are
the correct predictions (TP and TN).
TP + FP + FN + TN equals
the total number of items in the test set.
A metric like with always lands in the range
to (or to ).
Precision divides TP by
all predicted positives, (a column).
Recall divides TP by
all actual positives, (a row).
A False Positive in plain words is
a false alarm — said positive when reality was negative.
A False Negative in plain words is
a missed case — said negative when reality was positive.