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

Error in FI/PDP on model with one variable #137

Closed
hbaniecki opened this issue Apr 1, 2021 · 2 comments
Closed

Error in FI/PDP on model with one variable #137

hbaniecki opened this issue Apr 1, 2021 · 2 comments
Assignees
Labels
bug 💣 Bug to fix

Comments

@hbaniecki
Copy link
Member

related to: ModelOriented/modelStudio#99

@hbaniecki hbaniecki self-assigned this Apr 1, 2021
@hbaniecki
Copy link
Member Author

hbaniecki commented Apr 2, 2021

library(DALEX)
titanic_imputed_sub <- subset(titanic_imputed, select = c("survived", "class"))
model_titanic <- glm(survived ~ class, data = titanic_imputed_sub, family = "binomial")

# create an explainer for the model
explainer_titanic <- explain(model_titanic,
                             data = titanic_imputed_sub[, 2, drop=FALSE],
                             y = titanic_imputed$survived,
                             label = "Titanic GLM")


fi <- ingredients::feature_importance(explainer_titanic$model,
                                      explainer_titanic$data,
                                      explainer_titanic$y)

plot(fi)

pdp <- ingredients::partial_dependence(explainer_titanic$model,
                                       explainer_titanic$data)

plot(pdp)

@hbaniecki hbaniecki added the bug 💣 Bug to fix label Apr 2, 2021
hbaniecki added a commit that referenced this issue Apr 2, 2021
@hbaniecki hbaniecki changed the title feature importance on model with one variable Error in FI/PDP on model with one variable Apr 2, 2021
@pbiecek
Copy link
Member

pbiecek commented Apr 7, 2021

thanks

@pbiecek pbiecek closed this as completed Apr 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 💣 Bug to fix
Projects
None yet
Development

No branches or pull requests

2 participants