Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Executing the Credit Risk notebook does not generate a de-biased dataset #51

Closed
biosopher opened this issue Nov 14, 2018 · 8 comments
Closed

Comments

@biosopher
Copy link

Executing the Credit Risk Notebook does not generate a de-biased dataset. The results below are from a brand now GIT pull from the AIF360 repo. As shown at the end, the new "debiased" model now over twice as biased as the original model:

image
image
image

@adrinjalali
Copy link
Contributor

I [almost] concur. I get 0.11 vs 0.21. Is the input data changing? What's the source of these different results?

It may be a good idea to have some of these as tests or doctests in the docstrings (as examples).

@michaelhind michaelhind changed the title Executing the Credit Risk notebook does generate a de-biased dataset Executing the Credit Risk notebook does not generate a de-biased dataset Nov 16, 2018
@biosopher
Copy link
Author

@nrkarthikeyan Can you advise on this? Just sent an email cc'ing the AIOS team. Need this fixed so we can show integration.

@biosopher
Copy link
Author

biosopher commented Nov 26, 2018

I know the German credit risk dataset is small, but that doesn't explain the odd behavior of AIF360's notebook.  E.g. I looped through a hundred different splits of that dataset looking for one that would de-bias properly. 

In the process I found that for EVERY split of test/train, AIF360 actually generates a more biased dataset than the initial one.  Something else is wrong here.

Here's my notebook showing this bug:  tutorial_credit_scoring_merged.ipynb.zip

@adrinjalali
Copy link
Contributor

The warning shown in the notebook might also be significant. The preprocessing sets the privileged and unprivileged groups, (gender and race I guess), and then in the notebook when the user tries to set the privileged/unprivileged group, it's ignored as a result. That would quite change the results.

@nrkarthikeyan
Copy link
Collaborator

Hi all, the optimized pre-processing (used in the original credit scoring tutorial) has a lot of randomness built into it, which will create issues with small datasets. I suggest that we use re-weighing pre-processing to circumvent this issue. Please see the attached notebook:
tutorial_credit_scoring_reweighing.ipynb.zip

The key thing to keep in mind is that reweighing pre-processing works by changing the instance level weights (this is available in dataset.instance_weights). So, the classifier trained on the debiased data should be capable of handling instance level weights. Let me know what you folks think.

@hoffmansc
Copy link
Collaborator

Alternatively, we could run it on the Adult dataset which seems to be much more stable and effective.
tutorial_credit_scoring_adult.ipynb.zip

@scottdangelo
Copy link

Any update on fixing this? We've a code pattern on developer.ibm.com that uses this notebook, and it shows that using AIF360 makes fairness worse.

@nrkarthikeyan
Copy link
Collaborator

We have modified the tutorial and this issue is fixed.

scottdangelo added a commit to IBM/ensure-loan-fairness-aif360 that referenced this issue Feb 26, 2019
Port changes from Trusted-AI/AIF360#51
Switch to Reweighing pre-processing alogrithm.

Closes: #25
scottdangelo added a commit to IBM/ensure-loan-fairness-aif360 that referenced this issue Feb 26, 2019
Port changes from Trusted-AI/AIF360#51
Switch to Reweighing pre-processing alogrithm.

Closes: #25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants