nshap
Contents:
Installation
Examples
Example 1: Interaction Indices for a Gradient Boosted Tree on the Folktables Income data set
Example 2: An Illustration of Recovery for a Function with Variable Interactions
Example 3: Custom value functions
Documentation
nshap
Examples
View page source
Examples
Contents:
Example 1: Interaction Indices for a Gradient Boosted Tree on the Folktables Income data set
Load the data
Train the classifier
Define the value function
Compute n-Shapley Values
Let’s compare this to the Shapley Values from the shap package
Now, let us repeat this exercise with the the Shapley Taylor interaction index
Now, the same exercise for Faith-Shap interaction index
Example 2: An Illustration of Recovery for a Function with Variable Interactions
The function
This function consists mostly of variable interaction of order 2, so the partial dependence plots of Shapley Values don’t have any clear structure
2-Shapley Values provide a representation of the function as a GAM
Example 3: Custom value functions
These examples are from section 5.1 of the Faith-Shap paper: https://arxiv.org/abs/2203.00870