Wrapper around PipeOpDistrCompositor or PipeOpBreslow to simplify Graph creation.
Usage
pipeline_distrcompositor(
learner,
estimator = "kaplan",
form = "aft",
overwrite = FALSE,
graph_learner = FALSE
)Arguments
- learner
LearnerSurv
Survival learner.- estimator
character(1)
One ofkaplan(default),nelsonorbreslow, corresponding to the Kaplan-Meier, Nelson-Aalen and Breslow estimators respectively. Used to estimate the baseline survival distribution.- form
character(1)
One ofaft(default),ph, orpo, corresponding to accelerated failure time, proportional hazards, and proportional odds respectively. Used to determine the form of the composed survival distribution. Ignored if estimator isbreslow.- overwrite
logical(1)
IfFALSE(default) then if thelearneralready has adistr, the compositor does nothing. IfTRUEthen thedistris overwritten by the compositor if already present, which may be required for changing the predictiondistrfrom one model form to another.- graph_learner
logical(1)
IfTRUEreturns wraps the Graph as a GraphLearner otherwise (default) returns as aGraph.
Examples
if (FALSE) {
if (requireNamespace("mlr3pipelines", quietly = TRUE) &&
requireNamespace("rpart", quietly = TRUE)) {
library("mlr3")
library("mlr3pipelines")
task = tsk("rats")
pipe = ppl(
"distrcompositor",
learner = lrn("surv.rpart"),
estimator = "kaplan",
form = "ph"
)
pipe$train(task)
pipe$predict(task)
}
}