Compare accuracy with a majority baseline
Type each count alongside the label that gives it meaning. · 185 words
Accuracy is the share of all predictions that are correct. A majority baseline always predicts the class that appears most often in the data. Comparing the two can reveal whether a classifier has learned anything useful. For example, a store fraud model reviews 1,000 transactions: 950 are legitimate and 50 are fraudulent. The model correctly flags 40 fraudulent transactions and correctly clears 900 legitimate ones. It misses 10 frauds and wrongly flags 50 legitimate transactions. Accuracy is 940 divided by 1,000, or 94 percent.
However, always predicting legitimate gives 950 correct predictions, so the majority baseline has 95 percent accuracy. The model has lower accuracy because it catches many frauds, but that detection may be valuable. In a different example, a weather app classifies 100 days with 30 rainy and 70 dry. Always predicting dry earns 70 percent accuracy. A model that finds 25 rainy days and 55 dry days correctly earns 80 percent. It beats the baseline by 10 percentage points, although it still makes 20 errors. Compare accuracy with the baseline, then consider whether the rare class matters and what each error costs.
Check your recall
A test set has 900 negative and 100 positive cases. If a classifier is 95 percent accurate, what majority baseline should it beat?
Check your answer
The majority class is negative, so the baseline is 900 / 1,000 = 90 percent. The classifier beats it by 5 percentage points.
Sources and credits
Original KeyTouch lesson. Background reading · Google · Classification metrics.