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?

  1. A0%
  2. B1%
  3. 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%.
Practice this topic Back to topic

Related calculators

Books on Machine Learning Basics Ad

As an Amazon Associate I earn from qualifying purchases.

More Machine Learning Basics questions

  1. Four data points have actual values 3, 5, 2 and 6, and the model predicts 2, 5, 4 and 4 for them. What is the mean squared error (MSE)?
  2. A straight line y = ax + b is fitted by least squares to the three data points (x, y) = (1, 3), (2, 4) and (3, 8). What is the predicted value at x = 4?
  3. In logistic regression, z = 2x − 4 is passed through the sigmoid function σ(z) = 1 ÷ (1 + e^(−z)) and the result is output as the probability of being positive. What is the output when x = 2?
  4. A node of a decision tree holds 6 data points of class A and 4 of class B. What is the Gini impurity of this node?
  5. Which of the following correctly describes the difference between bagging (random forests and the like) and boosting in ensemble learning?