View source: R/bm_VariablesImportance.R
bm_VariablesImportance | R Documentation |
This internal biomod2 function allows the user to compute a variable importance value for each variable involved in the given model.
bm_VariablesImportance(
bm.model,
expl.var,
variables = NULL,
method = "full_rand",
nb.rep = 1,
seed.val = NULL,
do.progress = TRUE,
temp.workdir = NULL
)
bm.model |
a |
expl.var |
a |
variables |
(optional, default |
method |
a |
nb.rep |
an |
seed.val |
(optional, default |
do.progress |
(optional, default |
temp.workdir |
(optional, default |
For each variable to be evaluated :
shuffle the original variable
compute model prediction with shuffled variable
calculate Pearson's correlation between reference and shuffled predictions
return score as 1 - cor
The highest the value, the less reference and shuffled predictions are correlated, and the
more influence the variable has on the model. A value of 0
assumes no influence of
the variable on the model.
Note that this calculation does not account for variables' interactions.
The same principle is used in randomForest
.
A 3
columns data.frame
containing variable's importance scores for each
permutation run :
expl.var
: the considered explanatory variable (the one permuted)
rand
: the ID of the permutation run
var.imp
: the variable's importance score
Damien Georges
randomForest
,
bm_RunModelsLoop
, BIOMOD_Modeling
,
BIOMOD_EnsembleModeling
, bm_PlotVarImpBoxplot
,
get_variables_importance
Other Secundary functions:
bm_BinaryTransformation()
,
bm_CrossValidation()
,
bm_FindOptimStat()
,
bm_MakeFormula()
,
bm_ModelingOptions()
,
bm_PlotEvalBoxplot()
,
bm_PlotEvalMean()
,
bm_PlotRangeSize()
,
bm_PlotResponseCurves()
,
bm_PlotVarImpBoxplot()
,
bm_PseudoAbsences()
,
bm_RunModelsLoop()
,
bm_SRE()
,
bm_SampleBinaryVector()
,
bm_SampleFactorLevels()
,
bm_Tuning()
## Create simple simulated data
myResp.s <- sample(c(0, 1), 20, replace = TRUE)
myExpl.s <- data.frame(var1 = sample(c(0, 1), 100, replace = TRUE),
var2 = rnorm(100),
var3 = 1:100)
## Compute variables importance
mod <- glm(var1 ~ var2 + var3, data = myExpl.s)
bm_VariablesImportance(bm.model = mod,
expl.var = myExpl.s[, c('var2', 'var3')],
method = "full_rand",
nb.rep = 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.