varImp2 | R Documentation |
A generic method for calculating variable importance for objects produced by train
.
varImp2(model, ...) ## S3 method for class 'train' varImp2(model, nperm = 1, errorFunction = ci_95, ...) ## S3 method for class 'varImp2' plot(x, scale = FALSE, plot_errorbar = TRUE, ...) ## S3 method for class 'varImp2' summary(object, scale = FALSE, ...)
model |
A model returned by |
... |
ignored |
nperm |
Number of permutations for each variable. |
errorFunction |
A function used to calculate errors. Function must accept |
x, object |
An object from |
scale |
logical. Return scaled values from 0 to 100? |
plot_errorbar |
logical. Should plot error bars? Error bars are only plotted if |
The process of calculating variable importance is different from caret::varImp(model, useModel = TRUE)
.
Here we use the same process as described in biomod2::variables_importance
,
but the function will directly accept a caret model.
If available, multiple cores are used to compute correlations.
An S3 object of class 'varImp2', including:
importance - A data.table with variables importance, importance from 0 to 100, and errors across permutations.
resamples - A data.table with correlations for each permutation.
## Not run: v.obj <- varImp2(model) summary(v.obj) summary(v.obj, scale = FALSE) plot(v.obj) # for multiple models v.obj <- varImp2(list(model1, model2, model3), nperm = 25) plot(v.obj, scale = FALSE) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.