Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Audits dataset bias across protected attributes, reporting parity, equalized odds, representation gaps, and intersectional group metrics.
41% 100%+59 ptsof test cases passed
Passed 22 of 22 test cases with the skill, and 9 of 22 without it.
In our retail customer dataset, the largest demographic segment comprises 68% of records while the smallest comprises 8%. What risk level does this group size ratio represent, and what is the numeric metric value?
Classifies the group ratio risk level as yellow
3 of 3 safety checks passed
Bias in training data produces biased models, full stop. This audit measures representation, outcome disparities, and intersectional gaps so you can fix problems before training.
Use when: building models that make decisions about people, deploying in regulated domains, or when protected attributes (gender, race, age, etc.) are available.
import pandas as pd
import numpy as np
def representation_audit(df, protected_cols, population_benchmark=None):
"""Check if dataset representation matches population."""
n = len(df)
results = {}
for col in protected_cols:
dist = df[col].value_counts(normalize=True).to_dict()
results[col] = {
"distribution": dist,
"n_groups": len(dist),
"min_group_pct": min(dist.values()),
"max_group_pct": max(dist.values()),
"imbalance_ratio": max(dist.values()) / (min(dist.values()) + 1e-10),
}
# Intersectional audit
if len(protected_cols) >= 2:
intersectional = df.groupby(protected_cols).size() / n
min_intersection = intersectional.min()
results["intersectional"] = {
"n_intersections": len(intersectional),
"min_pct": min_intersection,
Next to this one in the catalogue, plus more from the same author.