This file implements methods for variable importance generics from NeuralNetTools and vip packages.
Arguments
- mod_in
A fitted model object of class "ffnn_fit".
- bar_plot
Logical. Whether to plot variable importance (default TRUE).
- ...
Additional arguments passed to methods.
- object
A fitted model object of class "ffnn_fit".
- type
Type of algorithm to extract the variable importance. This must be one of the strings:
'olden'
'garson'
Value
A data frame with variable importance scores.
A tibble with columns "Variable" and "Importance"
(via vip::vi() / vip::vi_model() only).
Garson's Algorithm for FFNN Models
{kindling} inherits NeuralNetTools::garson to extract the variable
importance from the fitted ffnn() model.
Olden's Algorithm for FFNN Models
{kindling} inherits NeuralNetTools::olden to extract the variable
importance from the fitted ffnn() model.
Variable Importance via {vip} Package
You can directly use vip::vi() and vip::vi_model() to extract the variable
importance from the fitted ffnn() model.
References
Beck, M.W. 2018. NeuralNetTools: Visualization and Analysis Tools for Neural Networks. Journal of Statistical Software. 85(11):1-20.
Garson, G.D. 1991. Interpreting neural network connection weights. Artificial Intelligence Expert. 6(4):46-51.
Goh, A.T.C. 1995. Back-propagation neural networks for modeling complex systems. Artificial Intelligence in Engineering. 9(3):143-151.
Olden, J.D., Jackson, D.A. 2002. Illuminating the 'black-box': a randomization approach for understanding variable contributions in artificial neural networks. Ecological Modelling. 154:135-150.
Olden, J.D., Joy, M.K., Death, R.G. 2004. An accurate comparison of methods for quantifying variable importance in artificial neural networks using simulated data. Ecological Modelling. 178:389-397.
Examples
# Directly use `NeuralNetTools::garson`
model_mlp = ffnn(
Species ~ .,
data = iris,
hidden_neurons = c(64, 32),
activations = "relu",
epochs = 100,
verbose = FALSE,
cache_weights = TRUE
)
model_mlp |>
garson()
#> x_names y_names rel_imp
#> 1 Sepal.Width Species 26.78129
#> 2 Petal.Width Species 25.78785
#> 3 Petal.Length Species 25.04967
#> 4 Sepal.Length Species 22.38120
# kindling also supports `vip::vi()` / `vip::vi_model()`
model_mlp |>
vip::vi(type = 'garson') |>
vip::vip()
