Skip to contents

Transform TaskRegr to TaskSurv.

Input and Output Channels

Input and output channels are inherited from PipeOpTaskTransformer.

The output is the input TaskRegr transformed to a TaskSurv.

State

The $state is a named list with the $state elements inherited from PipeOpTaskTransformer.

Parameters

The parameters are

  • status :: (numeric(1))
    If NULL then assumed no censoring in the dataset. Otherwise should be a vector of 0/1s of same length as the prediction object, where 1 is dead and 0 censored.

Methods

Inherited methods


Method new()

Creates a new instance of this R6 class.

Usage

PipeOpTaskRegrSurv$new(id = "trafotask_regrsurv")

Arguments

id

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


Method clone()

The objects of this class are cloneable with this method.

Usage

PipeOpTaskRegrSurv$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

if (FALSE) {
if (requireNamespace("mlr3pipelines", quietly = TRUE)) {
  library(mlr3)
  library(mlr3pipelines)

  task = tsk("boston_housing")
  po = po("trafotask_regrsurv")

  # assume no censoring
  new_task = po$train(list(task_regr = task, task_surv = NULL))[[1]]
  print(new_task)

  # add censoring
  task_surv = tsk("rats")
  task_regr = po("trafotask_survregr", method = "omit")$train(list(task_surv, NULL))[[1]]
  print(task_regr)
  new_task = po$train(list(task_regr = task_regr, task_surv = task_surv))[[1]]
  new_task$truth()
  task_surv$truth()
}
}