Learn R Programming

mlr3proba (version 0.2.1)

mlr_pipeops_trafotask_regrsurv: PipeOpTaskRegrSurv

Description

Transform TaskRegr to TaskSurv.

Arguments

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

Public 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.

See Also

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

Other Transformation PipeOps: mlr_pipeops_trafopred_regrsurv, mlr_pipeops_trafopred_survregr, mlr_pipeops_trafotask_survregr

Examples

Run this code
# NOT RUN {
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()
# }

Run the code above in your browser using DataLab