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 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: , so . Undersampling negatives by a factor changes the odds by .
Steps
- Expected cost of predicting positive is (we are wrong if the patient is negative). Predicting negative costs .
- Predict positive when , i.e. . So the threshold is far below 0.5.
- Undersampling: each negative is kept with probability . The sample odds are , so the model's odds are 10 times too high.
- Solve for : . With : .
- Compare with the threshold: , so flag the patient. Note that a naive 0.5 threshold on the true probability would have missed this patient.
- 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
- Using the sampled probability directly as if it were calibrated.
- Using accuracy to evaluate. It rewards ignoring the minority class.
- Oversampling (duplicating) the minority class before the cross-validation split, which puts copies of the same point in training and validation folds.
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 is the value that minimises the exponential loss, given a weak classifier with weighted error ?
Next in Supervised learning: The four XOR points and with label , and and with label , are not linearly separable. Solving the hard-margin SVM dual with the kernel , what are the , the bias and the decision function?