Confusion Matrix Explainer
A confusion matrix is a table that compares predicted classes with observed classes. For a binary classifier, its four cells count true positives, true negatives, false positives, and false negatives. Multiclass versions expand the table so each row and column corresponds to a class.
The matrix reveals which mistakes are being combined by a single accuracy score. A wildlife classifier might often confuse two visually similar species while recognizing every other species well. That pattern points to a different remedy than errors spread evenly across all classes.
Counts can be normalized by row or column to compare classes of different sizes. The orientation must be labeled because software packages differ on whether rows are actual or predicted classes. A matrix also depends on the decision threshold, dataset, and definition of each label.
Interpretation requires real-world costs. A false alarm and a missed case may not be equally serious, and a large number of true negatives can hide weak performance on a rare positive class. Teams pair the matrix with precision, recall, rates, subgroup analysis, and examples of important failures.
A confusion matrix counts how predicted classes line up with the classes that were actually observed.
Key terms include true positive, true negative, false positive, false negative, class label, normalization, threshold, accuracy and error pattern.
True and false describe whether the prediction was correct; positive and negative describe which class the model predicted or the case actually had.
Those four counts form the basis for accuracy, precision, recall, specificity, false-positive rate, and several other metrics.
Looking across rows and columns shows which classes are missed and which labels absorb mistaken predictions.
The matrix should come from representative held-out data and be reviewed at thresholds relevant to the intended decision.
Explore more "Explainers"
Discover additional explainers across politics, science, business, technology, and other fields. Each explainer breaks down a complex idea into clear, everyday language—helping you better understand how major concepts, systems, and debates shape the world around us.
