What is Mean Squared Error (MSE)?
Mean Squared Error (MSE) measures the average of the squared differences between a regression model's predictions and the actual target values.
It gives larger prediction errors more influence because every error is squared before averaging.
Formula
MSE = (1 / n) × Σ(yi - ŷi)²where:
yiis the actual valueŷiis the predicted valuenis the number of observations
Simple example
Suppose the actual values are:
10, 20, 30and the predictions are:
12, 18, 25The errors are:
-2, 2, 5After squaring:
4, 4, 25So:
MSE = (4 + 4 + 25) / 3 = 11Why square the errors?
Squaring has two important effects:
- positive and negative errors cannot cancel each other out
- large errors receive a much stronger penalty than small errors
For example:
Error = 2 → Squared error = 4
Error = 10 → Squared error = 100So a few large mistakes can increase MSE substantially.
When is MSE useful?
MSE is useful when large prediction errors are especially undesirable and should influence the evaluation more strongly.
It is also widely used as an optimization objective when training regression models because the squared-error function is mathematically convenient to optimize.
Is lower MSE better?
Yes.
MSE = 0means every prediction exactly matches the actual value.
A lower MSE generally means smaller prediction errors, but comparisons are most meaningful when models are evaluated on the same target and dataset.
MSE is not in the original target unit
Because the errors are squared, MSE is expressed in squared units.
For example, if the target is measured in rupees, MSE is measured in squared rupees.
This can make MSE harder to interpret directly than MAE.
Root Mean Squared Error (RMSE), covered next, takes the square root of MSE and returns the metric to the target's original unit.
In short, MSE measures average squared prediction error. It strongly penalizes large mistakes, making it useful when large errors matter, but its squared units make direct interpretation less intuitive.
Learning Sequence
Machine Learning Curriculum
Explore Related Questions
Deepen your understanding across related Machine Learning topics.