Wrap a learner into a PipeOp with survival predictions estimated by the Breslow estimator
Source:R/PipeOpBreslow.R
mlr_pipeops_compose_breslow_distr.RdComposes 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():
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)
IfFALSE(default) then the compositor does nothing and returns the inputlearner's PredictionSurv. IfTRUEor in the case that the inputlearnerdoesn't havedistrpredictions, then thedistris overwritten with thedistrcomposed fromlpand the train set information using breslow. This is useful for changing the predictiondistrfrom one model form to another.
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. doi:10.1007/s10985-007-9048-y .
See also
Other survival compositors:
mlr_pipeops_crankcompose,
mlr_pipeops_distrcompose,
mlr_pipeops_responsecompose
Super class
mlr3pipelines::PipeOp -> PipeOpBreslow
Active bindings
learner(mlr3::Learner)
The input survival learner.
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 providelp-type predictionsid(character(1))
Identifier of the resulting object. IfNULL(default), it will be set as theidof the inputlearner.param_vals(
list())
List of hyperparameter settings, overwriting the hyperparameter settings that would otherwise be set during construction.
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]]
} # }