Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/marcotcr/anchor
Code for "High-Precision Model-Agnostic Explanations" paper
https://github.com/marcotcr/anchor
Last synced: 2 days ago
JSON representation
Code for "High-Precision Model-Agnostic Explanations" paper
- Host: GitHub
- URL: https://github.com/marcotcr/anchor
- Owner: marcotcr
- License: bsd-2-clause
- Created: 2018-02-02T23:38:50.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2022-07-19T18:09:12.000Z (over 2 years ago)
- Last Synced: 2024-04-29T09:34:58.191Z (6 months ago)
- Language: Jupyter Notebook
- Size: 16.4 MB
- Stars: 783
- Watchers: 27
- Forks: 115
- Open Issues: 25
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- Awesome-AIML-Data-Ops - anchor - Code for the paper ["High precision model agnostic explanations"](https://homes.cs.washington.edu/~marcotcr/aaai18.pdf), a model-agnostic system that explains the behaviour of complex models with high-precision rules called anchors. (Explaining Black Box Models and Datasets)
- awesome-production-machine-learning - anchor - Code for the paper ["High precision model agnostic explanations"](https://homes.cs.washington.edu/~marcotcr/aaai18.pdf), a model-agnostic system that explains the behaviour of complex models with high-precision rules called anchors. (Explaining Black Box Models and Datasets)
- awesome-production-machine-learning - anchor - Code for the paper ["High precision model agnostic explanations"](https://homes.cs.washington.edu/~marcotcr/aaai18.pdf), a model-agnostic system that explains the behaviour of complex models with high-precision rules called anchors. (Explainability and Fairness)
- Awesome-explainable-AI - https://github.com/marcotcr/anchor - learn ![](https://img.shields.io/github/stars/marcotcr/anchor?style=social) (Python Libraries(sort in alphabeta order) / Evaluation methods)
- awesome-python-machine-learning-resources - GitHub - 27% open · ⏱️ 19.07.2022): (模型的可解释性)
README
# Anchor
This repository has code for the paper [*High-Precision Model-Agnostic Explanations*](https://homes.cs.washington.edu/~marcotcr/aaai18.pdf).An anchor explanation is a rule that sufficiently “anchors” the
prediction locally – such that changes to the rest of the feature
values of the instance do not matter. In other words, for instances on which the anchor holds, the prediction is (almost)
always the same.At the moment, we support explaining individual predictions for text classifiers or classifiers that act on tables (numpy arrays of numerical or categorical data). If there is enough interest, I can include code and examples for images.
The anchor method is able to explain any black box classifier, with two or more classes. All we require is that the classifier implements a function that takes in raw text or a numpy array and outputs a prediction (integer)
## Installation
The Anchor package is on pypi. Simply run:pip install anchor-exp
Or clone the repository and run:python setup.py install
If you want to use `AnchorTextExplainer`, you have to run the following:
python -m spacy download en_core_web_lg
And if you want to use BERT to perturb inputs (recommended), also install transformers:
pip install torch transformers spacy && python -m spacy download en_core_web_sm
#### Examples
See notebooks folder for tutorials. Note that from version 0.0.1.0, it only works on python 3.- [Tabular data](https://github.com/marcotcr/anchor/blob/master/notebooks/Anchor%20on%20tabular%20data.ipynb)
- [Text data](https://github.com/marcotcr/anchor/blob/master/notebooks/Anchor%20for%20text.ipynb)## Citation
[Here](https://homes.cs.washington.edu/~marcotcr/aaai18.bib) is the bibtex if you want to cite this work.