Explainable artificial intelligence (XAI) seeks to provide transparency to machine learning models, enabling users tounderstand how and why predictions are generated. Among XAI techniques, Shapley additive explanations (SHAP) is widely used for offering global and local explanations by ranking features according to their contributions to model outputs. However, traditional SHAP‐based methods primarily emphasize global interpretation and do not explicitly show how individual features differentiate between two specific classes at the local level. This work introduces SHAP‐LCD (SHAP for local class differentiation), a novel local explainability method that establishes a mathematical relationship between changes in class probabilities and SHAP‐based feature contributions. This linkage allows a detailed, instance‐level analysis of how features drive class differentiation in classification models. The approach was evaluated on several tabular datasets, including Iris, Wine, and Vehicle Silhouettes, by comparing SHAP values with feature distributions through density plots. It was also applied to an image dataset (Fashion‐MNIST), where heatmaps identify pixels responsible for distinguishing between classes. Results show that strong class probability differences correspond to well‐separated feature distributions, whereas small probability differences align with overlapping distributions, indicating greater classification difficulty. Overall, SHAP‐LCD provides a consistent, model‐agnostic tool for interpreting class differentiation across tabular and image domains.
Luna et al. (Wed,) studied this question.