Extracts from an "EffectData" object a simple variable importance measure, namely
the (bin size weighted) variance of the partial dependence values, or of any other
calculated statistic (e.g., "pred_mean" or "y_mean"). It can be used via
update.EffectData(, sort_by = "pd")
to sort the variables in decreasing importance.
Note that this measure captures only the main effect strength.
If the importance is calculated with respect to "pd", it is closely related
to the suggestion of Greenwell et al. (2018).
effect_importance(x, by = NULL)
A named vector of importance values of the same length as x
.
Greenwell, Brandon M., Bradley C. Boehmke, and Andrew J. McCarthy. 2018. A Simple and Effective Model-Based Variable Importance Measure. arXiv preprint. https://arxiv.org/abs/1805.04755.
fit <- lm(Sepal.Length ~ ., data = iris)
M <- feature_effects(fit, v = colnames(iris)[-1], data = iris)
effect_importance(M)
#> Importance via weighted variance of 'pd'
#> Sepal.Width Petal.Length Petal.Width Species
#> 0.04579408 2.11662529 0.05714555 0.18456124