KatInterview

Trading Off Precision and Recall in Production Classifiers

Machine LearningModel answer
EasyModel answerMachine Learningprecision-recallthreshold-selectioncost-sensitive-learning

Last updated

Decide when a product classifier should favor precision or recall, and explain how to set its decision threshold using error costs, capacity limits, class imbalance, and post-launch monitoring.

Setting

Your team ships a binary classifier whose positive prediction triggers a product action. Depending on the product, that action could be showing a warning, blocking an item, sending it to a human reviewer, pushing a notification, or ranking a sales lead higher.

Questions

  1. In the context of such a product, what do precision and recall each measure, and what does a low value of each cost the business?
  2. Name 2-3 concrete business scenarios where you would favor precision over recall, and justify each.
  3. Name 2-3 concrete business scenarios where you would favor recall over precision, and justify each.
  4. Walk through how you would pick the operating threshold (or decision rule) in practice. Cover:
    • asymmetric costs of the two error types
    • limited capacity, such as the size of a manual review team
    • base rate and class imbalance
    • which metrics and curves you would inspect
    • which guardrail metrics you would watch after launch

Answer as you would in a technical screen: be concrete, tie the metrics to the action being triggered, and justify your choices with trade-offs.

Hints

Hint 1

Define a positive as 'the model fires the action'. Then precision describes the cost of acting wrongly, while recall describes the cost of failing to act.

Hint 2

Ask three things about the action: Is it automatic or followed by a human or second model? Is it reversible? Who pays when it is wrong? The answers usually reveal which error is worse.

Hint 3

For thresholding, begin with an expected-cost calculation (which needs calibrated scores), then add constraints such as review capacity (use precision@k), and finally check everything at production prevalence rather than on rebalanced data.