A calibrated fraud model outputs p=P(fraud∣x). Missing a fraud costs ₹10,000 and flagging a legitimate transaction costs ₹1,000 in review effort. Derive the cost-minimising threshold. What would you do if the model were not calibrated?

ML systems and evaluation, Decision thresholds
Level L3 Intermediate. Length Medium. Nature Mat Mathematical.

What's being asked

Whether you can turn error costs into a decision rule instead of defaulting to 0.5.

Key idea

Flag when the expected cost of flagging is lower than the expected cost of not flagging: (1−p) CFP<p CFN, which gives p>t∗=CFPCFP+CFN.

Steps

  1. Write the expected cost of each action given p, taking correct decisions to cost 0: not flagging costs p CFN; flagging costs (1−p) CFP.
  2. Flag if and only if (1−p) CFP<p CFN, that is, p>CFPCFP+CFN.
  3. Numbers: t∗=10001000+10000=111≈0.091. Because a miss is ten times as costly, you flag even at a 9% fraud probability.
  4. If the model is not calibrated: either calibrate it first (Platt scaling or isotonic regression on held-out data), or sweep thresholds on a validation set and pick the one with the lowest total cost CFN⋅FN(t)+CFP⋅FP(t).
  5. Note a common practical limit: if the review team can only handle k flags a day, the threshold is set by capacity (flag the top k), and precision@k becomes the metric that matters.

Common mistakes

How long your answer should be

Three lines of derivation, one number, and two sentences on calibration; about 3 minutes.

Last checked on 4 December 2026.

Read this

Previous in ML systems and evaluation: Your current click-through rate is 10%. How many users per arm does an A/B test need to detect an absolute increase to 11%, with a two-sided significance level of 5% and 80% power?
Next in ML systems and evaluation: For true values y=[2,4,6,8] and linear-regression predictions y^=[3,3,7,7] (fitted with p=1 feature), what are R2 and adjusted R2, how can test-set R2 become negative, and why does adding a pure-noise feature never reduce training R2 whereas adjusted R2 penalises it?