Skip to contents

Wrapper around PipeOpTaskSurvClassifIPCW and PipeOpPredClassifSurvIPCW to simplify Graph creation.

Usage

pipeline_survtoclassif_IPCW(
  learner,
  tau = NULL,
  eps = 0.001,
  graph_learner = FALSE
)

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))
If TRUE returns wraps the Graph as a GraphLearner otherwise (default) returns as a Graph.

Details

The pipeline consists of the following steps:

  1. PipeOpTaskSurvClassifIPCW Converts TaskSurv to a TaskClassif.

  2. A LearnerClassif is fit and predicted on the new TaskClassif.

  3. 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():

mlr_graphs$get("survtoclassif_IPCW")
ppl("survtoclassif_IPCW")

Additional alias id for pipeline construction:

ppl("survtoclassif_vock")

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
} # }