Mean Absolute Error (MAE)
It is calculated by: 1. First taking the difference between each respective predicted and actual value. 1. Then removing all negative signs — this is known as taking the absolute value. 1. And finally taking the average.
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|, |0|, |1| = 0, 2, 0, 1\)
- \(\frac{0 + 2 + 0 + 1}{4} = \frac{2}{4} = 0.5\)
This tells us, that on average, our set of predicted values is \(0.5\) units off from the actual values.
In a nutshell, you take the mean of the absolute differences between the predicted and actual values.
The main difference between MAE and MSE is that MSE penalizes smaller differences more heavily.
The reason the absolute value is taken is due to the averaging step. Let’s say the first predicted value is off from the first actual value by \(-3\) units. And let’s say that the second predicted value is off from the second actual value by \(3\) units.
If we didn’t take the absolute value, the average would be zero \(\left( \frac{-3 + 3}{2} = \frac{0}{2} = 0 \right)\). This is incorrect as both values are off from the actual value.