Machine Learning Basics

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.

  • A. Precision and recall are swapped.
  • B. 0.75 is the accuracy (the fraction of all predictions that are correct), not the precision.
  • C. Correct. Precision is 45 ÷ 50 = 0.90 and recall is 45 ÷ 90 = 0.50.
Practice this topic Back to topic

Related calculators

Books on Machine Learning Basics Ad

As an Amazon Associate I earn from qualifying purchases.

More Machine Learning Basics questions

  1. A two-class classification model was evaluated on 200 test samples, giving TP = 20, FP = 5, FN = 30 and TN = 145. Which is closest to the F1 score?
  2. Which of the following correctly describes the ROC curve and AUC used to evaluate two-class classification models?
  3. For data of 1000 items of which only 10 are positive, what is the accuracy of a model that predicts every item as negative?
  4. Four data points have actual values 3, 5, 2 and 6, and the model predicts 2, 5, 4 and 4 for them. What is the mean squared error (MSE)?
  5. A straight line y = ax + b is fitted by least squares to the three data points (x, y) = (1, 3), (2, 4) and (3, 8). What is the predicted value at x = 4?