topskill.dev
CoursesTracks
All courses/Machine Learning FundamentalsSquared error and large misses
Understanding prediction errors
3 / 7
← Machine Learning Fundamentals
○What machine learning learns○Features and labels○Training and inference○Regression or classification○The machine learning process○Data quality and coverage○Representing data✦Module Quiz
○Linear regression○Try a tiny linear model○Logistic regression○Nearest neighbors○Decision trees○Random forests○Boosting○Naive Bayes○Support vector machines✦Module Quiz
○Clustering○K-means○Choosing and interpreting clusters○Principal component analysis○Neural networks and deep learning○Self-supervised learning○Transfer learning○Reinforcement learning✦Module Quiz
○Generalization and overfitting○Holding out evaluation data○Data leakage○Baselines○Bias and variance intuition○Reading learning curves✦Module Quiz
○Prediction errors and residuals○Measuring regression error●Squared error and large misses○The confusion matrix○Precision and recall○Try a held-out classifier✦Module Quiz
○Bias and limits○Monitoring and drift○Comparing models for a decision✦Module Quiz
Understanding prediction errors

Squared error and large misses

Mean squared error, or MSE, squares each numerical miss before averaging. Squaring removes the sign and gives larger misses more influence than smaller ones.

For two predictions with residuals r1r_1r1​ and r2r_2r2​:

MSE=r12+r222\text{MSE}=\frac{r_1^2+r_2^2}{2}MSE=2r12​+r22​​

Each rrr is an observed value minus its prediction; subscripts 1 and 2 identify the examples. The exponent 2 means multiply the residual by itself. For residuals of −2-2−2 and 444 minutes, MSE is (4+16)/2=10(4+16)/2=10(4+16)/2=10 squared minutes.

The chart compares penalties, not two scores in the same physical units. A four-minute miss contributes 4 minutes to the absolute-error sum but 16 squared minutes to the squared-error sum. Squared error makes an occasional large miss relatively more influential.

Root mean squared error, or RMSE, takes the square root after averaging:

RMSE=MSE\text{RMSE}=\sqrt{\text{MSE}}RMSE=MSE​

The square-root sign means the nonnegative value whose square gives MSE. For MSE of 10 squared minutes, RMSE is approximately 3.16 minutes. MAE for the same pair is 3 minutes. Both return a useful summary, but neither describes every example's error.

Choose a measure that reflects the task, and inspect unusual misses separately. MAE is less affected by extreme errors than MSE, but it is not immune to them. A model that improves one measure may worsen another. Compare candidates on the same evaluation examples.

Check your understanding

If a miss increases from 2 to 4 minutes, how does its squared-error contribution change?

Answer: It rises from 4 to 16 squared minutes, four times as much.

Fact 1
1 / 1
FACT 1

It rises from 4 to 16 squared minutes, four times as much.