RMSE
Root Mean Squared Error (RMSE) is a widely used metric in statistics and machine learning to evaluate the accuracy of a model’s predictions. It measures the average magnitude of the errors between predicted values and actual values, giving more weight to larger errors due to the squaring of differences.
# How to Calculate RMSE
Calculate the Errors: For each predicted value $(\hat{y}_i)$and actual value $({y}_i)$, compute the difference (error):
$ei=\hat{y}_i - y_i$
Square the Errors: Square each error to remove negative signs and give more weight to larger errors:
$e_i^2$
Calculate the Mean of Squared Errors: Find the average of these squared errors:
$\text{MSE} = \frac{1}{n} \sum_{i=1}^{n} e_i^2$
Take the Square Root: Finally, take the square root of the mean squared error:
$\text{RMSE} = \sqrt{\text{MSE}} = \sqrt{\frac{1}{n} \sum_{i=1}^{n} e_i^2}$
# Now in VEX
// point wrangle
|
|
Promote the attribute to detail using average mode and rename it to @mse
// detail wrangle
|
|
# What RMSE Tells Us
- Units: The RMSE is in the same units as whatever we’re predicting, making it easier to understand.
- Sensitivity: RMSE really pays attention to outliers; big errors can swing the RMSE value quite a bit.
- Comparison: A lower RMSE means our model is doing a better job. It’s often compared to other metrics, like Mean Absolute Error (MAE), to get a fuller picture of performance.
In short, RMSE is a handy way to summarize how accurate our predictions are, especially in regression tasks!
Here’s a list of other ways to measure error: Measuring Error
sources / further reading: