
Confusion Matrix is a table that summarises a classification model’s performance by showing how its predictions compare to the actual correct answers — revealing exactly what kinds of mistakes it makes.
What it means in plain English
A single accuracy number hides how a model is right or wrong. A confusion matrix breaks it down into a grid: correct positive predictions, correct negatives, false positives (false alarms), and false negatives (missed cases). Seeing these four categories reveals the specific pattern of errors, which is far more useful than one overall score.
Precision, recall, and the F1 score are all calculated from it.
A simple example
For a spam filter, a confusion matrix shows how many spam emails were correctly caught, how many were missed, and how many genuine emails were wrongly flagged — instantly revealing whether its main weakness is missing spam or blocking real mail.
Why it matters
The confusion matrix is a fundamental tool for understanding a classification model’s real behaviour. By exposing the types of errors it makes, it guides how to improve the model and helps you judge whether it is fit for a given purpose.
Related terms
- Precision — derived from the confusion matrix.
- F1 Score — calculated from its values.
- Classification — the task it evaluates.
Frequently asked questions
What does a confusion matrix show?
It breaks down a classifier’s predictions into true positives, true negatives, false positives, and false negatives, showing exactly where the model gets things right and wrong.
Why is a confusion matrix useful?
It reveals more than overall accuracy — you can see which kinds of errors the model makes, and it is the basis for metrics like precision, recall, and F1 score.