Wrapper around PipeOpCrankCompositor to simplify Graph creation.
Usage
pipeline_crankcompositor(
learner,
method = c("sum_haz", "mean", "median", "mode"),
which = NULL,
response = FALSE,
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)
One ofsum_haz(default),mean,mode, ormedian; abbreviations allowed. Used to determine howcrankis estimated from the predicteddistr.- which
integer(1)
Ifmethod = "mode"then specifies which mode to use if multi-modal, default is the first.- response
logical(1)
IfTRUEthen theresponsepredict type is also estimated with the same values ascrank.- overwrite
logical(1)
IfTRUEthen existingresponseandcrankpredict types are overwritten.- graph_learner
logical(1)
IfTRUEreturns wraps the Graph as a GraphLearner otherwise (default) returns as aGraph.
Examples
if (FALSE) {
if (requireNamespace("mlr3pipelines", quietly = TRUE)) {
library("mlr3")
library("mlr3pipelines")
task = tsk("rats")
pipe = ppl(
"crankcompositor",
learner = lrn("surv.coxph"),
method = "sum_haz"
)
pipe$train(task)
pipe$predict(task)
}
}