What is MSE?
Mean squared error: the average of the squared differences between predicted and actual values. Squaring makes every error positive and lets large misses dominate, so MSE is the standard regression loss and is sensitive to outliers.
Mean squared error: the average of the squared differences between predicted and actual values. Squaring makes every error positive and lets large misses dominate, so MSE is the standard regression loss and is sensitive to outliers.
Card 1 of 263. Answer: Mean squared error: the average of the squared differences between predicted and actual values. Squaring makes every error positive and lets large misses dominate, so MSE is the standard regression loss and is sensitive to outliers.
About · Quizzes · History of AI · To suggest new questions or report an error send me a dm.
MSE stands for mean squared error, the average of the squared differences between a model's predictions and the actual values: MSE = (1/n) Σ (yᵢ − ŷᵢ)². Lower is better, and 0 means every prediction is exact. It is the standard loss for regression, and fitting a linear regression means finding the line with the lowest MSE.
Example: a model predicts 11, 12, 13 and 24 for four houses that sold for 10, 12, 15 and 20 (in hundreds of thousands of dollars). The errors are −1, 0, 2 and −4, the squared errors 1, 0, 4 and 16, and MSE = 21 / 4 = 5.25. The one miss of 4 contributes 16 of the 21, more than three quarters of the total, although it is only 4 of the 7 units of absolute error. That is what squaring does: every error counts as positive, so over- and under-predictions don't cancel out, and each miss is weighed by its square, so missing by 10 costs 100 times as much as missing by 1. MSE is sensitive to outliers for the same reason.
Squaring is also what makes MSE convenient to optimize. It is smooth, and the gradient of each squared error is 2(ŷ − y), so gradient descent gets a push proportional to the size of the miss; for linear regression the minimum even has a closed form. It decides what a model learns to predict, too: the single number with the lowest MSE over a set of values is their mean, so a model trained on MSE predicts the conditional mean of the target, where one trained on absolute error predicts the median. And minimizing MSE gives the same answer as maximum likelihood when the errors are Gaussian noise with constant variance.
In statistics MSE also scores an estimator, and there it splits into two parts: MSE(θ̂) = bias(θ̂)² + Var(θ̂). For a model's predictions, the expected squared error on new data splits into squared bias, variance and irreducible noise, which is the bias-variance tradeoff in its most common form. It is why a slightly biased estimator such as ridge regression can have a lower MSE than an unbiased one: it gives up a little bias for a larger drop in variance.
On its own an MSE number is hard to read. It is in squared units (squared dollars, for a price model) and depends on the scale of the target, so there is no universal good value. Two comparisons make it meaningful. A model that always predicts the mean of the target has an MSE equal to the target's variance, so a useful model has to beat that, and R-squared is exactly this comparison: R² = 1 − MSE / Var(y). And the square root, RMSE, is back in the target's units: √5.25 ≈ 2.29 in the example, a typical miss of about $229,000. That is why people report RMSE even when the model was trained on MSE; both are minimized by the same predictions.
Two follow-ups come up in interviews. In a regression table, the mean squared error usually divides the sum of squared residuals by the degrees of freedom, n − p, where p counts the fitted coefficients including the intercept, rather than by n; that makes it an unbiased estimate of the noise variance σ². Machine learning libraries divide by n. And when outliers should count less, the alternatives are the mean absolute error (MAE), the Huber loss, which is squared for small errors and linear for large ones, or the squared error of log-transformed values (MSLE) when the target spans orders of magnitude and relative errors matter more than absolute ones.