mlr_pipeops_compose_crank {mlr3proba}R Documentation

PipeOpCrankCompositor

Description

Uses a predicted distr in a PredictionSurv to estimate (or 'compose') a crank prediction.

Dictionary

This PipeOp can be instantiated via the dictionary mlr3pipelines::mlr_pipeops or with the associated sugar function mlr3pipelines::po():

PipeOpCrankCompositor$new()
mlr_pipeops$get("crankcompose")
po("crankcompose")

Input and Output Channels

PipeOpCrankCompositor has one input channel named "input", which takes NULL during training and PredictionSurv during prediction.

PipeOpCrankCompositor has one output channel named "output", producing NULL during training and a PredictionSurv during prediction.

The output during prediction is the PredictionSurv from the "pred" input but with the crank predict type overwritten by the given estimation method.

State

The $state is left empty (list()).

Parameters

Internals

The median, mode, or mean will use analytical expressions if possible but if not they are calculated using methods from distr6. mean requires cubature.

Super class

mlr3pipelines::PipeOp -> PipeOpCrankCompositor

Methods

Public methods

Inherited methods

Method new()

Creates a new instance of this R6 class.

Usage
PipeOpCrankCompositor$new(
  id = "compose_crank",
  param_vals = list(method = "mean", response = FALSE, overwrite = FALSE)
)
Arguments
id

(character(1))
Identifier of the resulting object.

param_vals

(list())
List of hyperparameter settings, overwriting the hyperparameter settings that would otherwise be set during construction.


Method clone()

The objects of this class are cloneable with this method.

Usage
PipeOpCrankCompositor$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

See Also

pipeline_crankcompositor

Other survival compositors: mlr_pipeops_compose_distr

Examples

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

  learn = lrn("surv.coxph")$train(task)$predict(task)
  poc = po("crankcompose", param_vals = list(method = "median"))
  poc$predict(list(learn))[[1]]

  if (requireNamespace("cubature", quietly = TRUE)) {
    learn = lrn("surv.coxph")$train(task)$predict(task)
    poc = po("crankcompose", param_vals = list(method = "mean"))
    poc$predict(list(learn))[[1]]
  }
}

## End(Not run)

[Package mlr3proba version 0.4.2 Index]