In a screening task, a false negative costs 20 and a false positive costs 1, with no cost for correct decisions. What probability threshold minimises expected cost? A model trained after keeping only 10% of the negatives outputs ps=0.5 for a patient. What is the true probability, and what do we decide?

Supervised learning, Class imbalance
Level L3 Intermediate. Length Medium. Nature Mat Mathematical.

What's being asked

Whether you can work out a cost-based decision threshold and correct probabilities after undersampling.

Key idea

Predict positive when the expected cost of doing so is lower: (1−p)cFP<p cFN, so p>cFPcFP+cFN. Undersampling negatives by a factor β changes the odds by 1/β.

Steps

  1. Expected cost of predicting positive is (1−p)⋅cFP (we are wrong if the patient is negative). Predicting negative costs p⋅cFN.
  2. Predict positive when (1−p)(1)<20p, i.e. p>1/21≈0.048. So the threshold is far below 0.5.
  3. Undersampling: each negative is kept with probability β=0.1. The sample odds are ps/(1−ps)=pβ(1−p), so the model's odds are 10 times too high.
  4. Solve for p: p=βpsβps−ps+1. With ps=0.5: p=0.050.05−0.5+1=0.050.55≈0.091.
  5. Compare with the threshold: 0.091>0.048, so flag the patient. Note that a naive 0.5 threshold on the true probability 0.091 would have missed this patient.
  6. A cleaner alternative is to keep all the data and use class weights or the threshold shift directly. Either way, the decision threshold should come from costs, not from 0.5.

Common mistakes

How long your answer should be

Half a page; 4 minutes.

Read this

Previous in Supervised learning: How do you show that the AdaBoost classifier weight α=12ln⁡1−εε is the value that minimises the exponential loss, given a weak classifier h with weighted error ε?
Next in Supervised learning: The four XOR points (1,1) and (−1,−1) with label +1, and (1,−1) and (−1,1) with label −1, are not linearly separable. Solving the hard-margin SVM dual with the kernel k(x,z)=(1+x⊤z)2, what are the αi, the bias and the decision function?