surv_model_info function

Extract additional information from the model

Extract additional information from the model

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 class 'coxph' surv_model_info(model, ...) ## S3 method for class 'rfsrc' surv_model_info(model, ...) ## S3 method for class 'ranger' surv_model_info(model, ...) ## S3 method for class 'model_fit' surv_model_info(model, ...) ## S3 method for class 'cph' surv_model_info(model, ...) ## S3 method for class 'LearnerSurv' surv_model_info(model, ...) ## S3 method for class 'sksurv' surv_model_info(model, ...) ## S3 method for class 'flexsurvreg' surv_model_info(model, ...) ## Default S3 method: surv_model_info(model, ...)

Arguments

  • model: * model object
  • ...: * other arguments

Returns

A named list of class model_info

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

library(survival) library(survex) cph <- survival::coxph(survival::Surv(time, status) ~ ., data = veteran, model = TRUE, x = TRUE, y = TRUE ) surv_model_info(cph) 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)
  • Maintainer: Mikołaj Spytek
  • License: GPL (>= 3)
  • Last published: 2023-10-24