1

I am comparing a model's outcome with the actual values for a span of 9 months. I am expecting a very large error, however my MAPE implementation yields 1404512.56 using python, pandas.

Here is my implementation:

def mean_absolute_percentage_error(y_true, y_pred):
    y_true, y_pred = np.array(y_true), np.array(y_pred)
    return np.mean(np.abs((y_true - y_pred) / y_true)) * 100

There were instances in y_true (the actual values) where they were 0, but I have replaced them with 0.001 to avoid division by 0.

If anyone could provide a hint as to what MAPE means when it's that high, I'd appreciate it.

Ehrendil
  • 111
  • 2

0 Answers0