All courses › Machine Learning and Data Analysis › Mean squared error

Mean squared error

To know whether a regression model is good, we must measure how much it misses. The mean squared error is the average of the squared deviations between the true values and the model. Squaring makes large errors count extra heavily.

MSE=1n∑(yi−y^i)2\text{MSE} = \frac{1}{n}\sum (y_i - \hat y_i)^2mean squared error
RMSE=MSE\text{RMSE} = \sqrt{\text{MSE}}same unit as y

Symbols

yiy_itrue value
y^i\hat y_imodel prediction
nnnumber of points

Example

True values 3, 5, 7 and model 4, 5, 5:

MSE=(1+0+4)/3≈1.67\text{MSE} = (1 + 0 + 4)/3 \approx 1.67.

RMSE is easier to interpret, because it has the same unit as what you predict.
Practise data and core concepts for free →

← Normalization · Linear model →

Part of Machine Learning and Data Analysis: Data and core concepts.