library(DALEX)
# fit a model
model_glm <- glm(survived ~ ., family = binomial, data = titanic_imputed)
# create an explainer
exp_glm <- explain(model_glm,
data = titanic_imputed,
y = titanic_imputed$survived)
# calculate score
score_gini(exp_glm)
Run the code above in your browser using DataLab