$npx -y skills add ma-compbio-lab/SkillFoundry --skill fairlearn-bias-audit-starterUse this skill to run a deterministic group fairness audit over a tiny clinical toy cohort with fairlearn.
| 1 | # Fairlearn Bias Audit Starter |
| 2 | |
| 3 | Use this skill to run a deterministic group fairness audit over a tiny clinical toy cohort with `fairlearn`. |
| 4 | |
| 5 | ## What it does |
| 6 | |
| 7 | - Loads a fixed tabular cohort with binary labels, binary predictions, and a sensitive group column. |
| 8 | - Computes per-group accuracy, selection rate, true positive rate, and false positive rate with `MetricFrame`. |
| 9 | - Summarizes demographic parity and equalized odds gaps and ratios. |
| 10 | - Emits a compact JSON report and threshold-based audit flags for local debugging. |
| 11 | |
| 12 | ## When to use it |
| 13 | |
| 14 | - You need a local starter for fairness or bias analysis in binary clinical risk models. |
| 15 | - You want a small, reproducible example before auditing a real cohort. |
| 16 | |
| 17 | ## Example |
| 18 | |
| 19 | ```bash |
| 20 | slurm/envs/statistics/bin/python skills/clinical-biomedical-data-science/fairlearn-bias-audit-starter/scripts/run_fairlearn_bias_audit.py \ |
| 21 | --input skills/clinical-biomedical-data-science/fairlearn-bias-audit-starter/examples/toy_fairness_cohort.tsv \ |
| 22 | --summary-out scratch/fairlearn/fairness_audit_summary.json |
| 23 | ``` |
| 24 | |
| 25 | ## Verification |
| 26 | |
| 27 | - Skill-local tests: `python3 -m unittest discover -s skills/clinical-biomedical-data-science/fairlearn-bias-audit-starter/tests -p 'test_*.py'` |