varImportance | R Documentation |
Get variable importance. The importance is expressed as the deterioration of the evaluation statistic. The statistic is computed n
times for model predictions after randomizing a predictor variable and subtracting the statistic for the non-randomized data. The larger the difference, the more important the variable is.
varImportance(model, y, x, n=10, stat, value="relative", ...)
model |
a model object |
y |
the response variable used to fit the |
x |
data.frame with the predictor variables used to fit the |
n |
positive integer. Number of simulations |
stat |
character. For models with a continuous response variable this can be one of "RMSE" (the default), "AUC", or "cor". See |
value |
character specifying how to express the output. One of , "relative" (), "difference" (), "absolute" (no adjustments) |
... |
model specific additional arguments passed to |
named numeric vector
set.seed(1)
d <- data.frame(y=1:10, x1=runif(10), x2=runif(10))
m <- lm(y~., data=d)
varImportance(m, d[,1], d[,2:3])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.