This object wraps the predictions returned by a learner of class LearnerRegr, i.e. the predicted response and standard error.

See also

Other Prediction: PredictionClassif, Prediction

Super class

mlr3::Prediction -> PredictionRegr

Active bindings

response

(numeric())
Access the stored predicted response.

se

(numeric())
Access the stored standard error.

missing

(integer())
Returns row_ids for which the predictions are missing or incomplete.

Methods

Public methods

Inherited methods

Method new()

Creates a new instance of this R6 class.

Usage

PredictionRegr$new(
  task = NULL,
  row_ids = task$row_ids,
  truth = task$truth(),
  response = NULL,
  se = NULL
)

Arguments

task

(TaskRegr)
Task, used to extract defaults for row_ids and truth.

row_ids

(integer())
Row ids of the predicted observations, i.e. the row ids of the test set.

truth

(numeric())
True (observed) response.

response

(numeric())
Vector of numeric response values. One element for each observation in the test set.

se

(numeric())
Numeric vector of predicted standard errors. One element for each observation in the test set.

Examples

task = tsk("boston_housing") learner = lrn("regr.featureless", predict_type = "se") p = learner$train(task)$predict(task) p$predict_types
#> [1] "response" "se"
#> row_id truth response se #> 1: 1 24.0 22.53281 9.197104 #> 2: 2 21.6 22.53281 9.197104 #> 3: 3 34.7 22.53281 9.197104 #> 4: 4 33.4 22.53281 9.197104 #> 5: 5 36.2 22.53281 9.197104 #> 6: 6 28.7 22.53281 9.197104