R: Convert to a Survival Prediction

as_prediction_surv {mlr3proba} | R Documentation

## Convert to a Survival Prediction

### Description

Convert object to a PredictionSurv.

### Usage

    as_prediction_surv(x, ...)

    ## S3 method for class 'PredictionSurv'
    as_prediction_surv(x, ...)

    ## S3 method for class 'data.frame'
    as_prediction_surv(x, ...)

### Arguments

`x` | (`any`) Object to convert.
`...` | (`any`) Additional arguments.

### Value

PredictionSurv.

### Examples

    library(mlr3)
    task = tsk("rats")
    learner = lrn("surv.coxph")
    learner$train(task)
    p = learner$predict(task)

    # convert to a data.table
    tab = as.data.table(p)

    # convert back to a Prediction
    as_prediction_surv(tab)

[Package mlr3proba version 0.4.2 Index]