Transform PredictionRegr to PredictionSurv.
Input and Output Channels
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.
State
The $state
is a named list
with the $state
elements inherited from PipeOpPredTransformer
.
Parameters
The parameters are
status :: (numeric(1))
IfNULL
then assumed no censoring in the dataset. Otherwise should be a vector of0/1
s of same length as the prediction object, where1
is dead and0
censored.
See also
Other PipeOps:
PipeOpPredTransformer
,
PipeOpTaskTransformer
,
PipeOpTransformer
,
mlr_pipeops_survavg
,
mlr_pipeops_trafopred_classifsurv_disctime
,
mlr_pipeops_trafopred_survregr
,
mlr_pipeops_trafotask_regrsurv
,
mlr_pipeops_trafotask_survclassif_disctime
,
mlr_pipeops_trafotask_survregr
Other Transformation PipeOps:
mlr_pipeops_trafopred_classifsurv_disctime
,
mlr_pipeops_trafopred_survregr
,
mlr_pipeops_trafotask_regrsurv
,
mlr_pipeops_trafotask_survclassif_disctime
,
mlr_pipeops_trafotask_survregr
Super classes
mlr3pipelines::PipeOp
-> mlr3proba::PipeOpTransformer
-> mlr3proba::PipeOpPredTransformer
-> PipeOpPredRegrSurv
Methods
Method new()
Creates a new instance of this R6 class.
Usage
PipeOpPredRegrSurv$new(id = "trafopred_regrsurv", param_vals = list())
Arguments
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.
Examples
if (FALSE) { # \dontrun{
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())
}
} # }