KatInterview

Fraud Scorer: Picking a Decision Threshold with Asymmetric Costs

Machine LearningModel answer
MediumModel answerMachine Learningcost-sensitive learningthreshold selectioncalibration

Last updated

Select and justify an operating threshold for a fraud probability scorer given asymmetric FP/FN costs, then cover calibration, drift monitoring, and safe rollout.

Fraud Probability Scorer: Threshold Selection Under Asymmetric Costs

You maintain a binary fraud classifier that outputs a probability score for each payment transaction. Your job is to choose an operating threshold that minimizes expected business cost and to design the surrounding infrastructure to keep it well-calibrated and safe to update over time.

Setup

Per 1,000,000 transactions, assume:

  • Base fraud rate: 0.20% (2,000 fraudulent, 998,000 legitimate)
  • Cost of a false positive (blocking a legitimate transaction): $15
  • Cost of a false negative (approving a fraudulent transaction): $100

Three candidate thresholds have been evaluated on a representative validation set:

ThresholdTPRFPR
T10.900.020
T20.800.010
T30.650.004

What you are expected to address

Part 1 — Threshold selection. For each candidate, compute the expected TP, FP, FN, TN counts and total cost per million transactions. Identify which threshold minimizes expected cost and explain the business trade-offs. Derive the general optimality condition from first principles and discuss sensitivity to cost assumptions.

Part 2 — Score calibration and drift monitoring. Explain how you would verify and maintain score calibration (covering at least two calibration methods), detect distribution and label drift given that fraud labels mature with a 30–90 day delay, and distinguish prior shift from concept drift.

Part 3 — Segment-level re-tuning and guardrails. Describe how you would set different thresholds for distinct segments (e.g., by country, merchant category, transaction amount). Propose guardrail metrics to catch harmful side effects — particularly on high-value customers — and outline an experiment design that validates threshold changes without creating unacceptable customer friction.

Hints

Hint 1

Remember that FPR is a rate over the negative population and TPR is a rate over the positive population. With a 0.20% fraud rate, even a small FPR generates a very large absolute FP count — get the denominators right before computing costs.

Hint 2

The cost-optimal point on the ROC curve is where its local slope equals (C_FP × N) / (C_FN × P). Compute this target slope and compare it to the chords between your three candidate points to reason about whether T3 is truly the global optimum or just the best of the three.

Hint 3

For calibration, ask yourself what happens when the model was trained on downsampled negatives — the raw output scores will not match real-world probabilities without a correction step. For drift, separate leading indicators (score distributions, feature shifts) that are available in near-real-time from lagging indicators (precision/recall on matured labels) that only arrive weeks later.