Skip to content

Commit

Permalink
Revert "Added MAPE metrics"
Browse files Browse the repository at this point in the history
This reverts commit 5bd0bd7.
  • Loading branch information
Marco De Nadai authored and Marco De Nadai committed Jul 26, 2014
1 parent 5bd0bd7 commit 12c8c46
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions Python/ml_metrics/elementwise.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,29 +66,6 @@ def mae(actual, predicted):
"""
return np.mean(ae(actual, predicted))

def mape(actual, predicted):
"""
Computes the mean absolute percentage error.
This function computes the mean absolute percentage error between two lists
of numbers.
BE CAREFUL: it can cause division-by-zero errors!
Parameters
----------
actual : list of numbers, numpy array
The ground truth value
predicted : same type as actual
The predicted value
Returns
-------
score : double
The mean absolute percentage error between actual and predicted
"""
return np.mean(np.abs(np.divide((np.array(actual) - np.array(predicted)), predicted))) * 100

def mse(actual, predicted):
"""
Computes the mean squared error.
Expand Down

0 comments on commit 12c8c46

Please sign in to comment.