Uses a predicted distr in a PredictionSurv to estimate (or 'compose') a crank prediction.

## Format

R6Class inheriting from PipeOp.

## Parameters

• method :: character(1)
Determines what method should be used to produce a continuous ranking from the distribution. One of median, mode, or mean corresponding to the respective functions in the predicted survival distribution. Note that for models with a proportional hazards form, the ranking implied by mean and median will be identical (but not the value of crank itself). Default is mean.

## Internals

The median, mode, or mean will use analytical expressions if possible but if not they are calculated using distr6::median.Distribution, distr6::mode, or distr6::mean.Distribution respectively.

## Fields

Only fields inherited from PipeOp.

## Methods

Only methods inherited from PipeOp.

Other survival compositors: PipeOpDistrCompositor

## Examples

library(mlr3)
library(mlr3pipelines)
set.seed(1)

# Three methods to predict a crank from surv.rpart
task = tgen("simsurv")$generate(30) # Method 1 - Train and predict separately then compose learn = lrn("surv.coxph")$train(task)$predict(task) poc = po("crankcompose", param_vals = list(method = "mean")) poc$predict(list(learn))#> $output #> <PredictionSurv> for 30 observations: #> row_id time status crank distr lp #> 1 5.0000000 FALSE 1.4326828 <VectorDistribution> 0.01031299 #> 2 0.8433684 TRUE 1.6398177 <VectorDistribution> 0.26069368 #> 3 0.8070400 TRUE 1.0110342 <VectorDistribution> -0.50690465 #> --- #> 28 5.0000000 FALSE 1.3719301 <VectorDistribution> -0.06157584 #> 29 5.0000000 FALSE 0.8572003 <VectorDistribution> -0.72098848 #> 30 4.1997027 TRUE 1.6078754 <VectorDistribution> 0.22093276 #> # Examples not run to save run-time. if (FALSE) { # Method 2 - Create a graph manually gr = Graph$new()$add_pipeop(po("learner", lrn("surv.ranger")))$
add_pipeop(po("crankcompose"))$add_edge("surv.ranger", "crankcompose") gr$train(task)
gr$predict(task) # Method 3 - Syntactic sugar: Wrap the learner in a graph ranger.crank = crankcompositor(learner = lrn("surv.ranger"), method = "median") resample(task, ranger.crank, rsmp("cv", folds = 2))$predictions()
}