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")

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