Survival to Classification Reduction using IPCW Pipeline
Source:R/pipelines.R
mlr_graphs_survtoclassif_IPCW.Rd
Wrapper around PipeOpTaskSurvClassifIPCW and PipeOpPredClassifSurvIPCW to simplify Graph creation.
Arguments
- learner
LearnerClassif
Classification learner to fit the transformed TaskClassif.- tau
(
numeric()
)
Predefined time point for IPCW. Observations with time larger than \(\tau\) are censored. Must be less or equal to the maximum event time.- eps
(
numeric()
)
Small value to replace \(G(t) = 0\) censoring probabilities to prevent infinite weights (a warning is triggered if this happens).- 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:
PipeOpTaskSurvClassifIPCW Converts TaskSurv to a TaskClassif.
A LearnerClassif is fit and predicted on the new
TaskClassif
.PipeOpPredClassifSurvIPCW transforms the resulting PredictionClassif to PredictionSurv.
Dictionary
This Graph can be instantiated via the dictionary mlr_graphs or with the associated sugar function ppl():
Additional alias id for pipeline construction:
References
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.
Examples
if (FALSE) { # \dontrun{
library(mlr3)
library(mlr3learners)
library(mlr3pipelines)
task = tsk("lung")
part = partition(task)
grlrn = ppl(
"survtoclassif_IPCW",
learner = lrn("classif.rpart"),
tau = 500, # Observations after 500 days are censored
graph_learner = TRUE
)
grlrn$train(task, row_ids = part$train)
pred = grlrn$predict(task, row_ids = part$test)
pred # crank and distr at the cutoff time point included
# score predictions
pred$score() # C-index
pred$score(msr("surv.brier", times = 500, integrated = FALSE)) # Brier score at tau
} # }