importance | R Documentation |
Functions for calculating variable importance scores using Wilks' Lambda method. The package provides both generic S3 methods and direct function calls for importance analysis.
importance(object, ...)
## S3 method for class 'SCA'
importance(object, ...)
## S3 method for class 'SCE'
importance(object, OOB_weight = TRUE, ...)
Wilks_importance(model, OOB_weight = TRUE)
SCA_importance(model)
object |
An object for which importance scores should be calculated. |
model |
A trained model object:
|
OOB_weight |
Logical indicating whether to use out-of-bag weighting for importance calculation.
Default is TRUE. Only used for SCE objects and |
... |
Additional arguments passed to methods. |
Importance Calculation Method:
All functions use the Wilks' Lambda statistic to calculate variable importance:
Extract Wilks' Lambda values and split information from tree(s)
Replace negative Wilks' Lambda values with zero
Calculate raw importance for each split:
Importance = (left_samples + right_samples) / total_samples * (1 - Wilks' Lambda)
Aggregate importance scores by predictor
Normalize importance scores to sum to 1
Function Differences:
importance.SCA()
: S3 method for single SCA trees
importance.SCE()
: S3 method for SCE ensembles (calls Wilks_importance
)
Wilks_importance()
: Direct function for SCE ensembles with OOB weighting options
SCA_importance()
: Direct function for single SCA trees
OOB Weighting:
If OOB_weight = TRUE
: Importance scores are weighted by each tree's OOB performance
If OOB_weight = FALSE
: Importance scores are calculated using the median across trees
A data.frame containing:
Predictor
: Names of the predictors
Relative_Importance
: Normalized importance scores (sum to 1)
Kailong Li <lkl98509509@gmail.com>
Li, Kailong, Guohe Huang, and Brian Baetz. "Development of a Wilks feature importance method with improved variable rankings for supporting hydrological inference and modelling." Hydrology and Earth System Sciences 25.9 (2021): 4947-4966.
SCA
, SCE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.