vip

Discripencies in variable importance calculation for glmnet model in R

我们两清 提交于 2021-01-29 12:41:20
问题 I want to calculate variable importance for glmnet model in R. I am using glmnet package for fitting the elastic net model like library(glmnet) library(caret) library(vip) data_y <- as.vector(mtcars$mpg) data_x <- as.matrix(mtcars[-1]) fit.glmnet <- glmnet(data_x, data_y, family="gaussian") set.seed(123) cvfit.glmnet = cv.glmnet(data_x, data_y, standardize=T) cvfit.glmnet$lambda.min coef(cvfit.glmnet, s = "lambda.min") Then I have used vip package for variable importance as #Using vip package