Relationship-aware counterfactual fairness testing · PyPI
A Python library that propagates protected-attribute interventions through a causal DAG so counterfactual fairness tests stay on the data manifold. Naive flip tests miss proxy bias — a model that learned relationship=Husband ⇒ Male reads a flipped row as off-distribution. relfair propagates the intervention: Husband → Wife, occupation update, household role update. On Adult, ACS Income, and German Credit, it detects 3–4× more discrimination than naive flipping. Ships with an NYC Local Law 144 audit engine — selection rates, four-fifths rule, bootstrap CIs, and DCWP-compliant PDF reports.
Propagates the flip through the causal DAG. Downstream values update to stay coherent.