Wrapper around PipeOpDistrCompositor to simplify Graph creation.
Arguments
- learner
[mlr3::Learner]|[mlr3pipelines::PipeOp]|[mlr3pipelines::Graph]
Either aLearner
which will be wrapped in mlr3pipelines::PipeOpLearner, aPipeOp
which will be wrapped in mlr3pipelines::Graph or aGraph
itself. UnderlyingLearner
should be LearnerSurv.- estimator
character(1)
One ofkaplan
(default) ornelson
, corresponding to the Kaplan-Meier and Nelson-Aalen 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.- overwrite
logical(1)
IfFALSE
(default) then if thelearner
already has adistr
, the compositor does nothing. IfTRUE
then thedistr
is overwritten by the compositor if already present, which may be required for changing the predictiondistr
from one model form to another.- graph_learner
logical(1)
IfTRUE
returns wraps the Graph as a GraphLearner otherwise (default) returns as aGraph
.- ...
ANY
For use withdistrcompositor
, now deprecated.
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)
}
}