Demos of how to use various interpretability techniques (with accompanying slides here or pdf here) and code for implementations of interpretable machine learning models.
The demos are contained in 3 main notebooks, summarized in cheat_sheet.pdf
- model_based.ipynb - how to use different interpretable models
- posthoc.ipynb - different simple analyses to interpret a trained model
- uncertainty.ipynb - code to get uncertainty estimates for a model
Provides scikit-learn style wrappers/implementations of different interpretable models (see readmes in individual folders within imodels for details)
- bayesian rule lists
- optimal classification tree
- rulefit
- sparse integer linear models (simple, unstable implementation)
The interpretable models within the imodels folder can be easily installed and used.
pip install git+https://github.com/Pacmed/interpretability-implementations-demos
from imodels import RuleListClassifier, RuleFit
model = RuleListClassifier() # RuleFit()
model.fit(X_train, y_train)
model.score(X_test, y_test)
preds = model.predict(X_test)