# NOT RUN {
data("compas")
glm_compas <- glm(Two_yr_Recidivism~., data=compas, family=binomial(link="logit"))
y_numeric <- as.numeric(compas$Two_yr_Recidivism)-1
explainer_glm <- DALEX::explain(glm_compas, data = compas, y = y_numeric)
fobject <- fairness_check(explainer_glm,
protected = compas$Ethnicity,
privileged = "Caucasian")
plot_density(fobject)
# }
Run the code above in your browser using DataLab