What is Confusion matrix?

A table that counts the data for each combination of a classification model's prediction and the actual correct answer. For two-class classification it has four cells: true positives (TP), positives correctly predicted as positive; false positives (FP), negatives wrongly predicted as positive; false negatives (FN), positives wrongly predicted as negative; and true negatives (TN), negatives correctly predicted as negative. Accuracy, precision, recall, the F1 score and other metrics can be calculated from it, and it also shows which classes are easily mistaken for which.

Japanese name: 混同行列

Confusion matrix appears in 1 practice question across 1 topic, including Machine Learning Basics.

Field: Machine Learning Basics

Try it: questions about Confusion matrix

A two-class classification model was evaluated on 200 test samples, and its confusion matrix shows 45 true positives (TP), 5 false positives (FP), 45 false negatives (FN) and 105 true negatives (TN). Which pair of precision and recall is correct?

  1. APrecision 0.50, recall 0.90
  2. BPrecision 0.75, recall 0.50
  3. CPrecision 0.90, recall 0.50
Show answer and explanation

Answer: C. Precision 0.90, recall 0.50

Precision is the fraction of items predicted positive that are actually positive: TP ÷ (TP + FP) = 45 ÷ 50 = 0.90. Recall is the fraction of actually positive items that were predicted positive: TP ÷ (TP + FN) = 45 ÷ 90 = 0.50. This model is almost always right when it says positive, but it misses half of the positives. Accuracy is (45 + 105) ÷ 200 = 0.75.

Questions that mention Confusion matrix (1)

  1. A two-class classification model was evaluated on 200 test samples, and its confusion matrix shows 45 true positives (TP), 5 false positives (FP), 45 false negatives (FN) and 105 true negatives (TN). Which pair of precision and recall is correct?

Books on Machine Learning Basics Ad

As an Amazon Associate I earn from qualifying purchases.

Semiconductor, Electronics and Computing Calculators

Related terms

Precision and recall Activation function Convolutional neural network (CNN) Cross-validation Gradient descent k-means clustering Overfitting Principal component analysis (PCA) Recurrent neural network (RNN) Regularization

Back to the glossary