all lessons

probability

did you know an accurate alarm can usually be wrong?

when something is rare, the ordinary cases can swamp the signal.

the idea at a glance

99 : 999

true alerts : false alerts

expected alerts in a hypothetical batch of 100,000, with a 0.1% fault rate.

  1. 100 faulty
  2. 99 detected
  3. 999 false alarms

the idea

imagine a factory where only one item in a thousand has a fault. a detector catches 99% of faulty items and incorrectly flags 1% of good ones. most of its alerts will still be false alarms.

how it works

in an illustrative batch of 100,000 items, expect 100 faults and 99,900 good items. the detector flags about 99 real faults, but also about 999 good items. only 99 of the 1,098 alerts point to a fault.

go deeper

where do all the false alarms come from?

imagine a factory where only one item in a thousand has a fault. a detector catches 99% of faulty items and incorrectly flags 1% of good ones. most of its alerts will still be false alarms.

the detector sees vastly more good items than bad ones. a tiny fraction of a huge pile can outnumber almost all of a tiny pile. accuracy alone misses that imbalance.

count a whole batch

in an illustrative batch of 100,000 items, expect 100 faults and 99,900 good items. the detector flags about 99 real faults, but also about 999 good items. only 99 of the 1,098 alerts point to a fault.

that is roughly 9%. the detector can be useful, but an alert should trigger investigation rather than certainty. these are expected counts; actual batches fluctuate.

which probability are we asking for?

the chance of an alert given a fault is not the chance of a fault given an alert. to answer the second question, divide true alerts by all alerts.

P(fault | alert) = 99 / (99 + 999) ≈ 9.0%

how could the alerts become more useful?
  • reducing the false-positive rate can matter enormously when the event is rare. so can testing a group where faults are more common.
  • combining two detectors requires knowing whether their mistakes are linked. you cannot assume independent evidence just because there are two scores.
sources & further reading

concepts: Bayes' theorem · base rates · false positives

2 minute read