Regression measure defined as $$ 1 - \frac{\sum_{i=1}^n \left( t_i - r_i \right)^2}{\sum_{i=1}^n \left( t_i - \bar{t} \right)^2}. $$ Also known as coefficient of determination or explained variation. Substracts the rse() from 1, hence it compares the squared error of the predictions relative to a naive model predicting the mean.

Note

The score function calls mlr3measures::rsq() 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("rsq")
msr("rsq")

Meta Information

  • Type: "regr"

  • Range: \((-\infty, 1]\)

  • Minimize: FALSE

  • Required prediction: response

See also