Skip to contents

For each non-reference group, the average odds difference is 0.5 * ((FPR_group - FPR_ref) + (TPR_group - TPR_ref)). Zero means parity of errors; values away from zero mean the combined error profile favours one group over another. Used in IBM AIF360 and in the COMPAS XAI Stories audit.

Usage

morie_fairness_average_odds_difference(
  y_true,
  y_pred,
  group,
  privileged = NULL,
  favorable = 1
)

Arguments

y_true

Realised ground-truth outcome per individual.

y_pred

The system's decision 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 largest absolute AOD across groups.

Examples

morie_fairness_average_odds_difference(
  y_true = c(1, 1, 0, 0, 1, 1, 0, 0),
  y_pred = c(1, 1, 0, 0, 0, 0, 1, 1),
  group  = c(rep("A", 4), rep("B", 4))
)
#> Average Odds Difference
#> =======================
#>   Largest |AOD|    0
#>   Reference group  A
#> 
#> Warning: `privileged` not given; inferred as 'A' (the group with the highest favourable-outcome rate). Pass `privileged=` explicitly to audit against a specific reference group. 
#> 
#> The largest average odds difference is +0.000. Zero is parity; values away from zero mean the combined true-positive and false-positive error profile favours one group over another.