Skip to contents

For each group, the disparate-impact ratio is its favourable- outcome rate divided by the privileged group's rate. A value below 0.8 is the standard legal indicator of adverse impact.

Usage

morie_fairness_disparate_impact(
  y_pred,
  group,
  privileged = NULL,
  favorable = 1
)

Arguments

y_pred

Vector of decisions / assignments per individual.

group

Protected-attribute vector aligned with y_pred.

privileged

Reference group. If NULL, the highest-rate group is inferred and a warning is emitted.

favorable

Value of y_pred that counts as favourable (default 1).

Value

A morie_fairness_result; headline value is the worst (smallest) ratio across groups.

Examples

pred <- c(1, 1, 1, 1, 1, 1, 1, 1, 0, 0)
race <- c("A","A","A","A","A","B","B","B","B","B")
morie_fairness_disparate_impact(pred, race, privileged = "A")$value
#> [1] 0.6