plot_density: Plot fairness object

View source: R/plot_density.R

plot_densityR 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 fairness_object

...

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)

fairmodels documentation built on Aug. 24, 2022, 1:05 a.m.