R: Estimate Survival distr Predict Type Pipeline

mlr_graphs_distrcompositor {mlr3proba} | R Documentation

## Estimate Survival distr Predict Type Pipeline

### Description

Wrapper around PipeOpDistrCompositor to simplify Graph creation.

### Usage

    pipeline_distrcompositor(
      learner,
      estimator = c("kaplan", "nelson"),
      form = c("aft", "ph", "po"),
      overwrite = FALSE,
      graph_learner = FALSE
    )

    distrcompositor(...)

### 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.
`estimator` | `character(1)` One of `kaplan` (default) or `nelson`, corresponding to the Kaplan-Meier and Nelson-Aalen estimators respectively. Used to estimate the baseline survival distribution.
`form` | `character(1)` One of `aft` (default), `ph`, or `po`, corresponding to accelerated failure time, proportional hazards, and proportional odds respectively. Used to determine the form of the composed survival distribution.
`overwrite` | `logical(1)` If `FALSE` (default) then if the `learner` already has a `distr`, the compositor does nothing. If `TRUE` then the `distr` is overwritten by the compositor if already present, which may be required for changing the prediction `distr` from one model form to another.
`graph_learner` | `logical(1)` If `TRUE` returns wraps the Graph as a GraphLearner otherwise (default) returns as a `Graph`.
`...` | `ANY` For use with `distrcompositor`, now deprecated.

### Value

mlr3pipelines::Graph or mlr3pipelines::GraphLearner

### See Also

Other pipelines: `mlr_graphs_crankcompositor`, `mlr_graphs_probregrcompositor`, `mlr_graphs_survaverager`, `mlr_graphs_survbagging`, `mlr_graphs_survtoregr`

### Examples

    ## Not run:
    if (requireNamespace("mlr3pipelines", quietly = TRUE) &&
      requireNamespace("rpart", quietly = TRUE)) {
      library("mlr3")
      library("mlr3pipelines")

      task = tsk("rats")
      pipe = ppl(
        "distrcompositor",
        learner = lrn("surv.rpart"),
        estimator = "kaplan",
        form = "ph"
      )
      pipe$train(task)
      pipe$predict(task)
    }

    ## End(Not run)

[Package mlr3proba version 0.4.3 Index]