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
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, ...)
model object
other arguments
A named list of class model_info
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
library(survival)
library(survex)
cph <- survival::coxph(survival::Surv(time, status) ~ .,
data = veteran,
model = TRUE, x = TRUE, y = TRUE
)
surv_model_info(cph)
#> Package: survival
#> Package version: 3.7.0
#> Task type: survival
# \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)
#> Package: ranger
#> Package version: 0.16.0
#> Task type: survival
# }