mlr_pipeops_trafotask_survregr {mlr3proba}R Documentation

PipeOpTaskSurvRegr

Description

Transform TaskSurv to TaskRegr.

Input and Output Channels

Input and output channels are inherited from PipeOpTaskTransformer.

The output is the input TaskSurv transformed to a TaskRegr.

State

The $state is a named list with the $state elements

Parameters

The parameters are

Super classes

mlr3pipelines::PipeOp -> mlr3proba::PipeOpTransformer -> mlr3proba::PipeOpTaskTransformer -> PipeOpTaskSurvRegr

Methods

Public methods

Inherited methods

Method new()

Creates a new instance of this R6 class.

Usage
PipeOpTaskSurvRegr$new(id = "trafotask_survregr", param_vals = list())
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
PipeOpTaskSurvRegr$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

References

Buckley, Jonathan, James, Ian (1979). “Linear Regression with Censored Data.” Biometrika, 66(3), 429–436. doi: 10.2307/2335161, https://www.jstor.org/stable/2335161.

Klein, P J, Moeschberger, L M (2003). Survival analysis: techniques for censored and truncated data, 2 edition. Springer Science & Business Media. ISBN 0387216456.

Vock, M D, Wolfson, Julian, Bandyopadhyay, Sunayan, Adomavicius, Gediminas, Johnson, E P, Vazquez-Benitez, Gabriela, O'Connor, J P (2016). “Adapting machine learning techniques to censored time-to-event health record data: A general-purpose approach using inverse probability of censoring weighting.” Journal of Biomedical Informatics, 61, 119–131. doi: 10.1016/j.jbi.2016.03.009, https://www.sciencedirect.com/science/article/pii/S1532046416000496.

See Also

Other PipeOps: PipeOpPredTransformer, PipeOpTaskTransformer, PipeOpTransformer, mlr_pipeops_survavg, mlr_pipeops_trafopred_regrsurv, mlr_pipeops_trafopred_survregr, mlr_pipeops_trafotask_regrsurv

Other Transformation PipeOps: mlr_pipeops_trafopred_regrsurv, mlr_pipeops_trafopred_survregr, mlr_pipeops_trafotask_regrsurv

Examples

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

  # these methods are generally only successful if censoring is not too high
  # create survival task by undersampling
  task = tsk("rats")$filter(
    c(which(tsk("rats")$truth()[, 2] == 1),
      sample(which(tsk("rats")$truth()[, 2] == 0), 42))
  )

  # deletion
  po = po("trafotask_survregr", method = "delete")
  po$train(list(task, NULL))[[1]] # 42 deleted

  # omission
  po = po("trafotask_survregr", method = "omit")
  po$train(list(task, NULL))[[1]]

  if (requireNamespace("mlr3extralearners", quietly = TRUE)) {
    # ipcw with Akritas
    po = po("trafotask_survregr", method = "ipcw", estimator = "akritas", lambda = 0.4, alpha = 0)
    new_task = po$train(list(task, NULL))[[1]]
    print(new_task)
    new_task$weights
  }

  # mrl with Kaplan-Meier
  po = po("trafotask_survregr", method = "mrl")
  new_task = po$train(list(task, NULL))[[1]]
  data.frame(new = new_task$truth(), old = task$truth())

  # Buckley-James imputation
  if (requireNamespace("bujar", quietly = TRUE)) {
    po = po("trafotask_survregr", method = "bj")
    new_task = po$train(list(task, NULL))[[1]]
    data.frame(new = new_task$truth(), old = task$truth())
  }

  # reorder - in practice this will be only be used in a few graphs
  po = po("trafotask_survregr", method = "reorder", features = c("sex", "rx", "time", "status"),
    target = "litter")
  new_task = po$train(list(task, NULL))[[1]]
  print(new_task)

  # reorder using another task for feature names
  po = po("trafotask_survregr", method = "reorder", target = "litter")
  new_task = po$train(list(task, task))[[1]]
  print(new_task)
}

## End(Not run)

[Package mlr3proba version 0.4.2 Index]