aNet.ai
Machine Learning/Learning path
0day streak0XP · Lv 1
← 8. Model Evaluation
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

A model that always predicts 'negative' on 95%-negative data has accuracy…

Practice this topic
Saved in this browser as you type.
aNet.ai · Introduction to Machine Learning · NewUU course outlineProgress saved in this browser