Methods to calculate variable importance for different classifiers.
Usage
var_imp(mod, data, ...)
# Default S3 method
var_imp(mod, data, ...)
# S3 method for class 'randomForest'
var_imp(mod, data, ...)
# S3 method for class 'cv.glmnet'
var_imp(mod, data, ...)
# S3 method for class 'xgb.Booster'
var_imp(mod, data, ...)
# S3 method for class 'nnet'
var_imp(mod, data, ...)
# S3 method for class 'train'
var_imp(mod, data, ...)
# S3 method for class 'svm'
var_imp(mod, data, ...)
Arguments
- mod
model object from
classification()
- data
data frame with rows as samples, columns as features
- ...
additional arguments to be passed to or from methods
Details
Currently, variable importance methods are implemented for these classifiers:
"rf"
"xgboost",
"mlr_ridge", "mlr_lasso"
"svm"
"nnet"
Examples
data(hgsc)
class <- attr(hgsc, "class.true")
mod <- classification(hgsc, class, "xgboost")
var_imp(mod)
#> # A tibble: 91 × 2
#> Variable Importance
#> <chr> <dbl>
#> 1 VCAN 0.119
#> 2 CXCL10 0.109
#> 3 COL5A1 0.0935
#> 4 HLA-DPA1 0.0766
#> 5 MARCKS 0.0720
#> 6 ITGB2 0.0433
#> 7 LCN2 0.0239
#> 8 STEAP3 0.0231
#> 9 STMN1 0.0220
#> 10 CLU 0.0209
#> # ℹ 81 more rows