Member-only story

Top Explainable AI (XAI) Python Frameworks in 2022

Moez Ali
5 min readJul 26, 2022

--

Python libraries for Explainable AI (XAI) data scientists must know in 2022

Photo by Parker Gibbons on Unsplash

Introduction

As AI has advanced, more intricate, opaque models have been created and used to tackle challenging issues. These models, in contrast to many prior models, are more challenging to comprehend and manage due to the design of their architecture. It can be challenging for developers and end users to identify the root cause of such models’ failures or failures that do not behave as anticipated or hoped for, or to come up with solutions to the issue. By revealing the underlying workings of these opaque models, XAI satisfies the burgeoning needs of AI engineering.

In this article I will talk about 6 popular Python frameworks for model interpretability and explainability.

SHAP

SHAP (SHapley Additive exPlanations) is a game theoretic approach to explain the output of any machine learning model. It connects optimal credit allocation with local explanations using the classic Shapley values from game theory and their related extensions (see papers for details and citations).

The contribution of each feature in the dataset to the prediction a model produces is explained by Shapley values. Lundberg and Lee’s SHAP algorithm was originally published in 2017 (link to the original paper) and ever since it is widely adopted by the community in many different fields.

Source: https://shap.readthedocs.io/

You can install shap library using pip or conda.

# install with pip
pip install shap
# install with conda
conda install -c conda-forge shap
Waterfall Plot built using Shap library

--

--

Moez Ali
Moez Ali

Written by Moez Ali

Data Scientist, Founder & Creator of PyCaret

Responses (6)

Write a response