Evaluation & Metrics

mean squared error

/ meen SKWAIRD ER-ur /

When a model predicts a number — a house price, tomorrow's temperature — you measure how wrong it was by the gap between its guess and the truth. Mean squared error takes each of those gaps, squares it, and averages them. Squaring does two things: it makes every error positive (so misses in both directions count), and it punishes big misses far more harshly than small ones.

That harsh punishment is the whole personality of MSE. An error of 10 contributes 100 to the total; an error of 1 contributes just 1. So a single wildly wrong prediction can dominate the score. This makes MSE excellent when large mistakes are genuinely much worse than small ones — but it also makes it very sensitive to outliers, a few freak data points that can balloon the number.

MSE is the default loss that countless models are trained to minimize, partly because its smooth, bowl-shaped math is easy for optimizers to work with. One practical annoyance: because it squares, its units are squared too — predict prices in dollars and MSE comes out in dollars-squared, which means nothing intuitive. That's why people often report its square root, the RMSE, which is back in the original, readable units.

Predicting four house prices, the errors are 2, 3, 1, and 20 (thousands of dollars). MSE = (4 + 9 + 1 + 400) / 4 = 103.5. That lone 20k miss alone contributes 400 of the 414 — one outlier swamps the score, which mean absolute error would not.

Squaring lets one big miss dominate — MSE's strength and its vulnerability.

MSE is not comparable across different problems or units — a "good" MSE for house prices is meaningless for temperatures. To judge whether a number is actually good, compare against a baseline (like always predicting the mean) or use a scale-free measure like R-squared.

Also called
均方误差均方誤差MSEL2 loss平方误差