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 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)
One ofsum_haz
(default),mean
,mode
, ormedian
; abbreviations allowed. Used to determine howcrank
is 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)
IfTRUE
then theresponse
predict type is also estimated with the same values ascrank
.- overwrite
logical(1)
IfTRUE
then existingresponse
andcrank
predict types are overwritten.- graph_learner
logical(1)
IfTRUE
returns 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)
}
}