mlr_pipeops_compose_breslow_distr | R Documentation |
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).
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)
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.
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.
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.
mlr3pipelines::PipeOp
-> PipeOpBreslow
learner
(mlr3::Learner)
The input survival learner.
new()
Creates a new instance of this R6 class.
PipeOpBreslow$new(learner, id = NULL, param_vals = list())
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.
clone()
The objects of this class are cloneable with this method.
PipeOpBreslow$clone(deep = FALSE)
deep
Whether to make a deep clone.
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")}.
pipeline_distrcompositor
Other survival compositors:
mlr_pipeops_crankcompose
,
mlr_pipeops_distrcompose
,
mlr_pipeops_responsecompose
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.