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

Format

R6::R6Class object inheriting from Prediction.

Construction

p = PredictionRegr$new(row_ids, truth, response = NULL, se = NULL)
  • row_ids :: (integer() | character())
    Row ids of the observations in 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 error. One element for each observation in the test set.

Fields

All fields from Prediction, and additionally:

  • response :: numeric()
    Access to the stored predicted response.

  • se :: numeric()
    Access to the stored standard error.

The field task_type is set to "regr".

See also

Other Prediction: PredictionClassif, Prediction

Examples

task = mlr_tasks$get("boston_housing") learner = mlr_learners$get("regr.featureless") learner$predict_type = "se" e = Experiment$new(task, learner)$train()$predict() p = e$prediction 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