How to find MAPE metric in Python?

python
mape

#1

Can anyone help me with a code to find out MAPE in python ?
I am beginner in python and i cannot find any inbuilt function for that.So can anyone help me with any code ?
I tried this link but its not working its giving an error
https://gist.github.com/amanahuja/6315882

@Lesaffrea @hinduja1234 @aayushmnit @Aarshay


#2

Posting the actual error message would help. Regardless, the code is missing an import statement at the beginning. Add the following line to the file: import numpy as np

And of course, you will need to have both scikit-learn and numpy installed for this to work. You can also write your own code since the metric is very simple: Mean absolute percentage error


#3

Adding to @caiotaniguchi, you could also refer here (It has sample implementations too)