Skip to content
Back to skills

Demographic Disparity

ASecurity

Evaluates the alignment between expected demographic proportions in a target population and the actual representation in a dataset or model outputs. It probes sampling, deployment, and structural biases by quantifying discrepancies across protected attributes. Use when the user has predictions and gold and needs to compute demographic_disparity.

  • 3 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 11, 2026
devopspythongo

Security analysis

A100/100

Scanned September 11, 2026

npx -y skills add qhjqhj00/research-skills-pool --skill demographic_disparity --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Demographic Disparity?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Demographic Disparity
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/qhjqhj00-demographic-disparity/badge)](https://www.skillsdirectory.com/skills/qhjqhj00-demographic-disparity)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: demographic_disparity
description: Evaluates the alignment between expected demographic proportions in a target population and the actual representation in a dataset or model outputs. It probes sampling, deployment, and structural biases by quantifying discrepancies across protected attributes. Use when the user has predictions and gold and needs to compute demographic_disparity.
metadata:
  skill_kind: metric
  source_arxiv: 2501.15985
  bibtex_key: galdonclavell2025demographic
  confidence: high
---

# demographic_disparity

> Demographic Benchmarking: Bridging Socio-Technical Gaps in Bias Detection — Gemma Galdon Clavell, Rubén González-Sendino, Paola Vazquez (2025) (arXiv:2501.15985, 2025)

## What this evaluates

Evaluates the alignment between expected demographic proportions in a target population and the actual representation in a dataset or model outputs. It probes sampling, deployment, and structural biases by quantifying discrepancies across protected attributes.

## Datasets

- **General Demographic Population** — total ?; splits: (unstated)

## Metrics

- `demographic_disparity` **(primary)** — range: [-1, 1]
  - Calculates the difference between the expected proportion (P_i) and the actual proportion (R_i) for a specific demographic group i. Formula: DD = P_i - R_i.
- `total_demographic_disparity` — range: other
  - Aggregates absolute discrepancies across all n demographic groups. Formula: TDD = sum(|P_i - R_i|) for i=1 to n.
- `normalized_demographic_disparity` — range: other
  - Averages relative discrepancies by dividing absolute differences by expected proportions. Formula: NDD = (1/n) * sum(|P_i - R_i| / P_i) for i=1 to n.

## Input / output format

**Input**: Expected demographic proportions (P_i) for each group i in the target population, and actual observed proportions (R_i) from the dataset or model outputs. Optionally includes a binary decision indicator (D=1) for positive outcomes.

**Output**: A scalar value representing the demographic disparity (or total/normalized variant) for the evaluated population or decision set.

## Scoring recipe

```python
def compute_demographic_disparity(P, R):
    # P: dict/list of expected proportions per group
    # R: dict/list of actual proportions per group
    dd = {g: P[g] - R[g] for g in P}
    tdd = sum(abs(v) for v in dd.values())
    ndd = sum(abs(v)/P[g] for g, v in dd.items()) / len(P)
    return dd, tdd, ndd
```

## Common pitfalls

- Assuming a 50/50 split for all demographic attributes (e.g., race) instead of using real-world population baselines.
- Applying metrics that require ground-truth labels to production environments where only model outputs or observed distributions are available.
- Confusing training data demographics with the expected production population demographics.

## Evidence (verbatim from paper)

> Demographic disparity (DD) is quantified to calculate and measure demographic issues as shown in Eq. 8. It is defined as the difference between the expected proportion $(P_{i})$ and the actual proportion in the dataset $(R_{i})$, where $i$ represents a specific demographic group (e.g., male, female, or a combination of attributes such as race and sex). This measures the discrepancy between each group's anticipated and observed representation within the dataset. To extend the analysis across all demographic groups, the Total Demographic Disparity (TDD) is calculated as shown in Eq. 9. This metric aggregates the absolute discrepancies for all demographic groups, providing a comprehensive measure of the overall disparity in the dataset. While TDD captures the extent of representation imbalances, it does not account for variations in the relative size of each group. To address this, the Normalized Demographic Disparity (NDD), defined in Eq. 10, introduces a proportional adjustment by dividing each group's discrepancy by its expected proportion and averaging across all groups.

## Citation

```bibtex
@misc{galdonclavell2025demographic,
  title={Demographic Benchmarking: Bridging Socio-Technical Gaps in Bias Detection},
  author={Gemma Galdon Clavell, Rubén González-Sendino, Paola Vazquez (2025)},
  year={2025},
  note={arXiv:2501.15985}
}
```

- arXiv: 2501.15985

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.