Survival to Classification Reduction using Discrete Time Pipeline
Source:R/pipelines.R
mlr_graphs_survtoclassif_disctime.Rd
Wrapper around PipeOpTaskSurvClassifDiscTime and PipeOpPredClassifSurvDiscTime to simplify Graph creation.
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 havepredict_type
of type"prob"
.- cut
(
numeric()
)
Split points, used to partition the data into intervals. If unspecified, all unique event times will be used. Ifcut
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 use with the learner. All features of the task are available as well astend
the upper bounds of the intervals created bycut
. Ifrhs
is unspecified, the formula of the task will be used.- graph_learner
(
logical(1)
)
IfTRUE
returns wraps the Graph as a GraphLearner otherwise (default) returns as aGraph
.
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.
Dictionary
This Graph can be instantiated via the dictionary mlr_graphs or with the associated sugar function ppl():
References
Tutz, Gerhard, Schmid, Matthias (2016). Modeling Discrete Time-to-Event Data, series Springer Series in Statistics. Springer International Publishing. ISBN 978-3-319-28156-8 978-3-319-28158-2, http://link.springer.com/10.1007/978-3-319-28158-2.
Examples
if (FALSE) { # \dontrun{
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)
} # }