mape

mape(y_true: List[Union[float, List[float]]], y_pred: List[Union[float, List[float]]], eps: float = 1e-15) float[source]

Mean absolute percentage error.

Wikipedia entry on the Mean absolute percentage error

Parameters
  • y_true (List[Union[float, List[float]]]) –

    array-like of shape (n_samples,) or (n_samples, n_outputs)

    Ground truth (correct) target values.

  • y_pred (List[Union[float, List[float]]]) –

    array-like of shape (n_samples,) or (n_samples, n_outputs)

    Estimated target values.

  • eps (float=1e-15) – MAPE is undefined for y_true[i]==0 for any i, so all zeros y_true[i] are clipped to max(eps, abs(y_true)).

Returns

A non-negative floating point value (the best value is 0.0).

Return type

float