diff --git a/doc/modules/model_evaluation.rst b/doc/modules/model_evaluation.rst index 2c4fcbeaf6bec..b161014f5268f 100644 --- a/doc/modules/model_evaluation.rst +++ b/doc/modules/model_evaluation.rst @@ -2489,11 +2489,11 @@ relative percentage error with respect to actual output. .. note:: - The MAPE formula here represents a relative error and outputs a value in the - range [0, 1]. It is not a percentage in the range [0, 100] and a value of 100 - does not mean 100% but 1e2. The motivation for the MAPE formula here to be in - the range [0, 1] is to be consistent with other error metrics in scikit-learn - such as `accuracy_score`. + The MAPE formula here does not represent the common "percentage" definition: the + percentage in the range [0, 100] is converted to a relative value in the range [0, + 1] by dividing by 100. Thus, an error of 200% corresponds to a relative error of 2. + The motivation here is to have a range of values that is more consistent with other + error metrics in scikit-learn, such as `accuracy_score`. To obtain the mean absolute percentage error as per the Wikipedia formula, multiply the `mean_absolute_percentage_error` computed here by 100. diff --git a/sklearn/metrics/_regression.py b/sklearn/metrics/_regression.py index a7137bfef7db8..a0da4f9ed19cd 100644 --- a/sklearn/metrics/_regression.py +++ b/sklearn/metrics/_regression.py @@ -330,12 +330,11 @@ def mean_absolute_percentage_error( ): """Mean absolute percentage error (MAPE) regression loss. - Note here that the output is not a percentage in the range [0, 100] - and a value of 100 does not mean 100% but 1e2. Furthermore, the output - can be arbitrarily high when `y_true` is small (which is specific to the - metric) or when `abs(y_true - y_pred)` is large (which is common for most - regression metrics). Read more in the - :ref:`User Guide `. + Note that we are not using the common "percentage" definition: the percentage + in the range [0, 100] is converted to a relative value in the range [0, 1] + by dividing by 100. Thus, an error of 200% corresponds to a relative error of 2. + + Read more in the :ref:`User Guide `. .. versionadded:: 0.24