library for fair auditing and learning of classifiers with respect to rich subgroup fairness.
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 5 commits ahead of sethneel:dev_branch.
Seth Viren Neel
Seth Viren Neel oldmaster
Latest commit 2bd0b13 Dec 6, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
dataset oldmaster Dec 6, 2018
gerryfair oldmaster Dec 6, 2018
.gitignore starting refactor via Nov 22, 2018
GerryFair Demo.ipynb oldmaster Dec 6, 2018 oldmaster Dec 6, 2018
requirements.txt oldmaster Dec 6, 2018 oldmaster Dec 6, 2018

GerryFair: Auditing and Learning for Subgroup Fairness

Fairness Gerrymandering: when "a classifier appears to be fair on each individual group, but badly violates the fairness constraint on one or more structured subgroups defined over the protected attributes" (from Kearns et al.,

This repository contains python code for:

  • learning fair classifiers subject to subgroup fairness constraints (as described in
  • auditing standard classifiers from sklearn for fairness violations
  • visualizing tradeoffs between error and fairness metrics
  • fairness sensitive datasets for experiments (as used in


To install the package and prepare for use, run:

git clone
pip install -r requirements.txt

The current iteration of the package uses the following python packages: pandas, numpy, sklearn, matplotlib If you already have these installed, you can forgo the requirements step.

Using our package

For demonstration of the GerryFair API, please see our jupyter notebook





student: (math grades)


  • Maintained by: Seth Neel (, William Brown, Adel Boyarsky, Arnab Sarker, Aaron Hallac.
  • Property of: Michael Kearns, Seth Neel, Aaron Roth, Z. Steven Wu.
  • For questions or concerns, contact Algowatch Project (