Wrapper around PipeOpDistrCompositor or PipeOpBreslow to simplify Graph creation.
Usage
pipeline_distrcompositor(
learner,
estimator = "kaplan",
form = "aft",
overwrite = FALSE,
scale_lp = FALSE,
graph_learner = FALSE
)Arguments
- learner
[mlr3::Learner]|[mlr3pipelines::PipeOp]|[mlr3pipelines::Graph]
Either aLearnerwhich will be wrapped in mlr3pipelines::PipeOpLearner, aPipeOpwhich will be wrapped in mlr3pipelines::Graph or aGraphitself. UnderlyingLearnershould be LearnerSurv.- 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.- scale_lp
(
logical(1))
IfTRUEandformis"aft", the linear predictor scores are scaled before the composition. Experimental option, see more details on PipeOpDistrCompositor. Default isFALSE.- graph_learner
(
logical(1))
IfTRUEreturns wraps the Graph as a GraphLearner otherwise (default) returns as aGraph.
Dictionary
This Graph can be instantiated via the dictionary mlr_graphs or with the associated sugar function ppl():
Examples
if (FALSE) { # \dontrun{
library(mlr3pipelines)
# let's change the distribution prediction of Cox (Breslow-based) to an AFT form:
task = tsk("rats")
grlrn = ppl(
"distrcompositor",
learner = lrn("surv.coxph"),
estimator = "kaplan",
form = "aft",
overwrite = TRUE,
graph_learner = TRUE
)
grlrn$train(task)
grlrn$predict(task)
} # }