Machine Learning Basics

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)?

  1. A1.25
  2. B2.25
  3. C9
Show answer and explanation

Answer: B. 2.25

The errors (actual value − predicted value) are 1, 0, −2 and 2. The MSE is the mean of the squared errors: (1 + 0 + 4 + 4) ÷ 4 = 2.25. The mean absolute error (MAE), the mean of the absolute errors, is (1 + 0 + 2 + 2) ÷ 4 = 1.25. Because the MSE squares the errors, it is affected more strongly than the MAE by data points that are far off (outliers).

  • A. This is the mean absolute error (MAE).
  • B. Correct. (1 + 0 + 4 + 4) ÷ 4 = 2.25.
  • C. This is the sum of the squared errors, not divided by the number of data points, 4.
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. 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?
  2. 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?
  3. 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?
  4. Which of the following correctly describes the difference between bagging (random forests and the like) and boosting in ensemble learning?
  5. The class of the 2D point (0, 0) is predicted with k-nearest neighbors. The training data consists of red points (1, 0), (3, 0) and (0, −3) and blue points (0, 2) and (−2, 1). Using Euclidean distance, which pair of predictions for k = 3 and k = 5 is correct?