AI Dictionary › Fondamenti AI

Confusion matrix

Matrice di confusione

A confusion matrix is a table that summarizes a classification model's performance by comparing its predictions with the true labels, showing exactly where the model got things right and where it got them wrong. It is the basic diagnostic tool for understanding not just how much a model errs, but in which direction it errs.

Definition

How it works

In the simplest case, binary classification, the matrix has four cells: true positives, positive cases correctly identified as such, true negatives, negative cases correctly identified, false positives, negative cases mistaken for positive, and false negatives, positive cases mistaken for negative. Almost all commonly used evaluation metrics, such as precision, recall and accuracy, are computed from these four numbers. With more than two classes, the matrix expands into a larger grid, with one row and one column per category.

Applications

It is especially revealing when the two types of error carry very different consequences: in a medical diagnostic system, a false negative, missing a disease that is present, can be far more serious than a false positive, which only triggers an additional check. The confusion matrix makes this imbalance immediately visible, something a single aggregate metric like accuracy risks hiding, especially with imbalanced classes.

History & etymology

The term confusion literally describes the cells off the main diagonal of the table, where the model confuses one class for another. The concept has roots in statistics applied to diagnostics and psychological testing in the first half of the twentieth century, and it was adopted systematically in machine learning and pattern recognition literature starting in the 1960s and 70s as a standard tool for evaluating classifiers.

Related terms

More in Fondamenti AI

Put it into practice

From our network

Magellano GPS: Fleet Tracking Made Simple

Real-time GPS tracking, remote engine lock, fuel and CO₂ reporting for your fleet.

Visit magellanogps.com →

From the Agora Intelligence blog

More on agora-intelligence.com →

📱 Download the Android app (beta) iOS coming soon

Say what you mean. Get what you need.

Grace Certified, the AI coach that trains and certifies your prompt engineering, by Agora Intelligence.