Ok let’s take a look at some of these fairness measures in action. We are going to train a decision tree on a data set focused on Japanese Loan Approval to see if gender and race play a role in the approval of the loans.

I should note that the labels on this dataset were completely anonymized so I had to guess (make up some of my own) at the labels. In terms of walking you through the process of measuring fairness it really shouldn’t have any impact.

Here we see Demographic Parity and Equality of Opportunity

##                       m      f
## Proportion          0.4 0.4750
## Proportional Parity 1.0 1.1875

## Setting direction: controls < cases
## Setting direction: controls < cases