- Game Theory Roots: Shapley values originate from cooperative game theory and were introduced by Lloyd Shapley in 1953. They provide a way to fairly distribute the total gains achieved by players in a cooperative game.
- Machine Learning Adaptation: In machine learning, the "game" is the process of generating a prediction. Features act as the "players" cooperating to produce the model's output. Shapley values determine how much each feature contributes to the final prediction.
Technical Description
- Consider All Coalitions: For a model with 'N' features, examine all possible coalitions (subsets) of features. For example, if you have 3 features {A, B, C}, possible coalitions are: {}, {A}, {B}, {C}, {A, B}, {A, C}, {B, C}, {A, B, C}.
- Marginal Contribution: For each coalition, calculate the difference in prediction (the payoff) between having that coalition of features present vs. absent. This difference is the marginal contribution of the features in that combination.
- Weighted Average: Do this for every possible coalition. Take a weighted average of all these marginal contributions, where the weights are based on the coalition sizes. The result is the Shapley value for a feature - representing its fair share of the overall model prediction.
Strengths
- Theoretical Fairness: Shapley values are the only attribution method satisfying these desirable properties: Efficiency, Symmetry, Dummy, Additivity. This provides a strong theoretical foundation for their use in explainability.
- Global Interpretability: Helps understand a model's overall behavior and the relative importance of each feature.
- Local Interpretability: Shapley values can be calculated for individual predictions, aiding in understanding why a model made a specific decision.
Weaknesses
- Computational Complexity: Exact calculation grows exponentially as the number of features increases. Approximation methods often become necessary for real-world problems with many features.
- Assumption Sensitivity: Assumes features are independent, which might not always hold true in practice.
- Explanatory Tool: Shapley values explain feature contributions but may not directly reveal causal relationships.
Real-World Use Cases
- Financial Risk Modeling: Determine factors most responsible for loan default risk or credit score predictions, supporting regulatory compliance and model fairness.
- Healthcare: Identify key biomarkers or patient attributes contributing to disease diagnosis, aiding in personalized medicine and understanding disease mechanisms.
- Customer Churn Prediction: Understand the factors driving customer churn, allowing for targeted interventions and retention strategies.
- Image Recognition: Explain the areas of an image most important for a classification decision, supporting trust and debugging of computer vision models.