# Confusion Matrix

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

**Field:** Artificial Intelligence  
**Category:** Evaluation & Benchmarks  
**Also known as:** Error Matrix

## Think of it like

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

## 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.

## 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.

## Common mistake

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

## Three principles

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

## Related terms

- [Precision (Machine Learning)](https://learn.benibix.com/term/ai/precision)
- [Recall (Machine Learning)](https://learn.benibix.com/term/ai/recall)
- [Accuracy (Machine Learning)](https://learn.benibix.com/term/ai/accuracy)
- [Classification (Machine Learning)](https://learn.benibix.com/term/ai/classification)

![A two by two table. Rows are the real answer, columns are the model's answer. The four boxes are right yes, wrong yes, missed yes and right no.](https://learn.benibix.com/diagrams/ev-confusion-matrix.svg)

---

Source: https://learn.benibix.com/term/ai/confusion-matrix
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
