Skip to content
Lambdian

Confusion matrix

A table counting true positives, false positives, false negatives and true negatives.

For a binary classifier, the confusion matrix sorts every prediction into four boxes:

  • True positive (TP): predicted positive, actually positive.
  • False positive (FP): predicted positive, actually negative (a false alarm).
  • False negative (FN): predicted negative, actually positive (a miss).
  • True negative (TN): predicted negative, actually negative.

Precision, recall, accuracy, specificity and F1 are all computed from these four counts. Which box matters most depends on the cost of each mistake.

See it in action