Percent error is a common metric to use for measuring the accuracy of a prediction or estimation, and as the name suggests, it is provided in the form of a percentage.

But, can percent error be negative?

Yes percent error can be negative, but the accepted norm is to calculate percent error as an absolute value where it is always positive. For example -10% percent error would be written as the absolute value, 10%.

## Can percent error be negative?

Imagine an example where you have to estimate the height of people in your class, you end up with the following table comparing your estimations and the actual height:

Name Estimated height (cm) Actual height (cm)
Stephen 170 180
Jane 150 140
Manny 140 160
Nora 160 145

### Percent error definition

We can see that we didn’t get any guesses exactly correct, but we want to understand how incorrect we were, for this we can calculate the percent error.

The percent error is the absolute difference between the actual and the estimate (the error), divided by the actual.

### Calculating percent error

Let’s now calculate the percent error for our height example:

Name Estimated height (cm) Actual height (cm) Difference Absolute difference Percent error
Stephen 170 180 10 10 5.6%
Jane 150 140 -10 10 7.1%
Manny 140 160 20 20 12.5%
Nora 160 145 -15 15 10.3%

As you can see, percent error is always positive as we take the absolute difference between the estimate and the actual before we divide by the actual.

sklearn mean absolute percentage error user guide