R: Survival Prediction Averaging Pipeline

mlr_graphs_survbagging {mlr3proba} | R Documentation

## Survival Prediction Averaging Pipeline

### Description

Wrapper around PipeOpSubsample and PipeOpSurvAvg to simplify Graph creation.

### Usage

    pipeline_survbagging(
      learner,
      iterations = 10,
      frac = 0.7,
      avg = TRUE,
      weights = 1,
      graph_learner = FALSE
    )

### 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.
`iterations` | `integer(1)` Number of bagging iterations. Defaults to 10.
`frac` | `numeric(1)` Percentage of rows to keep during subsampling. See PipeOpSubsample for more information. Defaults to 0.7.
`avg` | `logical(1)` If `TRUE` (default) predictions are aggregated with PipeOpSurvAvg, otherwise returned as multiple predictions. Can only be `FALSE` if `graph_learner = FALSE`.
`weights` | `numeric()` Weights for model avering, ignored if `avg = FALSE`. Default is uniform weighting, see PipeOpSurvAvg.
`graph_learner` | `logical(1)` If `TRUE` returns wraps the Graph as a GraphLearner otherwise (default) returns as a `Graph`.

### Details

Bagging (Bootstrap AGGregatING) is the process of bootstrapping data and aggregating the final predictions. Bootstrapping splits the data into `B` smaller datasets of a given size and is performed with PipeOpSubsample. Aggregation is the sample mean of deterministic predictions and a MixtureDistribution of distribution predictions. This can be further enhanced by using a weighted average by supplying `weights`.

### Value

mlr3pipelines::Graph or mlr3pipelines::GraphLearner

mlr3pipelines::GraphLearner

### See Also

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

### Examples

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

    task = tsk("rats")
    pipe = ppl(
      "survbagging",
      learner = lrn("surv.coxph"),
      iterations = 5,
      graph_learner = FALSE
     )
    pipe$train(task)
    pipe$predict(task)
    }

    ## End(Not run)

[Package mlr3proba version 0.3.2 Index]