Measure to compare true observed response with predicted response in regression tasks.
Details
R Squared is 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}, $$ where \(\bar{t} = \sum_{i=1}^n t_i\).
Also known as coefficient of determination or explained variation.
Subtracts the mlr3measures::rse()
from 1, hence it compares the squared error of the predictions relative to a naive model predicting the mean.
This measure is undefined for constant \(t\).
Dictionary
This Measure can be instantiated via the dictionary mlr_measures or with the associated sugar function msr()
:
Meta Information
Task type: “regr”
Range: \((-\infty, 1]\)
Minimize: FALSE
Average: macro
Required Prediction: “response”
Required Packages: mlr3
See also
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-eval
Package mlr3measures for the scoring functions. Dictionary of Measures: mlr_measures
as.data.table(mlr_measures)
for a table of available Measures in the running session (depending on the loaded packages).Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
Other Measure:
Measure
,
MeasureClassif
,
MeasureRegr
,
MeasureSimilarity
,
mlr_measures
,
mlr_measures_aic
,
mlr_measures_bic
,
mlr_measures_classif.costs
,
mlr_measures_debug_classif
,
mlr_measures_elapsed_time
,
mlr_measures_internal_valid_score
,
mlr_measures_oob_error
,
mlr_measures_selected_features
Super classes
mlr3::Measure
-> mlr3::MeasureRegr
-> MeasureRSQ
Methods
Method new()
Creates a new instance of this R6 class.
Usage
MeasureRegrRSQ$new(pred_set_mean = TRUE)