mlr_pipeops_trafopred_regrsurv | R Documentation |
Transform PredictionRegr to PredictionSurv.
Input and output channels are inherited from PipeOpPredTransformer.
The output is the input PredictionRegr transformed to a PredictionSurv. Censoring can be
added with the status
hyper-parameter. se
is ignored.
The $state
is a named list
with the $state
elements inherited from PipeOpPredTransformer
.
The parameters are
status :: (numeric(1))
If NULL
then assumed no censoring in the dataset. Otherwise should be a vector of 0/1
s
of same length as the prediction object, where 1
is dead and 0
censored.
mlr3pipelines::PipeOp
-> mlr3proba::PipeOpTransformer
-> mlr3proba::PipeOpPredTransformer
-> PipeOpPredRegrSurv
new()
Creates a new instance of this R6 class.
PipeOpPredRegrSurv$new(id = "trafopred_regrsurv", param_vals = list())
id
(character(1)
)
Identifier of the resulting object.
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.
PipeOpPredRegrSurv$clone(deep = FALSE)
deep
Whether to make a deep clone.
Other PipeOps:
PipeOpPredTransformer
,
PipeOpTaskTransformer
,
PipeOpTransformer
,
mlr_pipeops_survavg
,
mlr_pipeops_trafopred_survregr
,
mlr_pipeops_trafotask_regrsurv
,
mlr_pipeops_trafotask_survregr
Other Transformation PipeOps:
mlr_pipeops_trafopred_survregr
,
mlr_pipeops_trafotask_regrsurv
,
mlr_pipeops_trafotask_survregr
## Not run: if (requireNamespace("mlr3pipelines", quietly = TRUE)) { library(mlr3) library(mlr3pipelines) # simple example pred = PredictionRegr$new(row_ids = 1:10, truth = 1:10, response = 1:10) po = po("trafopred_regrsurv") # assume no censoring new_pred = po$predict(list(pred = pred, task = NULL))[[1]] po$train(list(NULL, NULL)) print(new_pred) # add censoring task_surv = tsk("rats") task_regr = po("trafotask_survregr", method = "omit")$train(list(task_surv, NULL))[[1]] learn = lrn("regr.featureless") pred = learn$train(task_regr)$predict(task_regr) po = po("trafopred_regrsurv") new_pred = po$predict(list(pred = pred, task = task_surv))[[1]] all.equal(new_pred$truth, task_surv$truth()) } ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.