We've seen how Mean Squared Error (MSE) quantifies the average squared difference between actual (y) and predicted (y^) values. While MSE effectively penalizes larger errors, its units are squared (e.g., dollars squared), which can sometimes make interpretation less intuitive.
To bring the error metric back into the original units of your target variable, we calculate the Root Mean Squared Error (RMSE). It's simply the square root of the Mean Squared Error.
The formula for RMSE follows directly from MSE:
RMSE=MSE=n1i=1∑n(yi−y^i)2Let's break this down:
The main benefit of RMSE is its interpretability. Because we take the square root, the RMSE is expressed in the same units as the original target variable (y).
Like MSE, RMSE gives disproportionately high weight to large errors because the errors are squared before being averaged. A model that produces even a few predictions with very large errors will have a significantly higher RMSE than a model with similar average error magnitude but fewer extreme errors.
Lower values of RMSE indicate a better fit of the model to the data. An RMSE of 0 means the model made perfect predictions for every observation in the dataset.
Let's use a small dataset of actual temperatures and predicted temperatures (in degrees Celsius):
Actual (yi) | Predicted (y^i) | Error (yi−y^i) | Squared Error ((yi−y^i)2) |
---|---|---|---|
22 | 23 | -1 | 1 |
25 | 24 | 1 | 1 |
19 | 21 | -2 | 4 |
28 | 26 | 2 | 4 |
Total | 10 |
The RMSE is approximately 1.58 degrees Celsius. This tells us that the model's temperature predictions are typically off by about 1.58 degrees Celsius.
It's helpful to compare RMSE with the other error metrics we've discussed:
Error metrics calculated for the temperature prediction example. MAE is 1.5°C, MSE is 2.5°C², and RMSE is approximately 1.58°C. Notice RMSE provides an error magnitude similar to MAE but incorporates the effect of squared errors.
Choosing between MAE and RMSE often depends on whether you want large errors to have a proportionally larger influence on the metric. If occasional large errors are acceptable, MAE might be suitable. If large errors are particularly problematic and should be heavily penalized, RMSE (or MSE) is often preferred. Because RMSE is in the original units, it's frequently chosen for reporting model performance in regression tasks.
© 2025 ApX Machine Learning