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

Hidden last contribution label in the break_down plot #85

Closed
hbaniecki opened this issue Apr 22, 2020 · 5 comments
Closed

Hidden last contribution label in the break_down plot #85

hbaniecki opened this issue Apr 22, 2020 · 5 comments
Assignees
Labels
invalid ❕ This doesn't seem right

Comments

@hbaniecki
Copy link
Member

@hbaniecki Thank you for pointing us the docs for iBreakDown, etc.!
I don't know if this is helpful but I got this minor issue a while ago for binary classification models.
The prediction for the positive cases works fine, but for negative cases the prediction becomes unreadable.
image

adding vcolors to the generic plot function worked for me:

bd_glm <- variable_attribution(explainer_glm, 
                               new_observation = x_test[1,],
                               type="break_down")

bd_glm2 <- variable_attribution(explainer_glm,
                                new_observation = x_test[30,],
                                type="break_down")
bd_colors <- c("#f05a71","#4378bf", "#8bdcbe", "#ffa58c")

p1 <- plot(bd_glm2, vcolors = bd_colors)
p2 <- plot(bd_glm, vcolors = bd_colors)

image

Thanks for your reply!

Originally posted by @marcjermaine-pontiveros in ModelOriented/DALEX#176 (comment)

@hbaniecki hbaniecki added the invalid ❕ This doesn't seem right label Apr 22, 2020
@hbaniecki
Copy link
Member Author

hbaniecki commented May 9, 2020

This issue was reported numerous times. A possible solution (implemented in modelStudio) is to place the prediction number on the left side of the prediction bar (so it is always visible).

Edit: Unable to resolve, because the baseline parameter makes this situation hard to detect, and nudge_y is not an aes parameter.

pbiecek added a commit that referenced this issue Jul 28, 2020
@pbiecek
Copy link
Member

pbiecek commented Jul 28, 2020

@hbaniecki would you check if d574460 solves this issue? maybe I've missed something

@pbiecek pbiecek self-assigned this Jul 28, 2020
@hbaniecki
Copy link
Member Author

My intention was to place this text on the left side of the bar. The candidate fix is still better than no fix. Can we do the same for the intercept bar? See

library("DALEX")
library("iBreakDown")
set.seed(1313)
model_titanic_glm <- glm(survived ~ gender + age + fare,
                         data = titanic_imputed, family = "binomial")
explain_titanic_glm <- explain(model_titanic_glm,
                               data = titanic_imputed,
                               y = titanic_imputed$survived,
                               label = "glm")

bd_glm <- local_attributions(explain_titanic_glm, titanic_imputed[1, ])
bd_glm
plot(bd_glm, max_features = 3, baseline=0.5)

pbiecek added a commit that referenced this issue Jul 29, 2020
@pbiecek
Copy link
Member

pbiecek commented Jul 29, 2020

thanks,
in a979cb4 the positioning works also for the intercept.

now it's on the right side, in next version we can add an option for this

@hbaniecki
Copy link
Member Author

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid ❕ This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants