Learn R Programming

survex (version 1.2.0)

surv_model_info: Extract additional information from the model

Description

This generic function let user extract base information about model. The function returns a named list of class model_info that contain information about package of model, version and task type. For wrappers like mlr or parsnip both, package and wrapper information are stored

Usage

surv_model_info(model, ...)

# S3 method for coxph surv_model_info(model, ...)

# S3 method for rfsrc surv_model_info(model, ...)

# S3 method for ranger surv_model_info(model, ...)

# S3 method for model_fit surv_model_info(model, ...)

# S3 method for cph surv_model_info(model, ...)

# S3 method for LearnerSurv surv_model_info(model, ...)

# S3 method for sksurv surv_model_info(model, ...)

# S3 method for flexsurvreg surv_model_info(model, ...)

# S3 method for default surv_model_info(model, ...)

Value

A named list of class model_info

Arguments

model
  • model object

...
  • other arguments

Details

Currently supported packages are:

  • class coxph - Cox proportional hazards regression model created with survival package

  • class model_fit - models created with parsnip package

  • class ranger - random survival forest models created with ranger package

  • class rfsrc - random forest models created with randomForestSRC package

Examples

Run this code
library(survival)
library(survex)
cph <- survival::coxph(survival::Surv(time, status) ~ .,
    data = veteran,
    model = TRUE, x = TRUE, y = TRUE
)
surv_model_info(cph)

# \donttest{
library(ranger)
rsf_ranger <- ranger::ranger(survival::Surv(time, status) ~ .,
    data = veteran,
    num.trees = 50, mtry = 3, max.depth = 5
)
surv_model_info(rsf_ranger)
# }

Run the code above in your browser using DataLab