This is a wrapper around the PipeOpDistrCompositor pipe operation, which simplifies graph creation.

distrcompositor(
  learner,
  estimator = c("kaplan", "nelson"),
  form = c("aft", "ph", "po"),
  overwrite = FALSE,
  param_vals = list()
)

Arguments

learner

LearnerSurv object for which a distr is composed (or over-written).

estimator

One of kaplan or nelson, corresponding to the Kaplan-Meier and Nelson-Aalen estimators respectively. Used to estimate the baseline survival distribution. Abbreviations allowed. Default is kaplan.

form

One of aft, ph, or po, corresponding to accelerated failure time, proportional hazards, and proportional odds respectively. Used to determine the form of the composed survival distribution. Default is aft.

overwrite

logical. If FALSE (default) then if the learner already has a distr, the compositor does nothing. If TRUE then the distr is overwritten by the compositor if already present, which may be required for changing the prediction distr from one model form to another.

param_vals

Additional parameters to pass to the learner.

Value

mlr3pipelines::GraphLearner

Details

For full details see PipeOpDistrCompositor.

Examples

if (FALSE) { library("mlr3") library("mlr3pipelines") task = tgen("simsurv")$generate(20) cvglm.distr = distrcompositor(learner = lrn("surv.cvglmnet"), estimator = "kaplan", form = "aft") resample(task, cvglm.distr, rsmp("cv", folds = 2))$predictions() }