Git Product home page Git Product logo

blame_my_data's Introduction

Dont blame me blame my data

Identify a subset of the training data that makes a classifier unfair. In this demo, we use Demographic Parity as our fairness constraint, so unless $p(\hat{Y} | A = a) = p(\hat{Y} | A = a’) ∀ a, a’$, then we declare our classifier as unfair. For simplicity, we first consider the case with only a single binary protected attribute.

We evaluate the distance between these two distributions using the KL divergence: $$DKL (P || Q) = ∑_y P(y) log(\frac{P(y)}{Q(y)})$$ where $P(y) = p(\hat{Y} = y | A = 0)$ and $Q(y) = p(\hat{Y} = y | A = 1)$ were $A = 0$ indicates the protected group. We ues the KL divergence as our metric for unfairness, the larger the distance between these two distributions, the more unfair our classifier is.

We take two approaches to determining how each training example affects our fairness on a test set.

  1. Leave-one-out retraining of the model for each training point and evaluating the change in unfairness for each model.
  2. Computing the influence of each training point on the unfairness over the test set. We follow the approach of Koh and Liang, extending it to the case where we evaluate influence of a training point on a criteria different from the loss function the model was trained on.

After evaluating the impact of each training point on our classifier’s fairness, we select a subset that is most responsible for the unfairness exhibited on the test set. Similar to Khanna et al., we take advantage of the submodularity of this objective and greedily insert training examples into this set.

Results

MethodUnfairnessAccuracy
Original0.05530.8107
Dropping random non-protected and positive class0.00020.7697
Balancing distribution of positive and negative across protected class0.00580.7915
Retrain, drop top 100????
Influence, drop all with harmful influence0.00010.7698

./fish_pca_hurtful.png

Is Male>=50kFraction of dropped examples
XX0.66
X0.20
X0.12
0.02

Further inspection of the values dropped by the influence functions method reveals that the distribution of the features in the protected class better matches the distribution in the non-protected class. For example, before dropping training examples, examining training points in the positive class (earning more than \$50k per year), the mean hours per week worked by women in the training set is 36 hours, while for men it is 42 hours. After dropping the training examples deemed harmful by the influence function method, the mean value for women increases to 43 hours. This is consistent with intuition which tells us that in order to achieve demographic parity, the protected attribute should not be correlated with the prediction.

blame_my_data's People

Contributors

dmh43 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.