Skip to contents

Get variable importance

Usage

get_varimp(x, ...)

Arguments

x

Supervised or SupervisedRes object.

...

Additional arguments passed to methods.

Value

VariableImportance object or list of VariableImportance objects.

Author

EDG

Examples

mod <- train(iris, hyperparameters = setup_LightRF())
#> 2026-08-09 13:22:34 
#> Checking data is ready for training...
#>  
#>
#> [check_supervised]
#> 2026-08-09 13:22:34 
#>
#>  [train]
#> 2026-08-09 13:22:34 
#> Training set: 150 cases x 4 features.
#>  [summarize_supervised]
#> 2026-08-09 13:22:34 
#> // Max workers: c(system = 7) { Algorithm: c(system = 7); Tuning: 1; Outer Resampling: 1 }
#>  [get_n_workers]
#> 2026-08-09 13:22:34 
#> Training LightRF Classification...
#>  [train]
#> 2026-08-09 13:22:34 
#> Checking data is ready for training...
#>  
#>
#> [check_supervised]
#> 2026-08-09 13:22:34 
#> Converting 1 factor to integer...
#>  [preprocess]
#> 2026-08-09 13:22:34 
#> Preprocessing done.
#>  [preprocess]
#> 
#> <Classification>
#> LightRF (LightGBM Random Forest)
#> 
#>   <Training Classification Metrics>
#>                      Predicted
#>           Reference  setosa  versicolor  virginica  
#>              setosa      50           0          0
#>          versicolor       1          44          5
#>           virginica       0           1         49
#> 
#>                      Overall  
#>   Balanced Accuracy  0.953  
#>                  F1  0.953  
#>            Accuracy  0.953  
#>                      Setosa  Versicolor  Virginica  
#>         Sensitivity  1.000   0.880       0.980    
#>         Specificity  0.990   0.990       0.950    
#>   Balanced Accuracy  0.995   0.935       0.965    
#>                 Ppv  0.980   0.978       0.907    
#>                 Npv  1.000   0.943       0.990    
#>                  F1  0.990   0.926       0.942    
#> 
#> 2026-08-09 13:22:35 
#> Done in 0.70 seconds.
#>  [train]
get_varimp(mod)
#> <VariableImportance>
#> 3 variable importance measures for 4 predictors