Skip to content

rogerhe/interpret-community

 
 

Repository files navigation

Build Status MIT license versions

Interpret Community SDK

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.

Contents

Try our notebooks in your favorite cloud

Azure Notebooks Binder

Getting Started

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

Models

  • 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.
  • 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

Example

Contributing

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.

Code of Conduct

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.

Reporting Security Issues

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.

Build Status

Build Status

Additional References

About

Fit interpretable models. Explain blackbox machine learning.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 53.4%
  • JavaScript 24.7%
  • TypeScript 20.9%
  • Other 1.0%