Global Explanations for Deep Neural Networks
Project description
GAM (Global Attribution Mapping)
Global Explanations for Deep Neural Networks
GAM explains the landscape of neural network predictions across subpopulations.
This implementation is based on "Global Explanations for Neural Networks: Mapping the Landscape of Predictions" (AAAI/ACM AIES 2019).
Installation
python3 -m pip install gam
Get Started
First generate local attributions using your favorite technique, then:
>>> from gam.gam import GAM
>>> # for a quick example use `attributions_path="tests/test_attributes.csv"`
>>> # Input/Output: csv (columns: features, rows: local/global attribution)
>>> gam = GAM(attributions_path="<path_to_your_attributes>.csv", distance="spearman", k=2)
>>> gam.generate()
>>> gam.explanations
[[('height', .6), ('weight', .3), ('hair color', .1)],
[('weight', .9), ('weight', .05), ('hair color', .05)]]
>>> gam.subpopulation_sizes
[90, 10]
>>> gam.subpopulations
# global explanation assignment
[0, 1, 0, 0,...]
>>> gam.plot()
# bar chart of feature importance with subpopulation size
Tests
To run tests:
$ python -m pytest tests/
Contributors
We welcome Your interest in Capital One’s Open Source Projects (the “Project”). Any Contributor to the Project must accept and sign an Agreement indicating agreement to the license terms below. Except for the license granted in this Agreement to Capital One and to recipients of software distributed by Capital One, You reserve all right, title, and interest in and to Your Contributions; this Agreement does not impact Your rights to use Your own Contributions for any other purpose.
Code of Conduct
This project adheres to the Open Code of Conduct By participating, you are expected to honor this code.
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 gam-1.3.0.tar.gz
.
File metadata
- Download URL: gam-1.3.0.tar.gz
- Upload date:
- Size: 23.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.7.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec2a4d1ae0db30db4e8fe00549a5a9e7c7db401b931ae1e0782c82a037e6ddfa |
|
MD5 | e87043634fb931ad0c09fa619bfb7bfb |
|
BLAKE2b-256 | af86ad62c5010478a94a0ff4429004efbccf1874bab9cadea00f8d994c308a4e |
File details
Details for the file gam-1.3.0-py3-none-any.whl
.
File metadata
- Download URL: gam-1.3.0-py3-none-any.whl
- Upload date:
- Size: 26.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.7.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc6066d2202de70891ba1bb17f31feff35de4312d0047af584a33f04ae63096a |
|
MD5 | 77d0d2ce0fd3dd458843fd22a17e3b2d |
|
BLAKE2b-256 | ebdc438a86ff274517a3dadcfa39e29a98efc3f91a95dd2f9bf502fcb4685116 |