Welcome to the Shapash documentation!#

Shapash logo

Shapash is a Python library that makes machine learning models interpretable and understandable by everyone. Its plots and outputs use explicit labels for features and their values, so data scientists can understand their models and share the results with people who don’t work with data. Shapash is developed by data scientists at MAIF.

Company

GitHub Account

Website

MAIF logo

MAIF GitHub

MAIF

Getting started

How Shapash works, in a few lines of code.

Getting started
Installation

Install Shapash and its optional extras.

Installation
Tutorials

Notebooks for every feature.

Tutorials
API reference

Classes, methods and parameters.

API reference

What Shapash does#

Clear, labeled explanations. Global and local explainability plots display readable feature names and values instead of technical ones.

Contribution plot of a feature

A web app to explore your model. Navigate from global to local explainability, filter subsets on explanatory or additional features, and compare correct and wrong predictions. See the live demo.

Shapash web app

Summarized local explanations. Keep only the most influential features of each prediction, and export the summary to a pandas DataFrame:

Summary of local explanations exported to pandas

Explainability quality metrics. Evaluate how far you can trust an explanation with three metrics: stability, consistency and compacity.

An audit report. Generate a standalone HTML report that records the data, the model and its explainability, as a basis for an audit document. See the example report.

Shapash report

From exploration to deployment. The SmartPredictor object brings predictions and summarized explanations to production, through an API or in batch mode.

Text classifiers (preview). NlpExplainer explains text classifiers at the word level, with its own web app, what-if analysis and label-noise detection.

Compatibility#

  • Regression, binary classification and multiclass classification.

  • Most scikit-learn, LightGBM, CatBoost and XGBoost models.

  • Contributions computed with SHAP or LIME, or provided directly, for example from another explainability method.

  • Preprocessing with category_encoders, a scikit-learn ColumnTransformer, or a simple dictionary of feature names.

Shapash is released under the Apache 2.0 license.