Closed VladMarianCimpeanu closed 1 year ago
I think there is an error in the implementation of the MAPE metric in the following notebooks:
It is defined as:
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 / len(y_true)
But I guess it should be (removed the division by the length of y):
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
Yes, you are right! Thank you for the correction, I have updated both notebooks.
I think there is an error in the implementation of the MAPE metric in the following notebooks:
It is defined as:
But I guess it should be (removed the division by the length of y):