Each of these metrics gives insight into how well a model’s predictions align with actual values, though they each handle errors in different ways.
<aside> 📢
$\text{Actual Value} = y_i$
$\text{Predicted Value} = \hat{y_p}$
$\text{Absolute (x)}= |x|$
$\text{Mean} = \bar{x} = \frac{1}{n} \sum_{i=1}^{n} x_i$
$\text{Sum} = \sum_{i=1}^{n} i$
</aside>
Formula:
$\text{MAE} = \frac{1}{n} \sum_{i=1}^{n} |y_i - \hat{y}_p|$
Description: MAE measures the average absolute difference between predicted (ŷ) and actual (y) values. It tells you, on average, how much the predictions differ from the actual values without regard to the direction of the errors.
Characteristics:
When to Use: When you want a straightforward average error metric, and outliers are not critical.
Best Score: 0
Interpretation: Lower values are better, with 0 indicating perfect predictions.
Good Score: Depends on the scale of the data. For example, if you’re predicting prices in the range of thousands, an MAE of a few hundred might be acceptable. Generally, a smaller MAE relative to the scale of the target variable is considered good.
Formula:
$\text{MSE} = \frac{1}{n} \sum_{i=1}^{n} (y_i - \hat{y}_p)^2$
Description: MSE measures the average of the squared differences between predicted and actual values. Squaring the errors penalizes larger deviations more than smaller ones.
Characteristics:
When to Use: If you want to give larger errors more weight, such as in applications where even small deviations are critical.
Best Score: 0
Interpretation: Lower values indicate better performance, with 0 meaning the model’s predictions are exactly accurate.
Good Score: Also depends on the scale of the data. Since MSE penalizes large errors more (due to squaring), an MSE that is relatively small compared to the square of the average target variable value is typically seen as good. But the interpretability is harder than MAE because the units are squared.
Formula:
$\text{RMSE} = \sqrt{\frac{1}{n} \sum_{i=1}^{n} (y_i - \hat{y}_p)^2}$
Description: RMSE is simply the square root of MSE, putting it back in the same unit as the target variable. It combines MSE’s sensitivity to large errors with better interpretability.
Characteristics:
When to Use: When you want a balance between penalizing large errors and interpretability in the original unit of the target variable.
Best Score: 0
Interpretation: Lower values indicate better performance, with 0 representing a perfect model.
Good Score: Like MAE, a good RMSE score is one that is low relative to the target variable’s scale. Because RMSE is sensitive to large errors, you want it to be comparable to or less than the standard deviation of the target variable. This indicates that the model is generally making predictions within a reasonable range of the actual values.
What constitutes a “good” score really depends on:
Rule of Thumb: