mlr_pipeops_compose_breslow_distr: Wrap a learner into a PipeOp with survival predictions...

mlr_pipeops_compose_breslow_distrR Documentation

Wrap a learner into a PipeOp with survival predictions estimated by the Breslow estimator

Description

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.

Super class

mlr3pipelines::PipeOp -> PipeOpBreslow

Active bindings

learner

(mlr3::Learner)
The input survival learner.

Methods

Public 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.

References

Breslow N (1972). “Discussion of 'Regression Models and Life-Tables' by D.R. Cox.” Journal of the Royal Statistical Society: Series B, 34(2), 216-217.

Lin, Y. D (2007). “On the Breslow estimator.” Lifetime Data Analysis, 13(4), 471-480. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/s10985-007-9048-y")}.

See Also

pipeline_distrcompositor

Other survival compositors: mlr_pipeops_crankcompose, mlr_pipeops_distrcompose, mlr_pipeops_responsecompose

Examples


## Not run: 
  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]]

## End(Not run)


mlr-org/mlr3proba documentation built on April 12, 2025, 4:38 p.m.