Skip to content
Back to skills

Stealthily Biased Sampling Eval

ASecurity

This evaluation probes a decision-maker's ability to stealthily sample a subset of a dataset to artificially satisfy fairness metrics (Demographic Parity) while remaining statistically indistinguishable from the original data distribution. It measures how well biased sampling algorithms can evade detection by ideal auditors using distributional tests like Kolmogorov-Smirnov or Wasserstein distance. Use when the user wants to benchmark on Synthetic Loan Check, COMPAS, Adult, or asks about eval...

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

Works with

  • cli

Security analysis

A100/100

Scanned September 11, 2026

npx -y skills add qhjqhj00/research-skills-pool --skill stealthily-biased-sampling-eval --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Stealthily Biased Sampling Eval?

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

Security grade badge for Stealthily Biased Sampling Eval
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/qhjqhj00-stealthily-biased-sampling-eval/badge)](https://www.skillsdirectory.com/skills/qhjqhj00-stealthily-biased-sampling-eval)

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: stealthily-biased-sampling-eval
description: This evaluation probes a decision-maker's ability to stealthily sample a subset of a dataset to artificially satisfy fairness metrics (Demographic Parity) while remaining statistically indistinguishable from the original data distribution. It measures how well biased sampling algorithms can evade detection by ideal auditors using distributional tests like Kolmogorov-Smirnov or Wasserstein distance. Use when the user wants to benchmark on Synthetic Loan Check, COMPAS, Adult, or asks about evaluating this task. Reports Demographic Parity (DP).
metadata:
  skill_kind: dataset_eval
  source_arxiv: 1901.08291
  bibtex_key: [REDACTED]
  confidence: high
---

# stealthily-biased-sampling-eval

> Faking Fairness via Stealthily Biased Sampling — Fukuchi et al. (2019) (arXiv:1901.08291, 2019)

## What this evaluates

This evaluation probes a decision-maker's ability to stealthily sample a subset of a dataset to artificially satisfy fairness metrics (Demographic Parity) while remaining statistically indistinguishable from the original data distribution. It measures how well biased sampling algorithms can evade detection by ideal auditors using distributional tests like Kolmogorov-Smirnov or Wasserstein distance.

## Datasets

- **Synthetic Loan Check** — total 1000; splits: sampling_pool (1000), referential (200); repo https://github.com/sato9hara/stealthily-biased-sampling
- **COMPAS** — total 5278; splits: sampling_pool (4000), referential (1278); repo https://github.com/sato9hara/stealthily-biased-sampling
- **Adult** — total 48842; splits: train (10000), test (20000), referential (18842); repo https://github.com/sato9hara/stealthily-biased-sampling

## Metrics

- `Demographic Parity (DP)` **(primary)** — range: [0, 1]
  - DP = |P(y=1|s=1) - P(y=1|s=0)|, where y is the binary decision and s is the binary sensitive attribute. Values closer to 0 indicate higher fairness.
- `Kolmogorov-Smirnov (KS) rejection rate` — range: [0, 1]
  - Binary indicator of whether the two-sample KS test rejects the null hypothesis that the feature distributions of the sampled subset Z and referential dataset D' are identical, at a significance level of 0.05.
- `Wasserstein Distance (WD)` — range: other
  - Minimum-cost flow distance between the empirical distributions of Z and D', computed using squared Euclidean distance d(x_i, x_j) = ||x_i - x_j||^2 as the ground metric.

## Input / output format

**Input**: A dataset D containing feature vectors x, sensitive attributes s, and decisions y. A held-out referential dataset D' containing features x and sensitive attributes s sampled from the underlying distribution.

**Output**: A sampled subset Z ⊆ D of a specified size, along with computed fairness metrics (DP) and detection metrics (KS rejection rate or WD) comparing Z to D'.

## Scoring recipe

```python
def compute_dp(y, s):
    p1 = mean(y[s == 1])
    p0 = mean(y[s == 0])
    return abs(p1 - p0)

def compute_ks_rejection(x_z, x_d_prime, alpha=0.05):
    _, p_val = ks_2samp(x_z, x_d_prime)
    return 1 if p_val < alpha else 0

def compute_wd(x_z, x_d_prime):
    # Solve min-cost flow with squared Euclidean distance
    return min_flow_cost(x_z, x_d_prime)
```

## Common pitfalls

- The synthetic experiment's detector assumes knowledge of the single predictive feature (income), whereas real auditors must use multi-dimensional tests which the authors note have very low power.
- The Adult dataset experiment relies on classifier-generated labels (y) rather than ground-truth outcomes, meaning the fairness audit applies to model predictions, not raw data.
- The referential dataset D' is strictly held out for distribution comparison and is not used to guide the sampling process, differing from standard cross-validation or training setups.

## Evidence (verbatim from paper)

> In the experiments, we adopted the demographic parity (DP) as the fairness metric for auditing. Here, let s∈{0,1} be a sensitive feature and y∈{0,1} be a decision. The DP is then defined as DP=|P(y=1|s=1)−P(y=1|s=0)|. A large DP indicates that the decision is unfair because the decision-maker favors providing positive decisions to one group over the other group.

## Citation

```bibtex
@misc{fukuchi2019fakingfairness,
  title={Faking Fairness via Stealthily Biased Sampling},
  author={Fukuchi et al. (2019)},
  year={2019},
  note={arXiv:1901.08291}
}
```

- arXiv: 1901.08291

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.