Skip to content

Releases: mmschlk/shapiq

v1.2.0 (2024-11-15)

15 Jan 07:41
28b7683
Compare
Choose a tag to compare

New Features

  • adds shapiq.TabPFNExplainer as a specialized version of the shapiq.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 the plot 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 the plot 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 a explain_function() method
  • adds the baseline_value into the InteractionValues object's value storage for the () interaction if min_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 in shapiq.ExactComputer to game #297
  • refactors game theory computations like ExactComputer, MoebiusConverter, core, among others to be more modular and flexible into the game_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

Full Changelog: v1.1.1...v1.2.0

v1.1.1 (2024-11-13)

13 Nov 11:35
49fa949
Compare
Choose a tag to compare

Improvements and Ease of Use

  • adds a class_index parameter to TabularExplainer and Explainer to specify the class index to be explained for classification models #271 (renames class_label parameter in TreeExplainer to class_index)
  • adds support for PyTorch models to Explainer #272
  • adds new tests comparing shapiq outputs for SVs with alues computed with shap
  • adds new tests for checking shapiq explainers with different types of models

Bug Fixes

  • fixes a bug that RandomForestClassifier models were not working with the TreeExplainer #273

v1.1.0 (2024-11-07)

08 Nov 09:44
Compare
Choose a tag to compare

New Features and Improvements

  • adds computation of the Egalitarian Core (EC) and Egalitarian Least-Core (ELC) to the ExactComputer #182
  • adds waterfall_plot #34 that visualizes the contributions of features to the model prediction
  • adds BaselineImputer #107 which is now responsible for handling the sample_replacements parameter. Added a DeprecationWarning for the parameter in MarginalImputer, which will be removed in the next release.
  • adds joint_marginal_distribution parameter to MarginalImputer with default value True #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 separate shapiq.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 add player_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

Full Changelog: v1.0.1...v1.1.0

v1.0.1 (2024-06-05)

05 Jun 13:42
Compare
Choose a tag to compare
  • add max_order=1 to TabularExplainer and TreeExplainer
  • fix TreeExplainer.explain_X(..., n_jobs=2, random_state=0)

shapiq v1.0.0 (2024-06-04)

04 Jun 14:30
Compare
Choose a tag to compare

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 a TabularExplainer and TreeExplainer 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

20 Mar 15:37
4b738c3
Compare
Choose a tag to compare

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

  • Bugfix and Support for Random Forests in TreeExplainer by @mmschlk in #59

Full Changelog: v.0.0.5-alpha...v.0.0.6-alpha

Update v.0.0.5-alpha

18 Mar 14:23
4cb0b32
Compare
Choose a tag to compare

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

Full Changelog: v.0.0.4-alpha...v.0.0.5-alpha

Update v.0.0.4-alpha

29 Nov 16:27
a55307f
Compare
Choose a tag to compare

New Approximators

This release adds new approximation methods to shapiq and makes all interaction calculations faster and more memory efficient.

ShapIQ approximator

This release adds the shapiq.approximator.ShapIQ approximator as proposed in this paper (NeurIPS'23).
ShapIQ can approximate any cardinal interaction index (CII) like the Shapley Interaction Index (SII), the Shapley Taylor Index (STI), or the Faithful Shapley Interaction index (FSI).

Regression Estimator for FSI

The shapiq.approximator.RegressionFSI regression estimator, which is only available for FSI, was proposed in this paper (JMLR'23). It is similar to KernelSHAP in that it leverages a weighted least squares representation for the interaction index and solves this by estimating this regression problem.

Permutation Sampling for STI

The permutation sampling currently implemented for the SII (shapiq.approximator.PermutationSamplingSII) can also be extended to the STI. The new shapiq.approximator.PermutationSamplingSTI uses the traditional permutation sampling approach to compute STI scores.

List of PRs

Full Changelog: v0.0.3-alpha...v.0.0.4-alpha

Update v.0.0.3-alpha

17 Nov 20:05
e8aaabf
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.0.2-alpha...v0.0.3-alpha

0.0.2

23 Oct 09:39
Compare
Choose a tag to compare
0.0.2 Pre-release
Pre-release

Adds network plot functionality and updates docs. This release is mainly used to test the workflows and publish of docs and automatic update to pypi.