Getting started with SHAP
In this section, we will first install SHAP. This version of SHAP includes algorithms and visualizations. The programs come mainly from Su-In Lee's lab at the University of Washington and Microsoft Research.
Once we have installed SHAP, we will import the data, split the datasets, and build a data interception function to target specific features.
Let's start by installing SHAP.
Open SHAP_IMDB.ipynb
in Google Colaboratory. We will be using this notebook throughout this chapter.
Installing SHAP
You can install SHAP with one line of code:
# @title SHAP installation
!pip install shap
However, if you restart Colaboratory, you might lose this installation. You can verify if SHAP is installed with the following code:
# @title SHAP installation
try:
import shap
except:
!pip install shap
Next, we will import the modules we will be using.
Importing the modules
Each module has a specific prerequisite...