Lesson 4.8 · 7 min read · about 45 min to master at a very slow pace

Sensitivity and Specificity Trade-offs

Moving the threshold trades misses for false alarms. Why you can't raise sensitivity and specificity together with the same model, and how to reason about which to favour.

Not startedJump to quiz

Two overlapping distributions

A classifier gives each case a score (for logistic regression, ). Positives tend to score higher than negatives, but the two distributions overlap. Wherever you put the threshold, some negatives land above it (false positives) and some positives below it (false negatives).

-4-20246model scorethreshold: predict positive →FPFN
Actual negativesActual positives
Negatives right of the threshold are false positives; positives left of it are false negatives. Sliding the line trades one for the other.

Which way does each move?

ThresholdFlagSensitivitySpecificityFNFP
Lower (e.g. 0.5 → 0.2)More cases↑↓↓↑
Raise (e.g. 0.5 → 0.8)Fewer cases↓↑↑↓

At the extremes: threshold 0 flags everyone (sensitivity 1, specificity 0); threshold 1 flags no one (sensitivity 0, specificity 1). Neither is useful.

Only a better model moves both

With a fixed model, the threshold just slides along a trade-off. To improve sensitivity and specificity together you need a model whose score distributions overlap less: better features, more data, a better method. That's what the ROC curve and AUC measure (4.10).

Precision and recall trade off too

Lowering the threshold usually raises recall (sensitivity) and lowers precision, since you flag more marginal cases. Precision–recall is the more informative pair when positives are rare and true negatives are plentiful and uninteresting.

How it's asked

"A team lowers the threshold until sensitivity is 100%, then boasts about it. What's the catch?" Flagging nearly everyone achieves perfect sensitivity at the cost of a huge number of false positives (specificity and precision collapse). Report both sides of the trade-off.

Cheatsheet

Threshold effects

Lower → more flagged → sens ↑, spec ↓, FN ↓, FP ↑, precision usually ↓. Raise → the reverse.

See every cheatsheet by category →

Check your understanding

Score 75% or more to master this lesson and earn XP. Answer first, then check.

Q1interpretYou lower the classification threshold from 0.5 to 0.2. What generally happens?
Q2conceptWith the same fitted model, can you raise sensitivity and specificity together by moving the threshold?
Q3interpretWhat happens at a threshold of 0, where every case is flagged positive?
Q4diagnoseA team lowers the threshold until sensitivity reaches 100%, then reports this as a big success. What's the catch?
Q5applyWhat would improve both sensitivity and specificity at the same time?