mlr_graphs_crankcompositor: Estimate Survival crank Predict Type Pipeline

mlr_graphs_crankcompositorR Documentation

Estimate Survival crank Predict Type Pipeline

Description

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
)

crankcompositor(...)

Arguments

learner

[mlr3::Learner]|[mlr3pipelines::PipeOp]|[mlr3pipelines::Graph]
Either a Learner which will be wrapped in mlr3pipelines::PipeOpLearner, a PipeOp which will be wrapped in mlr3pipelines::Graph or a Graph itself. Underlying Learner should be LearnerSurv.

method

character(1)
One of sum_haz (default), mean, mode, or median; abbreviations allowed. Used to determine how crank is estimated from the predicted distr.

which

integer(1)
If method = "mode" then specifies which mode to use if multi-modal, default is the first.

response

logical(1)
If TRUE then the response predict type is also estimated with the same values as crank.

overwrite

logical(1)
If TRUE then existing response and crank predict types are overwritten.

graph_learner

logical(1)
If TRUE returns wraps the Graph as a GraphLearner otherwise (default) returns as a Graph.

...

ANY
For use with crankcompositor, now deprecated.

Value

mlr3pipelines::Graph or mlr3pipelines::GraphLearner

See Also

Other pipelines: mlr_graphs_distrcompositor, mlr_graphs_probregrcompositor, mlr_graphs_survaverager, mlr_graphs_survbagging, mlr_graphs_survtoregr

Examples

## Not run: 
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)
}

## End(Not run)

mlr3proba documentation built on April 25, 2022, 5:07 p.m.