Skip to content
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

Family in glmnet is always gaussian #190

Open
mirka-henninger opened this issue Apr 4, 2022 · 0 comments
Open

Family in glmnet is always gaussian #190

mirka-henninger opened this issue Apr 4, 2022 · 0 comments

Comments

@mirka-henninger
Copy link

When applying LIME to simulated data with a binary outcome, LIME results do not always match the data generating process. This arises because the family argument in the call to glmnet is set to gaussian by default and does not reflect the model type (classification versus regression). See e.g.,

lime/R/lime.R

Line 48 in 0281c56

fit <- glm.fit(x = x_fit, y = y[[label]], weights = weights, family = gaussian())

and

lime/R/lime.R

Line 56 in 0281c56

fit <- glmnet(x[shuffle_order, features], y[[label]][shuffle_order], weights = weights[shuffle_order], alpha = 0, lambda = 2 / length(y[[label]]))

I was wondering whether this is intentional/documented somewhere? As one possible fix, one could add a family argument to the model_permutations function that then can be used in the glm.fit and glmnet function calls. If you'd be willing to add a corresponding PR, I could prepare one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant