Repository navigation
v1.9.0 (2026-12-03)
GraphSHAP-IQ for Graph Neural Networks #550
Adds GraphSHAP-IQ in shapiq.graph for exact Shapley values and interactions of the nodes of graph neural networks (Muschalik et al., 2025).
GraphExplainerexplainstorch_geometricmodels with a graph-level output, andshapiq.Explainerpicks it automatically for models with message passing layers.- As for trees, a graph is converted into an internal representation, the
GraphModel(edges, node features, and the radius of the receptive fields). The newGraphBaselineImputer, aBaselineImputerwhose players are the nodes, gives absent nodes the baseline node features. GraphSHAPIQcomputes the values of any game that is local on a graph without needingtorch. Withmax_interaction_size, it approximates them with fewer evaluations while keeping them efficient.shapiq_gamesandshapiq_benchmarkgain graph games:shapiq_games.GraphGame, theGraphComputerof their exact values with GraphSHAP-IQ (chosen bydefault_computerfor games that are local on the graph), andGraphSetup, which trains a GCN, GIN, or GAT on a TUDataset graph classification dataset (load_graph_dataset, e.g."MUTAG"or"PROTEINS"). Their exact values are feasible for graphs far beyond the 25 players of brute force.torch_geometricgraphs and models need the new extrashapiq[graph].
New Features
- adds
approximator="exact"toTabularExplainer,AgnosticExplainer,TabPFNExplainer, andshapiq.Explainer, which computes the exact values withExactComputerfor all indices. It evaluates all2**n_featurescoalitions per explanation and ignores thebudget, so it is meant for a small number of features."auto"is unchanged. #634, #320 - adds
scatter_2d_plotfor pairwise interactions.beeswarm_plot,scatter_plot, andscatter_2d_plotnow also take anInteractionValuesBatchdirectly. #613
Breaking Changes
- removes
"CHII"fromProxySHAP(and fromapproximator="proxyshap"of the explainers). Code that asksProxySHAPforindex="CHII"now raises at construction. Only tree proxies could compute it, not the linear proxy or the MSR residual adjustment.ProxySHAPandProxySPEXnow support the same indices, those of theMoebiusConverter. For"CHII"estimates, useSHAPIQorSVARMIQ(see the fix below). #637
Bugfixes
- fixes the
"CHII"estimates ofSHAPIQandSVARMIQ, which were wrong even with a budget of all2**ncoalitions. The Monte Carlo approximators weighted the discrete derivatives withs / t, the coefficient of the Moebius representation of the chaining interaction index, instead of its cardinal-index weights * (s + t - 1)! * (n - s - t)! / n!. #643 - fixes
SPEXandSparsewithindex="k-SII"aggregating the values twice. TheMoebiusConverteralready returned k-SII values, but they were labelled with the approximation index"SII"and aggregated to k-SII a second time. #665 - fixes
BaselineImputerwith a baseline given directly (a vector or a single row) keeping anempty_predictionof0. The game was not centered, and explanations ofTabularExplainerwith such a baseline had a baseline value of0. #646 - fixes
SPEXandSparseignoringrandom_state. The sparse transform drew its random queries from numpy's global random state, so the samerandom_stategave different results. The global state is now seeded fromrandom_statefor the transform and restored afterwards, so seeded runs are reproducible but differ from earlier seeded runs. #645 - fixes
shapiq.Explainercrashing with aTypeErrorfor everyshapiq.Game(e.g.DummyGameorImageClassifier). It now passes the game on toAgnosticExplainerand warns thatdataandclass_indexare ignored for games.AgnosticExplainernow validatesindexandmax_orderlikeTabularExplainer(warning on mismatches such asindex="SV", max_order=2), and.index/.max_orderreport the validated values instead of always"SV"and1. #638 - fixes
ProxySHAPandProxySPEXaccepting indices they cannot compute (e.g."kADD-SHAP") and failing only inapproximate(). Both now declare theirvalid_indicesand reject other indices at construction. #637 - fixes
bar_plotdropping the first feature for explanations without a base value (e.g.min_order=1). #636 - fixes
waterfall_plothighlighting only the last feature value of an interaction label. Previously, only the text after the last=of a label was drawn in black, so forAge=25 x Sex=monlymstood out. Now the text after each feature's=is black, and the text before it and thexseparators are gray (for labels without=, the names are black and the separators gray). Thefeature_namesdocstring now recommendsfeature=valuelabels (e.g."Age=25", withabbreviate=False), which highlight the value, instead of the previous advice ofvalue=featurelabels (e.g."25=Age"), which highlighted the name. Both formats still render, since the part after=is always the black one. #663
All PRs
- Docs: center the landing page logo on small screens, at twice the size by @mmschlk in #628
- Docs: a finger on a logo player pulls it instead of scrolling the page by @mmschlk in #629
- Docs: a hero image of SigLIP 2 explained as in FIxLIP, in the README and on the landing page by @mmschlk in #630
- Docs: use California housing in the LightGBM example instead of OpenML by @mmschlk in #635
- Add scatter_2d_plot for pairwise interactions by @raashish1601 in #613
- Docs: add the example "Games from Machine Learning Models" by @mmschlk in #632
- Fix bar_plot dropping the first feature without a baseline by @mmschlk in #636
- Explainers: compute exact values with approximator="exact" by @mmschlk in #634
- Proxy approximators: reject unsupported indices at construction by @mmschlk in #637
- Docs: timeline lanes for fANOVA, gradients and regional explanations, and a clean bibliography by @mmschlk in #639
- Fix shapiq.Explainer crashing for every shapiq.Game by @mmschlk in #638
- Code quality: run the ruff of uv.lock in pre-commit, and fix its findings by @mmschlk in #640
- CI: run the full matrix only when a pull request needs it by @mmschlk in #641
- Fix SPEX ignoring random_state, and log the CPU on Windows runners by @mmschlk in #645
- Bump pypa/gh-action-pypi-publish from 1.14.2 to 1.14.3 by @dependabot[bot] in #644
- Fix BaselineImputer not setting empty_prediction with a vector. by @mmschlk in #646
- Docs: an interactive FIxLIP explanation on the landing page by @mmschlk in #642
- GraphShapIQ Implementation by @Proman9000 in #550
- Fix the CHII weight of the Monte Carlo approximators (SHAPIQ, SVARMIQ) by @flyingdoubleG in #643
- Docs: the new shapiq logo by @mmschlk in #647
- Docs: the stacked logo in the README by @mmschlk in #648
- Docs: the shapiq logo v2 and its rings-and-bands animation by @mmschlk in #652
- Docs: the orders demo, from the Shapley values to the full decomposition by @mmschlk in #655
- Docs: the orders demo's plot in Safari, and no flicker on the card by @mmschlk in #656
- Orders demo: a map of the houses, a card that can be inspected, and three photos up to order 10 by @mmschlk in #657
- docs(fixlip demo): inline info box and stable caption layout by @mmschlk in #658
- FIxLIP demo: a write-up that explains the demo step by step by @mmschlk in #660
- ci(build): build Apple Silicon wheels on macos-15 by @mmschlk in #662
- FIxLIP demo page: plain scrolling, no jump on load, Definition 1 as in the paper by @mmschlk in #661
- Fixed interactions labels in waterfall plots by @martinrohbeck in #663
- Fix double k-SII aggregation in Sparse/SPEX approximator by @chenyangsu in #665
- Changelog for v1.9.0 by @mmschlk in #664
New Contributors
- @raashish1601 made their first contribution in #613
- @Proman9000 made their first contribution in #550
- @flyingdoubleG made their first contribution in #643
- @chenyangsu made their first contribution in #665
Full Changelog: v1.8.0...v1.9.0