The Interpret Community builds on Interpret, an open source python package from Microsoft Research for training interpretable models and helping to explain blackbox systems, by adding additional extensions from the community to interpret ML models.
This repository contains an SDK and Jupyter notebooks with examples to showcase its use.
- Try our notebooks in your favorite cloud
- Getting Started
- Models
- Example
- Contributing
- Code of Conduct
- Build Status
- Additional References
This repo uses Anaconda to simplify package and environment management.
To setup on your local machine:
1. Set up Environment
a. Install Anaconda with Python >= 3.6
[Miniconda](https://conda.io/projects/conda/en/latest/user-guide/install/index.html) is a quick way to get started.
b. Create conda environment named interp and install packages
conda create --name interp python=3.6 anaconda
Optional, additional reading:
- [conda cheat sheet](https://docs.conda.io/projects/conda/en/4.6.0/_downloads/52a95608c49671267e40c689e0bc00ca/conda-cheatsheet.pdf)
- [jupyter](https://pypi.org/project/jupyter/)
- [nb_conda](https://github.com/Anaconda-Platform/nb_conda)
On Windows: c. Activate conda environment
activate interp
On Linux: c. Activate conda environment
source activate interp
2. Clone the interpret-community repository
Clone and cd into the repository
git clone https://github.com/Microsoft/Interpret-community
cd interpret-community
3. Install Python module, packages and necessary distributions
pip install -e ./python
If you intend to run repo tests:
pip install -r requirements.txt
4. Set up and run Jupyter Notebook server
Install and run Jupyter Notebook
if needed:
pip install jupyter
conda install nb_conda
then:
jupyter notebook
-
The API supports both dense (numpy or pandas) and sparse (scipy) datasets
-
For more advanced users, individual explainers can be used
-
The TabularExplainer provides local and global feature importances
- The best explainer is automatically chosen for the user based on the model
- Best implies fastest execution time and highest interpretabilty accuracy.
- The best explainer is automatically chosen for the user based on the model
-
Local feature importances are for each evaluation row
-
Global feature importances summarize the most importance features at the model-level
-
The KernelExplainer and MimicExplainer are for BlackBox models
-
The MimicExplainer is faster but less accurate than the KernelExplainer
-
The TreeExplainer is for tree-based models
-
The DeepExplainer is for DNN tensorflow or pytorch models shap and lime have docs
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
Security issues and bugs should be reported privately, via email, to the Microsoft Security Response Center (MSRC) at secure@microsoft.com. You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Further information, including the MSRC PGP key, can be found in the Security TechCenter.