Unit content
Regression evaluation metrics
Regression metrics summarize how far numerical predictions are from their targets, but different metrics emphasize different kinds of error.
The mean squared error is
$$\operatorname{MSE}=\frac1n\sum_{i=1}^n (y_i-\hat y_i)^2.$$
Because errors are squared, large misses receive disproportionate weight. Its square root, RMSE, has the same units as the target.
The mean absolute error is
$$\operatorname{MAE}=\frac1n\sum_{i=1}^n |y_i-\hat y_i|,$$
which is less dominated by a few large residuals.
A scale-relative summary is the coefficient of determination
$$R^2=1-\frac{\sum_i(y_i-\hat y_i)^2}{\sum_i(y_i-\bar y)^2}.$$
On the same evaluation data, $R^2=1$ is perfect and $R^2=0$ matches the squared-error performance of always predicting the mean. It can be negative when the model is worse than that baseline.
No metric is universally best. Predicting delivery delay may care linearly about minutes of error, while a safety application may punish rare large errors much more strongly. The evaluation metric should reflect the consequence the prediction is meant to support.