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 SCA
importance(object, ...)
# S3 method for SCE
importance(object, OOB_weight = TRUE, ...)
Wilks_importance(model, OOB_weight = TRUE)
SCA_importance(model)
A data.frame containing:
Predictor
: Names of the predictors
Relative_Importance
: Normalized importance scores (sum to 1)
An object for which importance scores should be calculated.
A trained model object:
For Wilks_importance
: SCE model object (S3 class "SCE") containing a list of SCA trees
For SCA_importance
: Single SCA tree object (S3 class "SCA")
Logical indicating whether to use out-of-bag weighting for importance calculation.
Default is TRUE. Only used for SCE objects and Wilks_importance
.
Additional arguments passed to methods.
Kailong Li <lkl98509509@gmail.com>
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
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