Accuracy Hides Which Class a Classifier Gets Wrong
Accuracy is the share of a classifier's predictions that are right: correct predictions divided by all predictions, written Acc = (1/n) Σ 1{ŷᵢ = yᵢ}. It is the first number anyone reports, and the first one that can fool you, because it adds every kind of mistake into one total and never says which class took the hits.
Try it by hand. Prof Rod's practice deck has 20 cards. Eighteen are labeled "fine" and 2 are labeled "needs help". A lazy classifier stamps "fine" on every card. It gets 18 right out of 20, so accuracy is 18/20 = 0.90. Ninety percent sounds like an A. Now look at the two cards that matter: it found 0 of 2. The total hid the only failure that counted.
The same trap shows up in real data. In the credit-card default data set that James, Witten, Hastie, and Tibshirani use, only 3.33 percent of the 10,000 people defaulted. They point out that a "simple but useless" classifier that always predicts no default has an error rate of 3.33 percent. Their linear discriminant classifier does better, with a training error rate of 2.75 percent, which is a training accuracy of 97.25 percent against 96.67 percent for doing nothing. Yet of the 333 people in the training sample who defaulted, it missed 252, or 75.7 percent. Its training sensitivity, the share of real defaulters it catches, is 24.3 percent. These are all training-set figures, so they say nothing yet about new customers. A 0.58-point gain in training accuracy sits on top of a classifier that misses three defaulters out of four.
The fix costs nothing. Keep the accuracy number, then print the confusion matrix beside it: for each true class, how many predictions landed in each class. When one class is rare, or one mistake costs far more than the other, the per-class rates (sensitivity and specificity in the authors' words) say more than the total ever can.
The trap: high accuracy proves every class is handled well. It does not. A high number can mostly reflect the majority class: when 96.67 percent of the data is one class, always guessing that class scores 96.67 percent with no skill at all.
Prof Rod's rule: never quote accuracy without the class counts next to it.
The card counts in the first example are invented for teaching. The default-data figures are the authors'.