A Python package to run GAM Changer in your computation notebooks.
Project description
Interactive visualization tool to help domain experts and data scientists easily and responsibly edit Generalized Additive Models (GAMs).
📺 Video | 📖 "Interpretability, Then What? Editing Machine Learning Models to Reflect Human Knowledge and Values" |
GAM Changer Features
Get Started
For a live demo, visit: http://interpret.ml/gam-changer/
How to Edit My Own GAMs?
You can use this demo to edit your own GAMs: choose the my model
tab and upload the model.json
(model weights) and sample.json
(sample data to evaluate the model).
If you use EBM, you can generate these two files easily with the GAM Changer python package.
# First install the GAM Changer python package
pip install gamchanger
import gamchanger as gc
from json import dump
# Extract model weights
model_data = gc.get_model_data(ebm)
# Generate sample data
sample_data = gc.get_sample_data(ebm, x_test, y_test)
# Save to `model.json` and `sample.json`
dump(model_data, open('./model.json', 'w'))
dump(sample_data, open('./sample.json', 'w'))
Computational Notebook Widget
You can use GAM Changer directly in your computational notebooks (e.g., Jupyter Notebook, VSCode Notebook, Google Colab).
Check out three live notebook demos below.
Jupyter Lite | Binder | Google Colab |
---|---|---|
Use the following snippet to load GAM Changer in your favorite notebooks:
# Install the GAM Changer python package
!pip install gamchanger
import gamchanger as gc
# Load GAM Changer with the model and sample data
gc.visualize(ebm, x_feed, y_feed)
Load Edited Models
After finishing editing a model, you can save the new model along with all the editing history to a *.gamchanger
file by clicking the save button. You can load the new model in Python:
from json import load
import gamchanger as gc
# Load the `*.gamchanger` file
gc_dict = load(open('./edit-8-27-2021.gamchanger', 'r'))
# This will return a deep copy of your original EBM where edits are applied
new_ebm = gc.get_edited_model(ebm, gc_dict)
Development
Clone or download this repository:
git clone git@github.com:interpretml/gam-changer.git
# use degit if you don't want to download commit histories
degit interpretml/gam-changer.git
Install the dependencies:
npm install
Then run GAM Changer:
npm run dev
Navigate to localhost:5000. You should see GAM Changer running in your browser :)
Credits
GAM Changer is created by Jay Wang, Alex Kale, Harsha Nori, Peter Stella, Mark Nunnally, Polo Chau, Mickey Vorvoreanu, Jenn Wortman Vaughan, and Rich Caruana, which was the result of a research collaboration between Microsoft Research, NYU Langone Health, Georgia Tech and University of Washington. Jay Wang and Alex Kale were summer interns at Microsoft Research.
We thank Steven Drucker, Adam Fourney, Saleema Amershi, Dean Carignan, Rob DeLine, Haekyu Park, and the InterpretML team for their support and constructive feedback.
Citation
@inproceedings{wangInterpretabilityThenWhat2022,
title = {Interpretability, {{Then What}}? {{Editing Machine Learning Models}} to {{Reflect Human Knowledge}} and {{Values}}},
shorttitle = {Interpretability, {{Then What}}?},
booktitle = {Proceedings of the 28th {{ACM SIGKDD International Conference}} on {{Knowledge Discovery}} \& {{Data Mining}}},
author = {Wang, Zijie J. and Kale, Alex and Nori, Harsha and Stella, Peter and Nunnally, Mark E. and Chau, Duen Horng and Vorvoreanu, Mihaela and Vaughan, Jennifer Wortman and Caruana, Rich},
year = {2022},
url = {https://interpret.ml/gam-changer},
}
License
The software is available under the MIT License.
Contact
If you have any questions, feel free to open an issue or contact Jay Wang.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file gamchanger-0.1.13.tar.gz
.
File metadata
- Download URL: gamchanger-0.1.13.tar.gz
- Upload date:
- Size: 195.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c31ee6991158a625229c56b1c37559f121141a9cf2742248a9ba05e7cf7879d |
|
MD5 | 7ae29d8b1c34dc09d27e5788c0e3fc60 |
|
BLAKE2b-256 | 65b99a1202cb59856a1a41533ff1ed3bd744633bfc8ce45ce897667764fb7ec3 |
File details
Details for the file gamchanger-0.1.13-py2.py3-none-any.whl
.
File metadata
- Download URL: gamchanger-0.1.13-py2.py3-none-any.whl
- Upload date:
- Size: 200.8 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1fd7e5f169ae59bbd8d45da8ef6dc28df41d85848a45b81f0e4966dba81db79 |
|
MD5 | d6fedc38ef509e7c6e6db60e87b280fd |
|
BLAKE2b-256 | 366e7a6e5788bdbda3cad3fcd66fb5109a07a3d4719ae8af2af4730821d0a8a2 |