Home › Glossary › Evaluation › Confusion Matrix

Beginner · Evaluation

Confusion Matrix

Visual diagram · (in preparation) · Math · (in preparation) · Worked example · 3 difficulty levels.

TL;DR. A table showing true vs predicted labels for every class.

Technical Definition

A table showing true vs predicted labels for every class.

How it works

Rows are actual classes, columns are predicted classes (or vice versa). The diagonal contains correct predictions; off-diagonal cells show the model's specific mistakes. Looking at confusion patterns is often more insightful than any single metric.

Related Concepts

  • Accuracy — The fraction of predictions a model gets correct on a labeled dataset.
  • Precision — Of the items the model predicted positive, the fraction that are actually positive.
  • Recall — Of all the actually positive items, the fraction the model successfully found.