---
kind: concept
slug: inequality-index
title: Inequality index
summary: >-
  Scores how unequally a binary classifier treats people, using per-person benefits from prediction and label. Start with the generalized entropy index at alpha = 2 on benefits 2, 1, 0. Use its between-group and within-group split to see where unfairness sits. Its benefit values are a choice that changes every number, and the index is reported next to accuracy.
tags: [fairness, inequality-index, group-fairness, individual-fairness]
papers: ["1807.00787"]
related: [algorithmic-fairness, calibration]
status: draft
updated_at: 2026-11-03
---

## Overview

An inequality index is a single number that grows as a set of values becomes
more unequal. For a classifier, each person gets a benefit computed from their
prediction and true label, and the index measures how spread out those
benefits are [arxiv:1807.00787 §2.2]. A benefit of 0 means a false negative,
1 means a true positive or true negative, and 2 means a false positive, with
the mapping b = yhat - y + 1 [arxiv:1807.00787 §2.2 eq. 1]. The index is then
computed on the benefit vector, so it needs only predictions and labels, not
model internals [arxiv:1807.00787 §1].

The paper's choice is the generalized entropy family with alpha = 2, which is
half the squared coefficient of variation of the benefits [arxiv:1807.00787
§2.3 eq. 2] [arxiv:1807.00787 §4]. Its main structural property is a split of
the total into a between-group part and a within-group part, used to check
where a fairness method's gains and losses fall [arxiv:1807.00787 §3.2].

## Variants

### Generalized entropy index on benefits (alpha = 2)

What it is: the generalized entropy index of the benefit vector, with
alpha = 2, as an overall unfairness score for a binary classifier. Key
mechanism: each false positive, true positive or negative, and false negative
gets its benefit value, the mean benefit is computed, and the index averages
the squared ratio of each benefit to the mean, minus one [arxiv:1807.00787
§2.2] [arxiv:1807.00787 §2.3 eq. 2]. Reported use: the overall unfairness of
logistic regression, RBF SVM and random forest on Adult and COMPAS, with
ten 70/30 splits [arxiv:1807.00787 §4] [arxiv:1807.00787 fig. 6]. Card:
[A Unified Approach to Quantifying Algorithmic Unfairness](/papers/1807.00787).

### Between-group and within-group decomposition

What it is: the same index split into a sum over groups of within-group
unfairness and a sum of between-group terms, for any partition of people into
groups [arxiv:1807.00787 §3.2 eq. 5]. Key mechanism: each group contributes
its own generalized entropy, weighted by group size and mean benefit, and a
between-group term measures how far each group mean sits from the overall
mean [arxiv:1807.00787 §3.2]. Reported use: the paper shows that a method
which reduces only the between-group term can increase the within-group and
overall values [arxiv:1807.00787 §3.2]. On COMPAS with logistic regression,
the maximum overall unfairness across thresholds is about 0.6, against about
0.01 for the between-group part [arxiv:1807.00787 §4.2]. Card: the same
[paper](/papers/1807.00787).

## When to use which

| Situation | Use | Why |
|---|---|---|
| You need one number to rank how unfair two classifiers are, and they may be trained differently | Generalized entropy, alpha = 2, on benefits 2, 1, 0 | Computed from predictions and labels only; the paper uses it to compare models [arxiv:1807.00787 §1] [arxiv:1807.00787 §4] |
| A group-based method reduces one disparity and you want to see what else changed | Between/within decomposition | Shows whether the gain is in the between-group term or elsewhere [arxiv:1807.00787 §3.2] |
| Your benefit values differ from 2, 1, 0 | Check sensitivity before reporting | The paper says other values could be used but does not test their effect [arxiv:1807.00787 §2.2] |
| You need an index that splits by group | Generalized entropy family only | The Gini index is not subgroup-decomposable, so the split does not carry over [arxiv:1807.00787 §2.3] |
| The index is reported for a model | Report accuracy beside it | The fairest model can be far less accurate than the accuracy optimum [arxiv:1807.00787 app.] |

Group criteria such as equal false positive rates or equal acceptance rates
answer a different question, and they often cannot all hold at once
[arxiv:1807.00787 §1]. The index ranks unfairness on one scale; it does not
replace a group criterion chosen for the decision at hand [arxiv:1807.00787
§2.4].

## Implementation sketch

The core is two functions: the individual index on benefits, and the split
into groups. Both follow the formulas as printed in the paper [arxiv:1807.00787
§2.2] [arxiv:1807.00787 §3.2]. The decomposition was not checked numerically
in the source card, so test it on a small example before relying on it.

```pseudocode
# Individual unfairness of a binary classifier  [arxiv:1807.00787 §2.2]
# Input:  predictions (n,) in {0, 1}; labels (n,) in {0, 1}; alpha != 0, 1
# Output: scalar unfairness

def individual_unfairness(predictions, labels, alpha):
    # Benefit per person: yhat - y + 1, values in {0, 1, 2}  [eq. 1]
    benefits = predictions - labels + 1
    n = len(benefits)
    # Mean benefit, the denominator of the index  [arxiv:1807.00787 §2.2]
    mean_benefit = sum(benefits) / n
    # Generalized entropy over the benefit vector  [arxiv:1807.00787 eq. 2]
    terms = (benefits / mean_benefit) ** alpha - 1
    return sum(terms) / (n * alpha * (alpha - 1))
```

```pseudocode
# Split the index into within-group and between-group parts  [§3.2 eq. 5]
# Input:  benefits (n,) >= 0; groups (n,) integer labels; alpha
# Output: within-group part, between-group part (they sum to the total)

def decompose_unfairness(benefits, groups, alpha):
    n = len(benefits)
    mean_benefit = sum(benefits) / n
    within = 0.0
    between = 0.0
    for each group g in set(groups):
        members = benefits[groups == g]
        n_g = len(members)
        mu_g = sum(members) / n_g
        ratio = (mu_g / mean_benefit) ** alpha
        # Between-group term for g  [arxiv:1807.00787 §3.2]
        between += n_g / (n * alpha * (alpha - 1)) * (ratio - 1)
        # Within-group term: weighted index of the group's own benefits
        within += (n_g / n) * ratio * generalized_entropy(members, alpha)
    return within, between
```

Here `generalized_entropy(members, alpha)` is the index above applied to one
group's benefits, with that group's own mean [arxiv:1807.00787 §3.2]. The
index needs non-negative benefits with at least one positive value
[arxiv:1807.00787 §2.2]; the 2, 1, 0 map always satisfies this. For alpha = 0
or 1 the closed form is not written out in the paper [arxiv:1807.00787 §2.3].

## Contradictions

None known between papers; only one paper covers this slug so far. Within
that paper, the printed appendix values for its example (1.075 and 1.10) are
rounded differently from a recomputation (about 1.074 and 1.109). The ordering
holds in both [arxiv:1807.00787 app.].

## Papers

- [Speicher et al., 2018: inequality indices for classifier unfairness](/papers/1807.00787): defines the generalized-entropy index on benefits for classifier unfairness and its between/within-group decomposition.
