Skip to content
BENIBIX Learn

Confusion Matrix

AI📏 Evaluation & BenchmarksClassification Metrics

Also known as Error Matrix

A table of a model's right and wrong answers. It shows what kind of mistakes it makes.

Think of it like

It is like sorting socks into four piles. Right yes, right no, wrong yes and wrong no.

Example

Jack's fraud model has 45 true positives, 30 false positives, 5 false negatives and 9,920 true negatives. The table shows at once that it misses few frauds but bothers some honest people.

Why it matters

One score hides what went wrong. The table shows which kind of mistake the model makes.

Definition

A confusion matrix is a small table that shows where a model's answers were right and wrong. For a yes or no task it has four boxes. True positives are right yeses, and true negatives are right nos. False positives are wrong yeses, and false negatives are missed yeses. Accuracy, precision and recall are all worked out from these four numbers.
Real answer down the side, model's answer across the top. Each box counts one kind of result.

Common mistake

Mixing up false positives and false negatives. A false positive is a wrong yes, and a false negative is a missed yes.

Key takeaways

  1. 1
    Four boxes. For yes or no.
  2. 2
    Right and wrong. Of each kind.
  3. 3
    Source of scores. Accuracy, precision, recall.