| as_prediction_dens {mlr3proba} | R Documentation |
Convert object to a PredictionDens.
as_prediction_dens(x, ...) ## S3 method for class 'PredictionDens' as_prediction_dens(x, ...) ## S3 method for class 'data.frame' as_prediction_dens(x, ...)
x |
(any) |
... |
(any) |
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)