What the numbers mean
Two piles of 99. Only one contains scams.
The filter correctly flags 99 scams and wrongly flags 99 ordinary messages. That makes 198 alerts, with scams accounting for half. Across the whole batch, 9,900 of its 10,000 decisions are correct: 99% accuracy.
Read the sourcesTwo percentages, two different questions
Accuracy asks how often the filter gets any decision right. Precision asks how many of its flags are genuine. Our filter correctly clears 9,801 ordinary messages and catches 99 scams. Those many correct clearances make overall accuracy high, even though half the flagged messages are false alarms. [1]
A small error rate can meet a very large group
Only one in 100 messages is a scam in this example. The remaining 99 in 100 create a much bigger pool for false alarms. Google's machine-learning guidance calls this a class imbalance. The starting mix matters: the same detection and false-alarm rates can produce different shares of genuine alerts in different batches. [2]
Look beyond one headline score
A useful evaluation separates caught scams, missed scams, false alarms and correctly cleared messages. It also checks whether the test batch resembles the messages the filter will actually see. Raising or lowering a filter's decision threshold can change these trade-offs. No single accuracy percentage describes all of them. [3]