Classical Machine LearningIntermediate18 min read5 questions

Evaluation Metrics: Choosing and Defending the Right One

Picking the metric is a product decision disguised as a technical one. Learn to derive the right metric from the cost of each error type — and to defend it.

Covers: Precision/recall/F1, ROC-AUC vs PR-AUC, threshold selection, calibration, regression metrics, ranking metrics

Metric questions are the most reliable seniority filter in an ML interview. A junior answer names a metric. A senior answer asks what the model's decisions cost, derives the metric from that, and then names the threshold too.

Filter
0/5 mastered
FoundationalmetricsclassificationprecisionAsked at Stripe, Meta Integrity

30-second answer

Precision is the fraction of positive predictions that are correct — it answers 'when I flag something, am I right?'. Recall is the fraction of actual positives caught — 'of everything I should have found, how much did I?'. F1 is their harmonic mean. Optimise precision when false positives are expensive (spam filters, auto-blocking payments), recall when false negatives are expensive (cancer screening, fraud triage, safety).

Advancedroc-aucpr-aucimbalancedAsked at Stripe, PayPal

30-second answer

ROC-AUC uses the false positive rate, whose denominator is the (huge) negative count, so thousands of extra false positives barely move it. PR-AUC's precision has false positives in the denominator against a tiny true-positive count, so it responds sharply. At 1:1000 imbalance a model can show 0.95 ROC-AUC and 0.08 PR-AUC — the second number is the one that describes what a user experiences.

AdvancedcalibrationprobabilitiesproductionAsked at Google Ads, Criteo

30-second answer

A calibrated model's predicted probabilities match observed frequencies: among all cases scored 0.7, about 70% should be positive. It matters whenever a score feeds an expected-value calculation — pricing, bidding, ranking by expected revenue, or thresholding on cost. Fix it post-hoc with Platt scaling (sigmoid) or isotonic regression, fitted on a held-out set, and measure with ECE and a reliability diagram.

IntermediateregressionmetricsforecastingAsked at Amazon Supply Chain, Instacart

30-second answer

RMSE penalises large errors quadratically and targets the conditional mean; MAE is robust to outliers and targets the median; MAPE is scale-free but explodes near zero and asymmetrically punishes over-prediction; R² is a relative measure that flatters models on high-variance data. For demand forecasting I would use MAE or weighted MAE for the headline, plus a pinball loss if the downstream decision is inventory, since that needs a quantile rather than a mean.

AdvancedrankingndcgrecsysAsked at Google Search, Spotify

30-second answer

Use top-k metrics because users only see the top: precision@k and recall@k for binary relevance, MAP for ordering within the relevant set, MRR when only the first hit matters, and NDCG@k when relevance is graded and position matters. Complement these with beyond-accuracy metrics — coverage, diversity, novelty — and validate offline conclusions with interleaving before a full A/B test.

Showing 5 of 5 questions for evaluation-metrics-interview-questions.

Check your understanding

5 questions · no sign-up, nothing stored

0/5 answered
Question 1

1.A model has 0.95 ROC-AUC and 0.08 PR-AUC on a 1:1000 problem. This means:

Question 2

2.False negatives cost 100× false positives. Your decision threshold should be:

Question 3

3.A model outputs 0.9 for a group of cases in which only 60% are actually positive. This is:

Question 4

4.On right-skewed demand data, optimising MAE instead of RMSE causes the model to predict:

Question 5

5.NDCG@10 uses a logarithmic position discount because:

Hands-on challenge

Build it — this is what you talk about in a deep-dive round.

Build a metric-selection report

For one imbalanced classification problem, produce the analysis you would hand a product manager.

Requirements

  • Accuracy, ROC-AUC, PR-AUC and the trivial baseline for each, side by side, with commentary.
  • A cost matrix elicited from assumptions you state explicitly, plus the derived optimal threshold and expected cost.
  • Reliability diagram and ECE before and after Platt and isotonic calibration.
  • A precision@k table for the k values your (hypothetical) review team can actually handle.

Stretch goals

  • Add bootstrap confidence intervals for PR-AUC and for precision at the chosen threshold.
  • Simulate a 20% prevalence shift and show which metrics move and which stay put.