Overview
Curated: · Written: · Reviewed:
Model Evaluation Metrics
In one line
Choose the metric from the decision: the error costs, the class balance, the action that consumes the score, and the review capacity. Use ROC AUC to judge ranking, log loss or Brier score to judge probabilities, and precision and recall at a declared threshold to judge the decision.
Key definitions
- Precision: TP / (TP + FP), the share of flags that are real fraud.
- Recall (TPR): TP / (TP + FN), the share of real positives caught.
- FPR: FP / (FP + TN), the share of legitimate cases flagged.
- Prevalence: positives / N. It sets the precision baseline and the meaning of every precision number.
- Calibration: among cases scored p, the observed positive rate is p.
- Macro vs weighted average: macro gives each class equal weight; weighted follows class support.
Formulas and complexity
How it works
The model emits a score. A threshold turns each score into a flag, which splits the set into four counts. Precision, FPR and alert volume come from the flagged side. Recall and missed-fraud cost come from the unflagged side. Moving the threshold moves cases between sides, and only the ranking stays fixed. AUC summarizes every threshold at once, so it cannot tell you which one to ship.
When to use and when not to
| Metric | Use when | Avoid when |
|---|---|---|
| Accuracy | Classes are roughly balanced and errors cost the same | Prevalence is low; an all-negative model scores high |
| Precision and recall | A specific threshold will drive an action | You still need to pick the threshold |
| ROC AUC | You compare rankings across models | Positives are rare and you need alert volume |
| PR curve and average precision | Positives are rare; precision matters | You compare populations with different prevalence |
| Log loss, Brier | Scores feed expected-cost decisions | The scores are only ranked, never used as probabilities |
| MAE, RMSE | Error is in target units; MAE for linear cost, RMSE for large-miss penalties | Targets are near zero (MAPE breaks) |
Traps interviewers probe
- Accuracy at low prevalence. At 0.5% fraud, a model that flags nothing scores 99.5%. Fix: report confusion counts, precision and recall. In MCQ 1, 99.35% accuracy hides 900 missed frauds and 10% recall.
- Reading AUC as the operating point. AUC is identical at every threshold. Fix: fix the threshold from costs and review capacity, then report precision, recall and alert count there.
- Random splits on repeated entities. Shuffled CV puts one patient in both train and test, which inflates AUC. Fix: split by patient, then compare to a holdout of unseen patients.
- Calibrating and scoring on the same rows. An isotonic fit on a set and re-measured on that set looks perfect and then fails on fresh data. Fix: fit calibration on one fold, measure on another.
- Reporting the best of many variants. The maximum of 50 noisy test accuracies overstates the expected accuracy. Fix: report the chosen model's score once on a locked test set, with an interval.
Interview tips
Open with the decision. Start with "What action consumes the score, what does each error cost, and how many alerts can we handle?" Then name the metric. Do not open with a metric name.
Expect these follow-ups:
- Why does AUC look good while alerts overwhelm the team? Rare positives make a small FPR produce many false positives.
- How do you set the threshold? Minimize expected cost on a validation set, subject to review capacity, then test once.
- What changes when prevalence falls? Precision falls with the same scores and the same AUC (MCQ 24).
- Why is a lower Brier score not always better? It can improve through sharper, better-ranked predictions while calibration worsens (MCQ 10).
- How wide is the uncertainty? Bootstrap the eval set; small slices give wide intervals (MCQ 22).
30-second answer outline:
- Name the action and the costs: "A missed fraud costs $500, a false alarm $8."
- Name the metric for the decision: expected cost and alert volume at the threshold.
- Name the ranking and calibration checks: AUC and reliability on a grouped holdout.
- Name the guardrails: per-cohort recall, prevalence assumptions, and the single locked test run.
Feedback on this overview
Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.