PredictionSurv: Prediction Object for Survival

Description Format Construction Fields Examples

Description

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

The task_type is set to "surv".

Format

R6::R6Class object inheriting from mlr3::Prediction.

Construction

1
2
p = PredictionSurv$new(task = NULL, row_ids = task$row_ids,
  truth = task$truth(), risk = NULL)

Fields

See mlr3::Prediction.

The field task_type is set to "surv".

Examples

1
2
3
4
5
library(mlr3)
task = mlr_tasks$get("lung")
learner = mlr_learners$get("surv.rpart")
p = learner$train(task)$predict(task)
head(as.data.table(p))

mlr-org/mlr3survival documentation built on Oct. 21, 2019, 7:42 p.m.