Closed hbaniecki closed 3 years ago
It occurs when the variable column is a factor instead of character (default for R3.6, changed in R4.0).
variable
library(DALEX) model_lm <- lm(m2.price~., data = apartments) explainer_lm <- DALEX::explain(model_lm, data = apartments, y = apartments$m2.price) mp <- iBreakDown::local_attributions(explainer_lm, apartments[3,], keep_distributions=TRUE) mp$variable <- as.factor(mp$variable) plot(mp, plot_distributions = TRUE)
Potential fix: add stringsAsFactors=TRUE to all of the results and fix vorder in plot_break_down_distributions
stringsAsFactors=TRUE
vorder
plot_break_down_distributions
It occurs when the
variable
column is a factor instead of character (default for R3.6, changed in R4.0).Potential fix: add
stringsAsFactors=TRUE
to all of the results and fixvorder
inplot_break_down_distributions