# Survival to Classification Reduction Pipeline

Source:`R/pipelines.R`

`mlr_graphs_survtoclassif_disctime.Rd`

Wrapper around multiple PipeOps to help in creation of complex survival reduction methods.

## Usage

```
pipeline_survtoclassif_disctime(
learner,
cut = NULL,
max_time = NULL,
rhs = NULL,
graph_learner = FALSE
)
```

## Arguments

- learner
LearnerClassif

Classification learner to fit the transformed TaskClassif.`learner`

must have`predict_type`

of type`"prob"`

.- cut
`numeric()`

Split points, used to partition the data into intervals. If unspecified, all unique event times will be used. If`cut`

is a single integer, it will be interpreted as the number of equidistant intervals from 0 until the maximum event time.- max_time
`numeric(1)`

If cut is unspecified, this will be the last possible event time. All event times after max_time will be administratively censored at max_time.- rhs
`character(1)`

Right-hand side of the formula to with the learner. All features of the task are available as well as`tend`

the upper bounds of the intervals created by`cut`

. If rhs is unspecified, the formula of the task will be used.- graph_learner
`logical(1)`

If`TRUE`

returns wraps the Graph as a GraphLearner otherwise (default) returns as a`Graph`

.

## Details

The pipeline consists of the following steps:

PipeOpTaskSurvClassifDiscTime Converts TaskSurv to a TaskClassif.

A LearnerClassif is fit and predicted on the new

`TaskClassif`

.PipeOpPredClassifSurvDiscTime transforms the resulting PredictionClassif to PredictionSurv.

Optionally: PipeOpModelMatrix is used to transform the formula of the task before fitting the learner.

## Examples

```
if (FALSE) { # \dontrun{
if (requireNamespace("mlr3pipelines", quietly = TRUE) &&
requireNamespace("mlr3learners", quietly = TRUE)) {
library(mlr3)
library(mlr3learners)
library(mlr3pipelines)
task = tsk("lung")
part = partition(task)
grlrn = ppl(
"survtoclassif_disctime",
learner = lrn("classif.log_reg"),
cut = 4, # 4 equidistant time intervals
graph_learner = TRUE
)
grlrn$train(task, row_ids = part$train)
grlrn$predict(task, row_ids = part$test)
}
} # }
```