Skip to contents

Measure to compare true observed response with predicted response in regression tasks.

Details

The Mean Absolute Percent Error is defined as $$ \frac{1}{n} \sum_{i=1}^n w_i \left| \frac{ t_i - r_i}{t_i} \right|, $$ where \(w_i\) are normalized sample weights.

This measure is undefined if any element of \(t\) is \(0\).

Note

The score function calls mlr3measures::mape() from package mlr3measures.

If the measure is undefined for the input, NaN is returned. This can be customized by setting the field na_value.

Dictionary

This Measure can be instantiated via the dictionary mlr_measures or with the associated sugar function msr():

mlr_measures$get("regr.mape")
msr("regr.mape")

Parameters

Empty ParamSet

Meta Information

  • Type: "regr"

  • Range: \([0, \infty)\)

  • Minimize: TRUE

  • Required prediction: response