CLASSIFICATION · BEGINNER GUIDE
How to Read a Multiclass Confusion Matrix
Use actual and predicted category counts to find which classes a classifier confuses most often.
Quick answer: A confusion matrix counts actual classes against predicted classes. The diagonal contains correct predictions; off-diagonal cells show confusions. State whether rows or columns represent actual labels.
What this method answers
For each class, recall is correct predictions divided by actual cases in that class. Precision is correct predictions divided by cases predicted as that class. Matrix orientation matters.
Use the matrix to inspect class-specific errors, especially when classes have different costs or frequencies. Pair it with per-class metrics, not only accuracy.
Before running a calculation, write down the population and the exact quantity you want to estimate. A method name alone does not define the question, the comparison or the assumptions.
Steps to follow
- Label actual and predicted axes explicitly.
- Calculate each class’s precision and recall from the correct totals.
- Report macro or weighted summaries with class frequencies.
- Review high-cost errors on representative held-out cases.
Keep a record of exclusions, recoding decisions and software settings. That makes the analysis easier to check and repeat.
Worked example
A model classifies 30 items into cat, dog or rabbit. Rows below are actual and columns are predicted.
| Actual / predicted | Cat | Dog | Rabbit |
|---|---|---|---|
| Cat | 8 | 1 | 1 |
| Dog | 2 | 6 | 2 |
| Rabbit | 0 | 1 | 9 |
Cat recall is 8/10=80%; dog recall is 6/10=60%; rabbit recall is 9/10=90%. Overall accuracy is (8+6+9)/30≈76.7%, hiding the weaker dog recall.
Interpret the result carefully
The model misses dog cases most often in this example. Whether that matters depends on the error costs; inspect precision and the individual cases too.
Limit to keep in mind: Counts reflect one evaluation sample and can be unstable for rare classes. Threshold and label quality affect the matrix.
When reporting an analysis, include the sample size, estimate, units and uncertainty. Explain why the method fits the sampling and measurement design. Separate planned tests from exploratory checks, and avoid saying that association proves a cause.
Frequently asked questions
Is the diagonal always correct?
Yes, when actual and predicted labels align on the axes.
Can accuracy hide a weak class?
Yes. Common classes can dominate overall accuracy.
What is macro recall?
The unweighted average of recall across classes.
Does the matrix show calibration?
No. It shows thresholded decisions, not probability reliability.