Learn R Programming

mlr3proba (version 0.2.1)

PredictionDens: Prediction Object for Density

Description

This object stores the predictions returned by a learner of class LearnerDens.

The task_type is set to "dens".

Arguments

Super class

mlr3::Prediction -> PredictionDens

Active bindings

pdf

(numeric()) Access the stored predicted probability density function.

cdf

(numeric()) Access the stored predicted cumulative distribution function.

missing

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

Methods

Public methods

Method new()

Creates a new instance of this R6 class.

Usage

PredictionDens$new(
  task = NULL,
  row_ids = task$row_ids,
  truth = task$truth(),
  pdf = NULL,
  cdf = NULL
)

Arguments

task

(TaskSurv) 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.

pdf

(numeric()) Numeric vector of estimated probability density function, evaluated at 'target' column of test set. One element for each observation in the test set.

cdf

(numeric()) Numeric vector of estimated cumulative distribution function, evaluated at 'target' column of test set. One element for each observation in the test set.

Method clone()

The objects of this class are cloneable with this method.

Usage

PredictionDens$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

See Also

Other Prediction: PredictionSurv

Examples

Run this code
# NOT RUN {
library(mlr3)
task = mlr_tasks$get("precip")
learner = mlr_learners$get("dens.hist")
p = learner$train(task)$predict(task)
head(as.data.table(p))
# }

Run the code above in your browser using DataLab