Mean Squared Error (MSE) and Root Mean Squared Error (RMSE)

Maricel A. Gueco 1 Reputation point
2024-03-27T04:04:13.4233333+00:00

What is the difference between the Mean Squared Error (MSE) and the Root Mean Squared Error (RMSE)?

How can you manually calculate this two?

Community Center | Not monitored
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Adharsh Santhanam 6,020 Reputation points Volunteer Moderator
    2024-03-27T05:21:11.17+00:00

    Let's try to understand both of these metrics.

    1. Mean Squared Error (MSE): The MSE measures the average squared difference between the actual values and the predicted values. It is calculated by taking the mean of the squared differences between each actual value and its corresponding predicted value. Mathematically, the MSE is given by: User's image where: (n) is the number of data points. (y_i) represents the actual value. (\hat{y}_i) represents the predicted value.
    2. Root Mean Squared Error (RMSE): The RMSE is the square root of the MSE. It provides a measure of the average absolute error between the actual and predicted values. Mathematically, the RMSE is given by: User's image

    Now, let’s calculate these metrics manually using an example dataset:

    Suppose we have the following actual and predicted values:

    • Actual values: [10, 15, 20, 25, 30]
    • Predicted values: [12, 18, 22, 24, 28]
    1. Calculate MSE: MSE = (1/5) * [(10-12)^2 + (15-18)^2 + (20-22)^2 + (25-24)^2 + (30-28)^2]) = 4.40
    2. Calculate RMSE: RMSE = sqrt(4.40) = 2.10

    So, the MSE is 4.40, and the RMSE is 2.10 for this example dataset.

    Remember that both MSE and RMSE provide insights into how well a regression model performs, with lower values indicating better performance. RMSE is often preferred because it is in the same unit as the original data, making it more interpretable.

    Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.