Giter Club home page Giter Club logo

h2oai / article-information-2019 Goto Github PK

View Code? Open in Web Editor NEW
13.0 16.0 3.0 341.17 MB

Article for Special Edition of Information: Machine Learning with Python

Home Page: https://www.mdpi.com/journal/information/special_issues/ML_Python

License: Apache License 2.0

Python 1.67% TeX 3.74% PostScript 8.00% Jupyter Notebook 86.59%
machine-learning python fatml xai data-science fairness-ai fairness-ml fairness-testing interpretable-machine-learning interpretable-ai

article-information-2019's Introduction

A Responsible Machine Learning Workflow

With Focus on Interpretable Models, Post-hoc Explanation, and Discrimination Testing

Authors: Patrick Hall 1,2, Navdeep Gill 1, Kim Montgomery 1, and Nicholas Schmidt 3

Affiliations: 1 H2O.ai; 2 George Washington University; 3 BLDS, LLC

Abstract:

This manuscript outlines a viable approach for training and evaluating machine learning (ML) systems for high-stakes, human-centered, or regulated applications using common Python programming tools. The accuracy and intrinsic interpretability of two types of constrained models, monotonic gradient boosting machines (MGBMs) and explainable neural networks (XNNs), a deep learning architecture well-suited for structured data, are assessed on simulated data and publicly available mortgage data. For maximum transparency and the potential generation of personalized adverse action notices, the constrained models are analyzed using post-hoc explanation techniques including plots of partial dependence (PD) and individual conditional expectation (ICE) and with global and local Shapley feature importance. The constrained model predictions are also tested for disparate impact (DI) and other types of discrimination using measures with long-standing legal precedents, adverse impact ratio (AIR), marginal effect (ME), and standardized mean difference (SMD), along with straightforward group fairness measures. By combining interpretable models, post-hoc explanations, and discrimination testing with accessible software tools, this text aims to provide a template workflow for important ML applications that require high accuracy and interpretability and that mitigate risks of discrimination.

Current Working Draft:

See article-information-2019.pdf.

Current Python 3.6 Environment Setup for Linux and OSX:

$ pip install virtualenv
$ cd notebooks
$ virtualenv -p python3.6 env
$ source env/bin/activate
$ pip install -r ../requirements.txt
$ ipython kernel install --user --name=information-article # Set up Jupyter kernel based on virtualenv
$ jupyter notebook

Current Results:

Datasets:

Data Summaries and Preprocessing

Modelling

Model Performance and Interpretation

GBM and MGBM
XNN and ANN

Discrimination Testing Results

article-information-2019's People

Contributors

jphall663 avatar kmontgom2400 avatar navdeep-g avatar nickpschmidt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

article-information-2019's Issues

Raw HDMA data missing & provided raw data file is not used in scripts

The file noted as the raw/input HDMA data in the README is: hmda_lar_2018_orig_mtg_sample.csv

However, this file is not used anywhere in the scripts and I am not sure where it comes from, but the fields match at least a subset of what's listed in the data dictionary. I am using this file because it's the only copy of the source data I can find and I want to build some Disparate Impact Analysis demos and it's a nice dataset to use.

The source data used in hmda_sample_for_paper.py is a hardcoded path that's not available. So I think there is some disconnect here. It also contains many more fields than are present in the hmda_lar_2018_orig_mtg_sample.csv file -- more refined information, so instead of just derived_race (a summary of race of applicant & co-applicant), it will have 5 race fields for each applicant (primary and co-).

Add README to data directory

  • A simple README in the data directory pointing out information about certain files and scripts will make it easier to navigate this subdirectory.

Nick writing TODOs

  • Change [unwanted] social bias testing to discrimination testing
  • Change update lending data to mortgage data
  • Write simulated data description
  • Update correct mortgage data description
  • In methods and materials:
    • Discrimination definitions
    • Causes of discrimination
    • Discrimination testing definitions
  • In results section:
    • Simulated data discrimination testing results
    • Mortgage data discrimination testing results
  • In discussion section:
    • Impact of Discrimination Testing on Model Use and Adoption
    • Viable Discrimination Remediation Approaches

Kim XNN TODOs

Features

  • Input feature list (hopefully informed by @navdeep-G using GBM Shapley)

For simulated data

  • Unconstrained feedforward ANN trained w/ 5-fold CV with training/CV and test AUC, Accuracy, RMSE, logloss
  • XNN trained w/ 5-fold CV with training/CV and test AUC, Accuracy, RMSE, logloss
  • Mean local feature importance values across quintiles of predictions (by Shapley or gradient-based) for XNN for top 5 features
  • Ridge function curves for XNN for top 5 features
  • ICE curves at quintiles of predictions for XNN for top 5 features

For mortgage data

  • Unconstrained feedforward ANN trained w/ 5-fold CV with training/CV and test AUC, Accuracy, RMSE
  • XNN trained w/ 5-fold CV with training/CV and test AUC, Accuracy, RMSE
  • Mean local feature importance values across quintiles of predictions (by Shapley or gradient-based) for XNN for top 5 features
  • Ridge function curves for XNN for top 5 features
  • ICE curves at quintiles of predictions for XNN for top 5 features

Fairness

  • Pandas frame of predictions and row IDs for the test data for @nickpschmidt to conduct discrimination testing for XNN

Nick coding TODOs

  • Discrimination testing for simulated data
  • Discrimination testing for mortgage data

Patrick writing TODOs

Methods and Materials section

  • Introduce unconstrained and constrained models
  • Send for editing
  • Introduce explanatory methods
  • Send for editing
  • Minimize self-plagiarism in explanatory methods section
  • Send for editing
  • Add useful Python packages into software section
  • Send for editing

Results section

  • Simulated data results
  • Send for editing
  • Mortgage data results
  • Send for editing

Discussion section

  • The Burgeoning Ecosystem of Interpretable Models section
  • Send for editing
  • Intersectionality of Interpretability, Fairness, and Security section
  • Send for editing

Conclusion

  • Conclusion
  • Send for editing

General

  • General editing and double checking

Add README to notebooks directory

  • A simple README in the notebooks directory pointing out information about certain files and scripts will make it easier to navigate this subdirectory.

Navdeep MGBM TODOs

Features

  • Input feature list
  • Global feature importance rankings for @kmontgom2400

For mortgage data

  • Modelling:
    • Unconstrained GBM trained w/ random grid search and 5-fold CV with training/CV and test AUC, Accuracy, RMSE
    • constrained MGBM trained w/ random grid search and 5-fold CV with training/CV and test AUC, Accuracy, RMSE
  • MLI:
    • Mean local feature importance values across quantiles of predictions (by Shapley) for MGBM for top 3 features
    • Partial dependence curves for MGBM for top 3 features
    • ICE curves at quantiles of predictions for MGBM for top 3 features

For simulated data

  • Modelling:
    • Unconstrained GBM trained w/ random grid search and 5-fold CV with training/CV and test AUC, Accuracy, RMSE
    • constrained MGBM trained w/ random grid search and 5-fold CV with training/CV and test AUC, Accuracy, RMSE
  • MLI:
    • Mean local feature importance values across quantiles of predictions (by Shapley) for MGBM for top 3 features
    • Partial dependence curves for MGBM for top 3 features
    • ICE curves at quantiles of predictions for MGBM for top 3 features

Fairness

  • Pandas frame of predictions and row IDs for the test data for @nickpschmidt to conduct discrimination testing for MGBM
    • Models are saved under /models. Just need to use the .predict() function on data to get predictions.

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.