# Root Mean Squared Error (RMSE)

A type of metric. It is a value that tells us, on average, how close a set of predicted values is from the actual values. The smaller the RMSE, the better.

It is calculated by:

- First taking the difference between each respective predicted and actual value.
- Then the squaring all obtained values.
- Taking the average.
- And finally taking the square root.

Let’s say we have a set of predicted values \(1, 2, 3, 4\). The set of actual values is \(1, 4, 3, 3\)

- \(1-1, 2-4, 3-3, 4-3, = 0, -2, 0, 1\)
- \((0)^2, (-2)^2, (0)^2, (1)^2 = 0, 4, 0, 1\)
- \(\frac{0 + 4 + 0 + 1}{4} = \frac{5}{4} = 1.25\)
- \(\sqrt{1.25} \approx 1.12\)

This tells us, that on average, our set of predicted values is \(1.12\) units off from the actual values.

**In a nutshell, you take the root of the mean of the square of the differences between the predicted and actual values.**

The main difference between MSE and RMSE is that RMSE undoes the squaring step by taking the square root.