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.

For each non-reference group, 0.5 * ((FPR_group - FPR_ref) + (TPR_group - TPR_ref)). Zero means parity of errors. This is the single-number summary used in IBM AIF360 and the COMPAS XAI Stories audit.

Usage

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

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

Arguments

y_true

Vector of realised ground-truth outcomes.

y_pred

Vector of system decisions.

group

Vector of protected-attribute values.

privileged

The reference group (inferred if NULL).

favorable

The value treated as the positive class (default 1).

Value

A morie_fairness_result; headline value is the largest absolute AOD across groups.

A named list: value (largest absolute AOD), average_odds_difference, rates, privileged, warnings, interpretation.

Examples

truth <- c(1, 0, 1, 0, 1, 0, 1, 0)
pred <- c(1, 0, 1, 0, 1, 1, 0, 1)
race <- c(rep("A", 4), rep("B", 4))
res <- morie_fairness_average_odds_difference(truth, pred, race,
  privileged = "A"
)
res$value # 0.25
#>    B 
#> 0.25