Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
I

interpret

> DevOps
Open source

Fit interpretable models. Explain blackbox machine learning.

6.9K stars0 likes0 views
WebsiteGitHub

About

Fit interpretable models. Explain blackbox machine learning.

# InterpretML
> ### In the beginning machines learned in darkness, and data scientists struggled in the void to explain them. > ### Let there be light. InterpretML is an open-source package that incorporates state-of-the-art machine learning interpretability techniques under one roof. With this package, you can train interpretable glassbox models and explain blackbox systems. InterpretML helps you understand your model's global behavior, or understand the reasons behind individual predictions. Interpretability is essential for: - Model debugging - Why did my model make this mistake? - Feature Engineering - How can I improve my model? - Detecting fairness issues - Does my model discriminate? - Human-AI cooperation - How can I understand and trust the model's decisions? - Regulatory compliance - Does my model satisfy legal requirements? - High-risk applications - Healthcare, finance, judicial, ... # Installation Python 3.10+ | Linux, Mac, Windows ```sh pip install interpret # OR conda install -c conda-forge interpret ``` # Introducing the Explainable Boosting Machine (EBM) EBM is an interpretable model developed at Microsoft Research[*](#citations). It uses modern machine learning techniques like bagging, gradient boosting, and automatic interaction detection to breathe new life into traditional GAMs (Generalized Additive Models). This makes EBMs as accurate as state-of-the-art techniques like random forests and gradient boosted trees. However, unlike these blackbox models, EBMs produce exact explanations and are editable by domain experts. | Dataset/AUROC | Domain | Logistic Regression | Random Forest | XGBoost | Explainable Boosting Machine | |---------------|---------|:-------------------:|:-------------:|:---------------:|:----------------------------:| | Adult Income | Finance | .907±.003 | .903±.002 | .927±.001 | **_.928±.002_** | | Heart Disease | Medical | .895±.030 | .890±.008 | .851±.018 | **_.898±.013_** | | Breast Cancer | Medical | **_.995±.005_** | .992±.009 | .992±.010 | **_.995±.006_** | | Telecom Churn | Business| .849±.005 | .824±.004 | .828±.010 | **_.852±.006_** | | Credit Fraud | Security| .979±.002 | .950±.007 | **_.981±.003_** | **_.981±.003_** | [*Notebook for reproducing table*](https://nbviewer.jupyter.org/github/interpretml/interpret/blob/main/docs/benchmarks/ebm-classification-comparison.ipynb) # Supported Techniques | Interpretability Technique | Type | |-----------------------------|--------------------| | [Explainable Boosting](https://interpret.ml/docs/ebm.html) | glassbox model | | [APLR](https://interpret.ml/docs/aplr.html) | glassbox model | | [Decision Tree](https://interpret.ml/docs/dt.html) | glassbox model | | [Decision Rule List](https://interpret.ml/docs/dr.html) | glassbox model | | [Linear/Logistic Regression](https://interpret.ml/docs/lr.html) | glassbox model | | [SHAP Kernel Explainer](https://interpret.ml/docs/shap.html) | blackbox explainer | | [LIME](https://interpret.ml/docs/lime.html) | blackbox explainer | | [Morris Sensitivity Analysis](https://interpret.ml/docs/msa.html) | blackbox explainer | | [Partial Dependence](https://interpret.ml/docs/pdp.html) | blackbox explainer | # Train a glassbox model Let's fit an Explainable Boosting Machine ```python from interpret.glassbox import ExplainableBoostingClassifier ebm = ExplainableBoostingClassifier() ebm.fit(X_train, y_train) # or substitute with LogisticRegression, DecisionTreeClassifier, RuleListClassifier, ... # EBM supports pandas dataframes, numpy arrays, and handles "string" data natively. ``` Understand the model ```python from interpret import show ebm_global = ebm.explain_global() show(ebm_global) ```
Understand individual predictions ```python ebm_local = ebm.explain_local(X_test, y_test) show(ebm_local) ```
And if you have multiple model explanations, compare them ```python show([logistic_regression_global, decision_tree_global]) ```
If you need to keep your data private, use Differentially Private EBMs (see [DP-EBMs](https://proceedings.mlr.press/v139/nori21a/nori21a.pdf)) ```python from interpret.privacy import DPExplainableBoostingClassifier, DPExplainableBoostingRegressor dp_ebm = DPExplainableBoostingClassifier(epsilon=1, delta=1e-5) # Specify privacy parameters dp_ebm.fit(X_train, y_train) show(dp_ebm.explain_global()) # Identical function calls to standard EBMs ```

For more information, see the [documentation](https://interpret.ml/docs).
EBMs include pairwise interactions by default. For 3-way interactions and higher see this notebook: https://interpret.ml/docs/python/examples/custom-interactions.html
Interpret EBMs can be fit on datasets with 100 million samples in several hours. For larger workloads consider using distributed EBMs on Azure SynapseML: [classification EBMs](https://learn.microsoft.com/en-us/fabric/data-science/explainable-boosting-machines-classification) and [regression EBMs](https://learn.microsoft.com/en-us/fabric/data-science/explainable-boosting-machines-regression)

# Acknowledgements InterpretML was originally created by (equal contributions): Samuel Jenkins, Harsha Nori, Paul Koch, and Rich Caruana EBMs are fast derivative of GA2M, invented by: Yin Lou, Rich Caruana, Johannes Gehrke, and Giles Hooker Many people have supported us along the way. Check out [ACKNOWLEDGEMENTS.md](./ACKNOWLEDGEMENTS.md)! We also build on top of many great packages. Please check them out! [plotly](https://github.com/plotly/plotly.py) | [dash](https://github.com/plotly/dash) | [scikit-learn](https://github.com/scikit-learn/scikit-learn) | [lime](https://github.com/marcotcr/lime) | [shap](https://github.com/slundberg/shap) | [salib](https://github.com/SALib/SALib) | [skope-rules](https://github.com/scikit-learn-contrib/skope-rules) | [treeinterpreter](https://github.com/andosa/treeinterpreter) | [gevent](https://github.com/gevent/gevent) | [joblib](https://github.com/joblib/joblib) | [pytest](https://github.com/pytest-dev/pytest) | [jupyter](https://github.com/jupyter/notebook) # Citations InterpretML
"InterpretML: A Unified Framework for Machine Learning Interpretability" (H. Nori, S. Jenkins, P. Koch, and R. Caruana 2019)
@article{nori2019interpretml,
  title={InterpretML: A Unified Framework for Machine Learning Interpretability},
  author={Nori, Harsha and Jenkins, Samuel and Koch, Paul and Caruana, Rich},
  journal={arXiv preprint arXiv:1909.09223},
  year={2019}
}
    
Paper link
Explainable Boosting
"Intelligible models for healthcare: Predicting pneumonia risk and hospital 30-day readmission" (R. Caruana, Y. Lou, J. Gehrke, P. Koch, M. Sturm, and N. Elhadad 2015)
@inproceedings{caruana2015intelligible,
  title={Intelligible models for healthcare: Predicting pneumonia risk and hospital 30-day readmission},
  author={Caruana, Rich and Lou, Yin and Gehrke, Johannes and Koch, Paul and Sturm, Marc and Elhadad, Noemie},
  booktitle={Proceedings of the 21th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining},
  pages={1721--1730},
  year={2015},
  organization={ACM}
}
    
Paper link "Accurate intelligible models with pairwise interactions" (Y. Lou, R. Caruana, J. Gehrke, and G. Hooker 2013)
@inproceedings{lou2013accurate,
  title={Accurate intelligible models with pairwise interactions},
  author={Lou, Yin and Caruana, Rich and Gehrke, Johannes and Hooker, Giles},
  booktitle={Proceedings of the 19th ACM SIGKDD international conference on Knowledge discovery and data mining},
  pages={623--631},
  year={2013},
  organization={ACM}
}
    
Paper link "Intelligible models for classification and regression" (Y. Lou, R. Caruana, and J. Gehrke 2012)
@inproceedings{lou2012intelligible,
  title={Intelligible models for classification and regression},
  author={Lou, Yin and Caruana, Rich and Gehrke, Johannes},
  booktitle={Proceedings of the 18th ACM SIGKDD international conference on Knowledge discovery and data mining},
  pages={150--158},
  year={2012},
  organization={ACM}
}
    
Paper link "Interpretability, Then What? Editing Machine Learning Models to Reflect Human Knowledge and Values" (Zijie J. Wang, Alex Kale, Harsha Nori, Peter Stella, Mark E. Nunnally, Duen Horng Chau, Mihaela Vorvoreanu, Jennifer Wortman Vaughan, Rich Caruana 2022)
@article{wang2022interpretability,
  title={Interpretability, Then What? Editing Machine Learning Models to Reflect Human Knowledge and Values},
  author={Wang, Zijie J and Kale, Alex and Nori, Harsha and Stella, Peter and Nunnally, Mark E and Chau, Duen Horng and Vorvoreanu, Mihaela and Vaughan, Jennifer Wortman and Caruana, Rich},
  journal={arXiv preprint arXiv:2206.15465},
  year={2022}
}
    
Paper link "Axiomatic Interpretability for Multiclass Additive Models" (X. Zhang, S. Tan, P. Koch, Y. Lou, U. Chajewska, and R. Caruana 2019)
@inproceedings{zhang2019axiomatic,
  title={Axiomatic Interpretability for Multiclass Additive Models},
  author={Zhang, Xuezhou and Tan, Sarah and Koch, Paul and Lou, Yin and Chajewska, Urszula and Caruana, Rich},
  booktitle={Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery \& Data Mining},
  pages={226--234},
  year={2019},
  organization={ACM}
}
    
Paper link "Distill-and-compare: auditing black-box models using transparent model distillation" (S. Tan, R. Caruana, G. Hooker, and Y. Lou 2018)
@inproceedings{tan2018distill,
  title={Distill-and-compare: auditing black-box models using transparent model distillation},
  author={Tan, Sarah and Caruana, Rich and Hooker, Giles and Lou, Yin},
  booktitle={Proceedings of the 2018 AAAI/ACM Conference on AI, Ethics, and Society},
  pages={303--310},
  year={2018},
  organization={ACM}
}
    
Paper link "Purifying Interaction Effects with the Functional ANOVA: An Efficient Algorithm for Recovering Identifiable Additive Models" (B. Lengerich, S. Tan, C. Chang, G. Hooker, R. Caruana 2019)
@article{lengerich2019purifying,
  title={Purifying Interaction Effects with the Functional ANOVA: An Efficient Algorithm for Recovering Identifiable Additive Model

GitHub Issues· 0 open

View all on GitHub

No open issues yet, or sync has not completed.

Highlights

  • •Model debugging - Why did my model make this mistake?
  • •Feature Engineering - How can I improve my model?
  • •Detecting fairness issues - Does my model discriminate?
  • •Human-AI cooperation - How can I understand and trust the model's decisions?
  • •Regulatory compliance - Does my model satisfy legal requirements?
  • •High-risk applications - Healthcare, finance, judicial, ...

> Tags

C++aiartificial-intelligencebiasblackbox

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
CategoryDevOps
PricingOpen source

> Related tools

D
Docker
容器化平台,标准化应用交付
G
GitHub Actions
GitHub 原生 CI/CD 工作流
N
Nginx
高性能 Web 服务器与反向代理