Leveraging SHAP’s KernelExplainer for local interpretations with SHAP values
For this section, and for subsequent use, we will train a Support Vector Classifier (SVC) model first.
Training a C-SVC model
SVM is a family of model classes that operate in high-dimensional space to find an optimal hyperplane, where they attempt to separate the classes with the maximum margin between them. Support vectors are the points closest to the decision boundary (the dividing hyperplane) that would change it if were removed. To find the best hyperplane, they use a cost function called hinge loss and a computationally cheap method to operate in high-dimensional space, called the kernel trick, and even though a hyperplane suggests linear separability, it’s not always limited to a linear kernel.
The scikit-learn implementation we will use is called C-SVC. SVC uses an L2 regularization parameter called C and, by default, uses a kernel called the Radial Basis Function (RBF),...