-
-
Notifications
You must be signed in to change notification settings - Fork 166
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
histogram plot from plot.model_performance() is in reverse order #400
Comments
hbaniecki
added
invalid ❕
This doesn't seem right, potential bug
R 🐳
Related to R
labels
Mar 25, 2021
Indeed, this is due to this line: DALEX/R/plot_model_performance.R Lines 141 to 142 in 922519c
@pbiecek any idea why it is there? I found a mismatch of colours in EMA too. Can we delete it? |
pbiecek
added a commit
that referenced
this issue
Mar 26, 2021
thanks, it should be fixed in 24ba9cf
|
fixed in 24ba9cf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The code below uses the example from the plot.model_performance() code. When used with multiple models and geom="histogram", the labels are incorrect (in reverse order, it seems).
library(patchwork)
library(DALEX)
titanic_ranger_model2 <- ranger(survived~gender + fare, data = titanic_imputed,
num.trees = 50, probability = TRUE)
explainer_ranger2 <- explain(titanic_ranger_model2, data = titanic_imputed[,-8],
y = titanic_imputed$survived,
label = "ranger2")
mp_ranger2 <- model_performance(explainer_ranger2)
titanic_glm_model <- glm(survived~., data = titanic_imputed, family = "binomial")
explainer_glm <- explain(titanic_glm_model, data = titanic_imputed[,-8],
y = titanic_imputed$survived, label = "glm",
predict_function = function(m,x) predict.glm(m,x,type = "response"))
mp_glm <- model_performance(explainer_glm)
titanic_lm_model <- lm(survived~., data = titanic_imputed)
explainer_lm <- explain(titanic_lm_model, data = titanic_imputed[,-8],
y = titanic_imputed$survived, label = "lm")
mp_lm <- model_performance(explainer_lm)
The histogram labels are reversed - the bottom graph should be ranger2 and the top glm.
plot(mp_glm, mp_ranger2, mp_lm, geom = "histogram") +
plot(mp_glm, mp_ranger2, mp_lm, geom = "boxplot")
This is clear after looking at the graph of only ranger2.
plot(mp_ranger2, geom = "histogram") +
plot(mp_ranger2, geom = "boxplot")
The text was updated successfully, but these errors were encountered: