Closed hbaniecki closed 4 years ago
tested with
library("DALEX")
library("ingredients")
library("randomForest")
model_titanic_rf <- randomForest(survived ~ gender + age + fare,
data = na.omit(titanic_imputed))
explain_titanic_rf <- explain(model_titanic_rf,
data = titanic_imputed[,-8],
y = titanic_imputed[,8],
verbose = FALSE)
model_titanic_glm <- glm(survived ~ gender + age + fare,
data = titanic_imputed, family = "binomial")
explain_titanic_glm <- explain(model_titanic_glm,
data = titanic_imputed[,-8],
y = titanic_imputed[,8],
verbose = FALSE)
cp1 <- ceteris_paribus(explain_titanic_rf, titanic_imputed[c(1,100),])
cp2 <- ceteris_paribus(explain_titanic_glm, titanic_imputed[c(1,100),])
plot(cp1, cp2)
plot(cp1)
Thanks
from: https://github.com/ModelOriented/DALEX/issues/236