Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

PredictionRegr

Prediction Object for Regression


Description

This object wraps the predictions returned by a learner of class LearnerRegr, i.e. the predicted response and standard error. Additionally, probability distributions implemented in distr6 are supported.

Super class

mlr3::Prediction -> PredictionRegr

Active bindings

response

(numeric())
Access the stored predicted response.

se

(numeric())
Access the stored standard error.

distr

(distr6::VectorDistribution)
Access the stored vector distribution. Requires package distr6.

Methods

Public 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,
  distr = NULL,
  check = TRUE
)
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.

distr

(distr6::VectorDistribution)
VectorDistribution from distr6. Each individual distribution in the vector represents the random variable 'survival time' for an individual observation.

check

(logical(1))
If TRUE, performs some argument checks and predict type conversions.

See Also

Other Prediction: PredictionClassif, Prediction

Examples

task = tsk("boston_housing")
learner = lrn("regr.featureless", predict_type = "se")
p = learner$train(task)$predict(task)
p$predict_types
head(as.data.table(p))

mlr3

Machine Learning in R - Next Generation

v0.11.0
LGPL-3
Authors
Michel Lang [cre, aut] (<https://orcid.org/0000-0001-9754-0393>), Bernd Bischl [aut] (<https://orcid.org/0000-0001-6002-6980>), Jakob Richter [aut] (<https://orcid.org/0000-0003-4481-5554>), Patrick Schratz [aut] (<https://orcid.org/0000-0003-0748-6624>), Giuseppe Casalicchio [ctb] (<https://orcid.org/0000-0001-5324-5966>), Stefan Coors [ctb] (<https://orcid.org/0000-0002-7465-2146>), Quay Au [ctb] (<https://orcid.org/0000-0002-5252-8902>), Martin Binder [aut], Marc Becker [ctb] (<https://orcid.org/0000-0002-8115-0400>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.