Description Usage Arguments Value Author(s) Examples
View source: R/variable_importance.R
Calculate contribution of predictor variables to the model.
Function will make a reference prediction of the model using the standard set of variables.
Then, the values in predictor variables are randomized, and the prediction is repeated with the set of variables
that contain a randomized variable. Correlation coefficient is calculated between the reference prediction and randomized prediction.
Given importance value is 1 - correlation ** 2
for each variable. Number of randomizations can be set (default is one)
1 | variable_importance(data, model, iterations_num = 1, clean = FALSE)
|
data |
Input data with variables for which to calculate the variable importance. With this data you should be able to run predict function on the model. |
model |
Model to be used for prediction. Function is tested only on glm object class. |
iterations_num |
Number of randomization iterations. Default is 1 iteration. |
clean |
Return cleaned data (default is |
Output is a matrix where rows have variable importance value for each variable, and the columns are individual iterations. If clean = TRUE, return class is dataframe.
Mirza Cengic
1 | var_importance(data = mydat, model = my_model, iterations_num = 10)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.