mape
- typhon.retrieval.scores.mape(y_pred, y_test)[source]
The Mean Absolute Percentage Error (MAPE)
The MAPE is computed as the mean of the absolute value of the relative error in percent, i.e.:
\[\text{MAPE}(\mathbf{y}, \mathbf{y}_{true}) = \frac{100\%}{n}\sum_{i = 0}^n \frac{|y_{\text{pred},i} - y_{\text{true},i}|} {|y_{\text{true},i}|}\]- Parameters:
y_pred (numpy.array) – The predicted scalar values.
y_test (numpy.array) – The true values.
- Returns:
The MAPE for the given predictions.