Changing the Threshold of a Fixed Classifier

A threshold changes which scores count as a positive prediction. It leaves the underlying scores the same.

Source
Anbloq
Language
English
Created
Updated
Chapters
4
Reading time
1 min
In this article4 chapters
  1. Trace three records
  2. Compare with known labels
  3. Trace what each newly included record contributes
  4. Choose a threshold independently of the final test

Trace three records

For scores 0.2, 0.6, and 0.8, threshold 0.7 selects only the last. A threshold of 0.5 also selects the middle. Probability and action rules distinguish those two layers.

Compare with known labels

The additional selection improves recall if genuinely positive. A negative can reduce precision when any true positives were already selected. Confusion matrices describe the observed tradeoff.[1][2]

Trace what each newly included record contributes

Two positive examples receive scores .9 and .6. One negative example receives score .7. At threshold .8 only .9 is predicted positive. Lowering to .6 includes all three, improving recall on these cases and adding a false flag. See probabilities and decision rules.

Threshold .8: TP=1, FP=0, FN=1
Threshold .6 inclusive: TP=2, FP=1, FN=0
Recall moves from .5 to 1

Choose a threshold independently of the final test

Tune cutoffs using validation or an explicit operating policy. Precision can change in either direction as examples enter. Preserve tied scores and test exact threshold equality.

References

  1. Gareth James et al., An Introduction to Statistical Learning ↩
  2. scikit-learn Developers, Metrics and Scoring: Quantifying the Quality of Predictions ↩