Confusion Matrix
A table of a classifier’s predictions vs. reality — true/false positives and negatives — the basis of most metrics.
A confusion matrix is a table comparing a classifier’s predictions against the true labels, with four cells for binary classification: true positives, false positives, true negatives, and false negatives. Nearly every classification metric — precision, recall, accuracy, F1 — is computed from these four numbers.
Worked example: a spam filter that catches 90 of 100 spams (10 false negatives) but also flags 5 real emails (5 false positives) has its whole behavior captured in the matrix, from which you read precision = 90/95 and recall = 90/100. Gotcha: accuracy alone is misleading on imbalanced data — a model that calls everything “not fraud” is 99.9% accurate if fraud is rare but catches zero fraud — which is exactly why you look at the full matrix (and precision/recall) rather than a single accuracy number.