Skip to contents

Composes a survival distribution (distr) using the linear predictor predictions (lp) from a given LearnerSurv during training and prediction, utilizing the breslow estimator. The specified learner must be capable of generating lp-type predictions (e.g., a Cox-type model).

Dictionary

This PipeOp can be instantiated via the Dictionary mlr_pipeops or with the associated sugar function po():

PipeOpBreslow$new(learner)
mlr_pipeops$get("breslowcompose", learner)
po("breslowcompose", learner, breslow.overwrite = TRUE)

Input and Output Channels

PipeOpBreslow is like a LearnerSurv. It has one input channel, named input that takes a TaskSurv during training and another TaskSurv during prediction. PipeOpBreslow has one output channel named output, producing NULL during training and a PredictionSurv during prediction.

State

The $state slot stores the times and status survival target variables of the train TaskSurv as well as the lp predictions on the train set.

Parameters

The parameters are:

  • breslow.overwrite :: logical(1)
    If FALSE (default) then the compositor does nothing and returns the input learner's PredictionSurv. If TRUE or in the case that the input learner doesn't have distr predictions, then the distr is overwritten with the distr composed from lp and the train set information using breslow. This is useful for changing the prediction distr from one model form to another.

References

Cox DR (1972). “Regression Models and Life-Tables.” Journal of the Royal Statistical Society: Series B (Methodological), 34(2), 187–202. doi:10.1111/j.2517-6161.1972.tb00899.x .

Lin, Y. D (2007). “On the Breslow estimator.” Lifetime Data Analysis, 13(4), 471-480. doi:10.1007/s10985-007-9048-y .

Super class

mlr3pipelines::PipeOp -> PipeOpBreslow

Active bindings

learner

(mlr3::Learner)
The input survival learner.

Methods

Inherited methods


Method new()

Creates a new instance of this R6 class.

Usage

PipeOpBreslow$new(learner, id = NULL, param_vals = list())

Arguments

learner

(LearnerSurv)
Survival learner which must provide lp-type predictions

id

(character(1))
Identifier of the resulting object. If NULL (default), it will be set as the id of the input learner.

param_vals

(list())
List of hyperparameter settings, overwriting the hyperparameter settings that would otherwise be set during construction.


Method clone()

The objects of this class are cloneable with this method.

Usage

PipeOpBreslow$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

if (FALSE) { # \dontrun{
  library(mlr3)
  library(mlr3pipelines)
  task = tsk("rats")
  part = partition(task, ratio = 0.8)
  train_task = task$clone()$filter(part$train)
  test_task = task$clone()$filter(part$test)

  learner = lrn("surv.coxph") # learner with lp predictions
  b = po("breslowcompose", learner = learner, breslow.overwrite = TRUE)

  b$train(list(train_task))
  p = b$predict(list(test_task))[[1L]]
} # }