Lesson 1 of 6 8 min · 129 words
Confusion matrices
TP, FP, TN and FN in one table.
A confusion matrix tabulates predictions against the truth. For binary problems it has four cells:
- True positive (TP): predicted positive, actually positive.
- False positive (FP): predicted positive, actually negative — a false alarm (type I error).
- True negative (TN): predicted negative, actually negative.
- False negative (FN): predicted negative, actually positive — a miss (type II error).
Every common classification metric — accuracy, precision, recall, specificity, F1 — is a ratio of these four counts. For classes the matrix is ; the diagonal holds correct predictions and off-diagonal cells show which classes get confused with which.
Formula to remember
Accuracy
Share of correct predictions.
Quick check · +5 XP