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.
Metadata
Release files for gam 1.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| gam-1.3.0.tar.gz | 23.4 kB | Without provenance | Details for gam-1.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| gam-1.3.0-py3-none-any.whl | Python 3 | none | any | Details for gam-1.3.0-py3-none-any.whl |
Total release size: 49.3 kB
Release files / gam-1.3.0.tar.gz
| Download URL | gam-1.3.0.tar.gz |
|---|---|
| Size | 23.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ec2a4d1ae0db30db4e8fe00549a5a9e7c7db401b931ae1e0782c82a037e6ddfa
|
|
BLAKE2b-256 checksum How to use checksums |
af86ad62c5010478a94a0ff4429004efbccf1874bab9cadea00f8d994c308a4e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / gam-1.3.0-py3-none-any.whl
| Download URL | gam-1.3.0-py3-none-any.whl |
|---|---|
| Size | 26.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cc6066d2202de70891ba1bb17f31feff35de4312d0047af584a33f04ae63096a
|
|
BLAKE2b-256 checksum How to use checksums |
ebdc438a86ff274517a3dadcfa39e29a98efc3f91a95dd2f9bf502fcb4685116
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Security for gam 1.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.