Skip to content
RED SAGSkills
easyMachine Learning Engineer interview question

Explain precision and recall with a real example. When would you favour one over the other?

What the interviewer wants to hear

  • Precision: of predicted positives, how many are correct
  • Recall: of actual positives, how many were found
  • Changing the threshold trades one for the other
  • Choice depends on the cost of false positives versus false negatives

Model answer

Precision is the share of predicted positives that are truly positive. Recall is the share of actual positives that the model finds. Take a cancer screening model: recall matters most, because missing a sick patient (a false negative) is very costly, while a false positive only leads to an extra test. For a spam filter, precision matters more, because sending an important email to spam is worse than letting a few spam emails through. Most models output a score, and moving the decision threshold trades precision against recall: a lower threshold catches more positives but adds false alarms. I pick the threshold using validation data and the real business cost of each error type. When I need one balanced number, I use F1 score, and to compare models across thresholds I use the precision-recall curve.

Can you answer it under time pressure?

Take a timed easy round and get scored on every answer.

Start mock interview

More easy Machine Learning Engineer questions