Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

variables_importance

Variables importance calculation


Description

This function will return a variable importance value for each variable involved within your model.

Usage

variables_importance(model, data, method = "full_rand", nb_rand = 1, ...)

Arguments

model

the model you want to study variables importance (one of the models supported within biomod2, ensemble models are also supported

data

the data.set on which you want to perform analyses

method

the randomisation method (only 'full_rand' available so far)

nb_rand

the number of permutation done for each variable

...

additional args (not implemented yet)

Details

It's more or less base on the same principle than randomForest variables importance algorithm. The principle is to shuffle a single variable of the given data. Make model prediction with this 'shuffled' data.set. Then we compute a simple correlation (Pearson's by default) between references predictions and the 'shuffled' one. The return score is 1-cor(pred_ref,pred_shuffled). The highest the value, the more influence the variable has on the model. A value of this 0 assumes no influence of that variable on the model. Note that this technique does not account for interactions between the variables.

Value

a list of class "BIOMOD_variables_importances" which contains:

- mat: a data.frame containing variables importance scores for each permutation run.

Author(s)

Damien Georges

See Also

Examples

xx <- 
  data.frame( 
    a = sample(c(0, 1), 100, replace = TRUE),
    b = rnorm(100),
    c = 1:100
  )
  
mod <- glm(a ~ b + c, data = xx)

variables_importance(
  model = mod, 
  data = xx[, c('b', 'c')], 
  method = "full_rand", 
  nb_rand = 3
)

biomod2

Ensemble Platform for Species Distribution Modeling

v3.4.6
GPL-2
Authors
Wilfried Thuiller [aut, cre], Damien Georges [aut, cre], Robin Engler [aut], Frank Breiner [aut]
Initial release
2020-02-24

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.