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 aLearnerwhich will be wrapped in mlr3pipelines::PipeOpLearner, aPipeOpwhich will be wrapped in mlr3pipelines::Graph or aGraphitself. UnderlyingLearnershould be LearnerSurv.- method
(
character(1))
Determines what method should be used to produce a continuous ranking from the distribution. Currently onlymortis 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 acrankprediction, then the compositor returns the input prediction unchanged. IfTRUE, then thecrankwill be overwritten.- 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(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)
} # }