[Paper Review] shapiq: Shapley Interactions for Machine Learning
Introduces shapiq, an open-source Python library that unifies and benchmarks methods to compute Shapley Values (SVs) and any-order Shapley Interactions (SIs) for machine learning, with an application-agnostic interface and a benchmarking suite across multiple domains.
Originally rooted in game theory, the Shapley Value (SV) has recently become an important tool in machine learning research. Perhaps most notably, it is used for feature attribution and data valuation in explainable artificial intelligence. Shapley Interactions (SIs) naturally extend the SV and address its limitations by assigning joint contributions to groups of entities, which enhance understanding of black box machine learning models. Due to the exponential complexity of computing SVs and SIs, various methods have been proposed that exploit structural assumptions or yield probabilistic estimates given limited resources. In this work, we introduce shapiq, an open-source Python package that unifies state-of-the-art algorithms to efficiently compute SVs and any-order SIs in an application-agnostic framework. Moreover, it includes a benchmarking suite containing 11 machine learning applications of SIs with pre-computed games and ground-truth values to systematically assess computational performance across domains. For practitioners, shapiq is able to explain and visualize any-order feature interactions in predictions of models, including vision transformers, language models, as well as XGBoost and LightGBM with TreeSHAP-IQ. With shapiq, we extend shap beyond feature attributions and consolidate the application of SVs and SIs in machine learning that facilitates future research. The source code and documentation are available at https://github.com/mmschlk/shapiq.
Motivation & Objective
- Provide an application-agnostic framework to compute SVs and any-order SIs in ML.
- Unify state-of-the-art SI approximation algorithms under a single interface.
- Offer explanation APIs to explain and visualize interactions in model predictions.
- Provide a benchmarking suite with pre-computed ground-truth SI values across domains to guide researchers.
- Facilitate research and visualization of feature interactions beyond standard feature attributions.
Proposed method
- Implement an approximation interface for SI algorithms across multiple interaction indices and orders.
- Include an ExactComputer for exact computation of 18 interaction indices and MI representations.
- Provide a CoalitionSampler interface to improve approximation via sampling techniques like border- and pairing-tricks.
- Offer a suite of 11 benchmark games spanning real-world ML domains with pre-computed SI ground-truths for evaluation.
- Expose an Explainer API to generate and visualize any-order feature interactions for predictions.
- Integrate with TreeSHAP-IQ for efficient explanations on tree-based models and support for common ML libraries.
Experimental results
Research questions
- RQ1How can Shapley Interactions be computed efficiently for any-order interactions in ML models?
- RQ2Can a unified API support multiple SI indices and approximation methods across diverse model types and data domains?
- RQ3To what extent do SI approximators approximate ground-truth SI values under practical resource constraints?
- RQ4How can researchers benchmark and visualize higher-order interactions across real-world datasets and models?
Key findings
- shapiq provides an open-source library unifying state-of-the-art SI algorithms and exact computation for small games.
- It covers 18 interaction indices and game-theoretic concepts, including Möbius Interactions as the highest-order representation.
- The package includes a benchmarking suite with 11 benchmark games across multiple real-world ML domains and pre-computed SI ground-truths across 2,042 configurations.
- It enables explanations and visualizations of any-order feature interactions for models such as vision transformers, language models, XGBoost, and LightGBM (TreeSHAP-IQ).
- shapiq extends Shapley-based explanations beyond feature attributions, supporting research in ML game theory and SI applications.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.