Awesome Open Source
Awesome Open Source

==== ELI5

.. image:: :target: :alt: PyPI Version

.. image:: :target: :alt: Build Status

.. image:: :target: :alt: Code Coverage

.. image:: :target: :alt: Documentation

ELI5 is a Python package which helps to debug machine learning classifiers and explain their predictions.

.. image:: :alt: explain_prediction for text data

.. image:: :alt: explain_prediction for image data

It provides support for the following machine learning frameworks and packages:

  • scikit-learn_. Currently ELI5 allows to explain weights and predictions of scikit-learn linear classifiers and regressors, print decision trees as text or as SVG, show feature importances and explain predictions of decision trees and tree-based ensembles. ELI5 understands text processing utilities from scikit-learn and can highlight text data accordingly. Pipeline and FeatureUnion are supported. It also allows to debug scikit-learn pipelines which contain HashingVectorizer, by undoing hashing.

  • Keras_ - explain predictions of image classifiers via Grad-CAM visualizations.

  • xgboost_ - show feature importances and explain predictions of XGBClassifier, XGBRegressor and xgboost.Booster.

  • LightGBM_ - show feature importances and explain predictions of LGBMClassifier and LGBMRegressor.

  • CatBoost_ - show feature importances of CatBoostClassifier, CatBoostRegressor and catboost.CatBoost.

  • lightning_ - explain weights and predictions of lightning classifiers and regressors.

  • sklearn-crfsuite_. ELI5 allows to check weights of sklearn_crfsuite.CRF models.

ELI5 also implements several algorithms for inspecting black-box models (see Inspecting Black-Box Estimators_):

  • TextExplainer_ allows to explain predictions of any text classifier using LIME_ algorithm (Ribeiro et al., 2016). There are utilities for using LIME with non-text data and arbitrary black-box classifiers as well, but this feature is currently experimental.
  • Permutation importance_ method can be used to compute feature importances for black box estimators.

Explanation and formatting are separated; you can get text-based explanation to display in console, HTML version embeddable in an IPython notebook or web dashboards, a pandas.DataFrame object if you want to process results further, or JSON version which allows to implement custom rendering and formatting on a client.

.. _lightning: .. _scikit-learn: .. _sklearn-crfsuite: .. _LIME: .. _TextExplainer: .. _xgboost: .. _LightGBM: .. _Catboost: .. _Keras: .. _Permutation importance: .. _Inspecting Black-Box Estimators:

License is MIT.

Check docs <>_ for more.

.. image:: :target: :alt: define hyperiongray

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
python (55,543
jupyter-notebook (6,449
machine-learning (3,740
nlp (1,119
data-science (924
scikit-learn (213
xgboost (63
lightgbm (39