SHAP values give the contribution of a model feature to a prediction. This is also true when we use SHAP for classification. Expect, for binary target variables, we interpret these values in terms of log odds. For multiclass targets, we use softmax. We will:
- Discuss these interpretations in more depth
- Give the code for displaying SHAP plots for classification problems
- Explore new ways of aggregating SHAP values for multiclass targets
You can also watch this video on the topic:
Previous SHAP tutorial
We continue on from a previous SHAP tutorial. It goes into depth on SHAP plots for a continuous target variable. You will see that these plots and their insights are similar for categorical target variables. You can also find the full project on GitHub.
Introduction to SHAP with Python
How to create and interpret SHAP plots: waterfall, force, mean SHAP, beeswarm and dependence
To summarise, we used SHAP to explain a model built using the abalone dataset. This has 4,177 instances and you can see examples of the features below. We use the 8 features to predict y — the number of rings in the abalone’s shell. The rings are related to the age of the abalone. In this tutorial, we will bin y into different groups to create binary and multiclass target variables.