as_prediction_dens: Convert to a Density Prediction

View source: R/as_prediction_dens.R

as_prediction_densR Documentation

Convert to a Density Prediction

Description

Convert object to a PredictionDens.

Usage

as_prediction_dens(x, ...)

## S3 method for class 'PredictionDens'
as_prediction_dens(x, ...)

## S3 method for class 'data.frame'
as_prediction_dens(x, ...)

Arguments

x

(any)
Object to convert.

...

(any)
Additional arguments.

Value

PredictionDens.

Examples

library(mlr3)
task = tsk("precip")
learner = lrn("dens.hist")
learner$train(task)
p = learner$predict(task)

# convert to a data.table
tab = as.data.table(p)

# convert back to a Prediction
as_prediction_dens(tab)

mlr3proba documentation built on April 25, 2022, 5:07 p.m.