plot_density {fairmodels} | R Documentation |
Plot fairness object
Description
Plot distribution for models output probabilities. See how being in particular subgroup affects models decision.
Usage
plot_density(x, ...)
Arguments
x |
object of class |
... |
other plot parameters |
Value
ggplot2
object
Examples
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)
[Package fairmodels version 1.2.1 Index]