-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Partial matching error with glmnet package #103
Comments
Any news on this? vi_glmnet <- function(model_fit, lambda) {
cs <- coef(model_fit$fit, s = lambda)
tibble(Variable = rownames(cs), Importance = abs(as.vector(cs)), Sign = if_else(as.vector(cs) >= 0, 'POS', 'NEG')) %>%
arrange(desc(Importance))
} (vi_model documentation: "Similar to (generalized) linear models, the absolute value of the coefficients are returned for a specific model.") |
Yes (although I think lambda should default to NULL). I just haven't found the time to push a fix yet. Happy to accept a PR? Otherwise, I can plan to add the fix early next week? |
I had a look at the I am not an experienced R developer, and what I had in mind was something starting with sc <- sys.call()
dots_vars <- setdiff(names(sc), c('', names(environment()))) to get Looking online I found this helper function, but I do not know what scope of changes you are interested in making (trying to address all possible I would much rather leave this to you to sort out, as you say, next week (and then see how you did it). |
Hey @T-Flet this should be fixed in the current development version if you want to check it out! |
https://stackoverflow.com/questions/61606337/computing-importance-measure-using-vip-package-on-a-parsnip-model/62064736#62064736
The text was updated successfully, but these errors were encountered: