Releases: mmschlk/shapiq
v1.2.3
Coolest Things
- Much quicker regression (we basically did something very slow before but now its cool, see #340)
- RegresseionFBII approximation, you can now also compute values for FBII scores through the
Regression
approximator
What's Changed
- Improve testing by @mmschlk in #332
- Adds trivial TreeExplainer computation and fixes a Bug in parsing xgboost models. by @mmschlk in #334
- bug fix for stacked_bar plot by @Advueu963 in #335
- fixes #336 by @mmschlk in #337
- 331 adding faith banzhaf approximator by @Advueu963 in #333
- 🚀 Optimizes Regression Estimator Runtime by @mmschlk in #341
- fix missing import for regressionfbii by @hbaniecki in #342
- Bump numpy from 1.26.4 to 2.1.2 by @dependabot in #246
- ⚒️ Reduce package clutter and adds uv by @mmschlk in #348
- Update Test Structure to use uv by @mmschlk in #350
- 🏷️ Create v1.2.3 Release by @mmschlk in #351
Full Changelog: v1.2.2...v.1.2.3
v1.2.2
What's Changed
- Fix Package Import without Write Access by @mmschlk in #327
- 291 Change the Supported Python Versions to 3.10-3.13 by @Advueu963 in #318
- Adding Scikit-Learn ExtraTreesRegressor to allowed models for TreeExplainer by @Deathn0t in #309
- Moved legends in network plot to not coincide by @chenhao20241224 in #329
- Bump the pip-all-updates group with 8 updates by @dependabot in #328
New Contributors
- @Deathn0t made their first contribution in #309
- @chenhao20241224 made their first contribution in #329
Full Changelog: v1.2.1...v1.2.2
v1.2.1 (2024-02-17)
This Release contains a couple of bug fixes and little improvements.
What's Changed
- Fix TreeExplainer instanciation when a tree in LightGBM Classifier model has n_features_in_tree = 1 by @CharlesCousyn in #310
- Bump the pip-all-updates group with 9 updates by @dependabot in #312
- 316 fix bar and force plotting by @Advueu963 in #317
- Bump pypa/gh-action-pypi-publish from 1.12.3 to 1.12.4 by @dependabot in #311
- fixes for #324, #322, #319 by @hbaniecki in #323
New Contributors
- @CharlesCousyn made their first contribution in #310
Full Changelog: v1.2.0...v1.2.1
v1.2.0 (2024-11-15)
New Features
- adds
shapiq.TabPFNExplainer
as a specialized version of theshapiq.TabularExplainer
which offers a streamlined variant of the explainer for the TabPFN model #301 - adds a TabPFN example notebook to the documentation
- adds the
sentence_plot
function to theplot
module to visualize the contributions of words to a language model prediction in a sentence-like format - adds support for IsoForest models to explainer and tree explainer #278
- adds the
upset_plot
function to theplot
module to visualize the interactions of higher-order #290
API Enhancements
- handles
explainer.explain()
now through a common interface for all explainer classes which now need to implement aexplain_function()
method - adds the baseline_value into the InteractionValues object's value storage for the
()
interaction ifmin_order=0
(default usually) for all indices that are not ``SII```(SII has another baseline value) such that the values are efficient (sum up to the model prediction) without the awkward handling of the baseline_value attribute - renames
game_fun
parameter inshapiq.ExactComputer
togame
#297 - refactors game theory computations like
ExactComputer
,MoebiusConverter
,core
, among others to be more modular and flexible into thegame_theory
module #258 - removes warning when class_index is not provided in explainers #298
- makes abbreviations in the
plot
module optional #281 - adds support for sub-selection of players in the interaction values data class #276 which allows retrieving interaction values for a subset of players
Tests Enhancements
- improves quality of the tests by adding many more semantic tests to the different interaction indices and computations #285
New Contributors
- @JuliaHerbinger made their first contribution in #287
- @r-visser made their first contribution in #289
- @heinzll made their first contribution in #285
Full Changelog: v1.1.1...v1.2.0
v1.1.1 (2024-11-13)
Improvements and Ease of Use
- adds a
class_index
parameter toTabularExplainer
andExplainer
to specify the class index to be explained for classification models #271 (renamesclass_label
parameter in TreeExplainer toclass_index
) - adds support for
PyTorch
models toExplainer
#272 - adds new tests comparing
shapiq
outputs for SVs with alues computed withshap
- adds new tests for checking
shapiq
explainers with different types of models
Bug Fixes
- fixes a bug that
RandomForestClassifier
models were not working with theTreeExplainer
#273
v1.1.0 (2024-11-07)
New Features and Improvements
- adds computation of the Egalitarian Core (
EC
) and Egalitarian Least-Core (ELC
) to theExactComputer
#182 - adds
waterfall_plot
#34 that visualizes the contributions of features to the model prediction - adds
BaselineImputer
#107 which is now responsible for handling thesample_replacements
parameter. Added a DeprecationWarning for the parameter inMarginalImputer
, which will be removed in the next release. - adds
joint_marginal_distribution
parameter toMarginalImputer
with default valueTrue
#261 - renames explanation graph to
si_graph
get_n_order
now has optional lower/upper limits for the order- computing metrics for benchmarking now tries to resolve not-matching interaction indices and will throw a warning instead of a ValueError #179
- add a legend to benchmark plots #170
- refactored the
shapiq.games.benchmark
module into a separateshapiq.benchmark
module by moving all but the benchmark games into the new module. This closes #169 and makes benchmarking more flexible and convenient. - a
shapiq.Game
can now be called more intuitively with coalitions data types (tuples of int or str) and also allows to addplayer_names
to the game at initialization #183 - improve tests across the package
Documentation
- adds a notebook showing how to use custom tree models with the
TreeExplainer
#66 - adds a notebook show how to use the
shapiq.Game
API to create custom games #184 - adds a notebook showing hot to visualize interactions #252
- adds a notebook showing how to compute Shapley values with
shapiq
#193 - adds a notebook for conducting data valuation #190
- adds a notebook showcasing introducing the Core and how to compute it with
shapiq
#191
Bug Fixes
- fixes a bug with SIs not adding up to the model prediction because of wrong values in the empty set #264
- fixes a bug that
TreeExplainer
did not have the correct baseline_value when using XGBoost models #250 - fixes the force plot not showing and its baseline value
New Contributors
- @Advueu963 made their first contribution in #185
- @dependabot made their first contribution in #200
Full Changelog: v1.0.1...v1.1.0
v1.0.1 (2024-06-05)
- add
max_order=1
toTabularExplainer
andTreeExplainer
- fix
TreeExplainer.explain_X(..., n_jobs=2, random_state=0)
shapiq v1.0.0 (2024-06-04)
Major release of the shapiq
Python package including (among others):
approximator
module implements over 10 approximators of Shapley values and interaction indices.exact
module implements a computer for over 10 game theoretic concepts like interaction indices or generalized values.games
module implements over 10 application benchmarks for the approximators.explainer
module includes aTabularExplainer
andTreeExplainer
for any-order feature interactions of machine learning model predictions.interaction_values
module implements a data class to store and analyze interaction values.plot
module allows visualizing interaction values.datasets
module loads datasets for testing and examples.
Documentation of shapiq
with tutorials and API reference is available at https://shapiq.readthedocs.io
Update v.0.0.6-alpha
Highlights
The highlights of this release are as follows.
Random Forest Support for TreeExplainer
We add support for RandomForestClassifier
and RandomForestRegressor
as provided by sklearn.ensemble
in the TreeExplainer
. This is discussed in #55.
TreeExplainer Bugfix
We fix a package-breaking bug that made it impossible to use the TreeExplainer
class.
Additional Unittests
We add additional unittests that fully covers the TreeExplainer
in its current form.
What's Changed
Full Changelog: v.0.0.5-alpha...v.0.0.6-alpha
Update v.0.0.5-alpha
Highlights
Since the last release already is some time back, lot's has changed. The highlights are as follows:
TreeExplainer based on TreeSHAP-IQ
shapiq
now is equipped with a TreeExplainer
. The TreeExplainer
is based on the TreeSHAP-IQ algorithm proposed in this paper. It is a model-specific method to compute Shapley interactions of all kinds and any-order. Since it is based on the linear TreeSHAP algorithm it is quite fast. The work is not yet finished on the TreeExplainer, since it only accepts very basic tree models from sklearn as input. More to follow on this front.


The first visualizations are added.
We added a new plot to the visualizations: the stacked bar chart (underwhelming name). This plot is illustrated in the TreeSHAP-IQ paper and Sebastian Bordt and Ulrike von Luxburg's AISTATS paper. The stacked bar charts shows how much interaction is present in a specific instance and is based on the k-SII
values.

Major Refactoring
The codebase has changed quite drastically and many objects have been renamed (e.g. InteractionExplainer
has been renamed to Tabular Explainer
to better fit the more specific intend of this class). The InteractionValues
(the main data structure of the package) has become much more powerful. You can now multiply scalar values to the interaction scores and even add two objects together.
Welcoming new Collaborators
We still are looking for all the help that we can get! If you want to contribute please check out the tutorial and our project.
What's Changed
- Add nSII and SII Regression Estimator by @mmschlk in #22
- Merge Dev by @mmschlk in #23
- Add initial explainer. by @mmschlk in #25
- Development by @mmschlk in #27
- Merge by @mmschlk in #28
- Add additional Tests by @mmschlk in #29
- Adds Stacked Bar Plot and tidyies up Network Plot. by @mmschlk in #41
- Renamed nSII to k-SII and refactors base approximators by @mmschlk in #42
- Add Collaborator Tutorial and Code of Conduct by @mmschlk in #46
- adds code-quality check and closes #45 by @mmschlk in #47
- adds TreeExplainer with TreeSHAP-IQ by @mmschlk in #51
Full Changelog: v.0.0.4-alpha...v.0.0.5-alpha