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

model_info(model, is_multiclass = FALSE, ...)

# S3 method for lm
model_info(model, is_multiclass = FALSE, ...)

# S3 method for randomForest
model_info(model, is_multiclass = FALSE, ...)

# S3 method for svm
model_info(model, is_multiclass = FALSE, ...)

# S3 method for glm
model_info(model, is_multiclass = FALSE, ...)

# S3 method for lrm
model_info(model, is_multiclass = FALSE, ...)

# S3 method for glmnet
model_info(model, is_multiclass = FALSE, ...)

# S3 method for cv.glmnet
model_info(model, is_multiclass = FALSE, ...)

# S3 method for ranger
model_info(model, is_multiclass = FALSE, ...)

# S3 method for gbm
model_info(model, is_multiclass = FALSE, ...)

# S3 method for model_fit
model_info(model, is_multiclass = FALSE, ...)

# S3 method for train
model_info(model, is_multiclass = FALSE, ...)

# S3 method for rpart
model_info(model, is_multiclass = FALSE, ...)

# S3 method for default
model_info(model, is_multiclass = FALSE, ...)

Arguments

model

- model object

is_multiclass

- if TRUE and task is classification, then multitask classification is set. Else is omitted. If model_info was executed withing explain function. DALEX will recognize subtype on it's own.

...

- another arguments

Value

A named list of class model_info

Details

Currently supported packages are:

  • class cv.glmnet and glmnet - models created with glmnet package

  • class glm - generalized linear models

  • class lrm - models created with rms package,

  • class model_fit - models created with parsnip package

  • class lm - linear models created with stats::lm

  • class ranger - models created with ranger package

  • class randomForest - random forest models created with randomForest package

  • class svm - support vector machines models created with the e1071 package

  • class train - models created with caret package

  • class gbm - models created with gbm package

Examples

aps_lm_model4 <- lm(m2.price ~., data = apartments)
model_info(aps_lm_model4)
#> Package: stats 
#> Package version: 4.2.0 
#> Task type: regression

# \donttest{
library("ranger")
model_regr_rf <- ranger::ranger(status~., data = HR, num.trees = 50, probability = TRUE)
model_info(model_regr_rf, is_multiclass = TRUE)
#> Package: ranger 
#> Package version: 0.13.1 
#> Task type: multiclass
# }