Wrapper around PipeOpCrankCompositor to simplify Graph creation.
Usage
pipeline_crankcompositor(
learner,
method = c("mort"),
overwrite = FALSE,
graph_learner = FALSE
)
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.- method
(
character(1)
)
Determines what method should be used to produce a continuous ranking from the distribution. Currently onlymort
is supported, which is the sum of the cumulative hazard, also called expected/ensemble mortality, see Ishwaran et al. (2008). For more details, seeget_mortality()
.- overwrite
(
logical(1)
)
IfFALSE
(default) and the prediction already has acrank
prediction, then the compositor returns the input prediction unchanged. IfTRUE
, then thecrank
will be overwritten.- graph_learner
(
logical(1)
)
IfTRUE
returns 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(mlr3)
library(mlr3pipelines)
task = tsk("lung")
part = partition(task)
# change the crank prediction type of a Cox's model predictions
grlrn = ppl(
"crankcompositor",
learner = lrn("surv.coxph"),
method = "mort",
overwrite = TRUE,
graph_learner = TRUE
)
grlrn$train(task, part$train)
grlrn$predict(task, part$test)
} # }