Classification Metrics interview question

Machine LearningClassification Metricsbasic

What does precision measure for a binary classifier?

  1. AOf all cases the model predicted as positive, the share that are actually positive: TP / (TP + FP).
  2. BOf all cases that are actually positive, the fraction the model predicted as positive: TP / (TP + FN).
  3. COf all cases that are actually negative, the fraction the model predicted as negative: TN / (TN + FP).
  4. DOf all cases in the dataset, the fraction that the model classified correctly: (TP + TN) / N.
Show the answer and explanation

Correct answer: A, Of all cases the model predicted as positive, the share that are actually positive: TP / (TP + FP).

Explanation Classification Metrics

Precision (positive predictive value) answers: when the model says positive, how often is it right? Precision = TP / (TP + FP). Its denominator is the set of predicted positives, so false positives lower it.

The other formulas are different metrics:

  • TP / (TP + FN) is recall (sensitivity): its denominator is the actual positives.
  • TN / (TN + FP) is specificity, the true negative rate.
  • (TP + TN) / N is accuracy.
metricdenominator
precisionpredicted positives
recallactual positives

Interview tip: a quick memory aid is "precision looks at the predictions, recall looks at the reality"; expect a follow-up on which one matters more for your use case.

Practice it as a quiz

Answer this and the other free questions with instant grading, streaks and weak-topic tracking, or unlock all 4,000 questions.

More Machine Learning questions

  1. How does k-fold cross-validation work?
  2. How does grid search look for good hyperparameters?
  3. What is the difference between batch gradient descent and stochastic gradient descent (SGD)?
  4. In reinforcement learning vocabulary, what is the reward?
  5. Both series below rise at a similar average rate. Series A was generated as a linear trend plus stationary noise; Series B is a random walk with drift. Which…