Machine Learning Basics
For data of 1000 items of which only 10 are positive, what is the accuracy of a model that predicts every item as negative?
- A0%
- B1%
- C99%
Show answer and explanation
Answer: C. 99%
Predicting everything as negative gets all 990 negatives right and all 10 positives wrong, so the accuracy is 990 ÷ 1000 = 99%. On the other hand, it finds no positives at all, so its recall is 0% and it is useless when the purpose is to find positives, as in detecting disease or fraud. For data in which the class proportions are heavily skewed (imbalanced data), models are therefore evaluated not by accuracy alone but together with precision, recall, the F1 score and so on. Countermeasures include weighting errors on the minority class more heavily and sampling to balance the number of data points per class.
- A. This is the recall. No positives are found, so the recall is 0%.
- B. This is the proportion of positives in the whole data set.
- C. Correct. 990 ÷ 1000 = 99%.