ModelOriented / ingredients

Effects and Importances of Model Ingredients
https://modeloriented.github.io/ingredients/
GNU General Public License v3.0
37 stars 19 forks source link

CP profile for the categorical variable and a few models #111

Closed kozaka93 closed 4 years ago

kozaka93 commented 4 years ago

I have CP profile for one observation and two models, I want to compare them with each other, but for categorical variables color does not work.

My code

library(DALEX)
library(ingredients)

no <- titanic_imputed[1,]

m1 <- glm(survived~. , data = titanic_imputed)
e1 <- explain(m1, titanic_imputed, titanic_imputed$survived, label = "glm")
cp1 <- ceteris_paribus(e1, no)

m2 <- ranger(survived~. , data = titanic_imputed)
e2 <- explain(m2, titanic_imputed, titanic_imputed$survived, label = "ranger")
cp2 <- ceteris_paribus(e2, no)

## works
plot(cp1, cp2, color = "_label_")
## does not work
plot(cp1, cp2, color = "_label_", variable_type = "categorical")

Thanks

pbiecek commented 4 years ago

fixed in 9f8f82f