Skip to content

Add the SPEX approximator to shapiq#379

Merged
mmschlk merged 41 commits intommschlk:mainfrom
justinkang221:main
May 14, 2025
Merged

Add the SPEX approximator to shapiq#379
mmschlk merged 41 commits intommschlk:mainfrom
justinkang221:main

Conversation

@justinkang221
Copy link
Copy Markdown
Contributor

This pull request adds the SPEX method for computing attributions over large input spaces with up to $n \approx 1000$ features. SPEX was developed at UC Berkeley, and uses ideas from information and coding theory to ensure fast and efficient computation of interactions.

The article detailing the SPEX algorithm is available here:
https://arxiv.org/pdf/2502.13870
A version of this article will appear at ICML 2025.

image

justinkang221 and others added 30 commits March 19, 2025 19:35
Moved all parameters to the init.
added support for soft vs. hard parameter passed by user.
sparse approximator base passing tests
added tests for approximate -- all failing
first approximate test now passing
added more tests for approximate
justinkang221 and others added 11 commits April 9, 2025 15:42
# Conflicts:
#	docs/source/notebooks/language_notebooks/language_model_game.ipynb
#	docs/source/notebooks/vision_notebooks/vision_transformer.ipynb
#	shapiq/approximator/__init__.py
#	shapiq/approximator/_base.py
#	shapiq/game_theory/indices.py
#	shapiq/games/benchmark/_setup/_vit_setup.py
#	shapiq/games/benchmark/local_xai/benchmark_image.py
@hbaniecki hbaniecki requested a review from mmschlk May 8, 2025 07:00
@mmschlk
Copy link
Copy Markdown
Owner

mmschlk commented May 8, 2025

@justinkang221 amazing what you guys did here! ❤️

I will go through the PR as soon as possible! ☺️

@justinkang221
Copy link
Copy Markdown
Contributor Author

Sounds good @mmschlk. One thing I wanted to highlight is that I added "sparse-transform" and "galois" to the dependencies. I know you mentioned you wanted to mark them as optional, so feel free to make that change, I wasn't sure how best to handle it.

Copy link
Copy Markdown
Owner

@mmschlk mmschlk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is so super nice! I don't see any reason why we should not merge directly! The only thing, I would add is a tutorial/introduction notebook which goes a bit beyond the current additions to the existing notebooks. But this I think we can tackle also at a later date. :)

@mmschlk
Copy link
Copy Markdown
Owner

mmschlk commented May 14, 2025

Sounds good @mmschlk. One thing I wanted to highlight is that I added "sparse-transform" and "galois" to the dependencies. I know you mentioned you wanted to mark them as optional, so feel free to make that change, I wasn't sure how best to handle it.

It seems like the dependencies are pretty lightweight and seem to install already in all python versions in the tests. So I would leave it as is for now and monitor how it goes. :)

@mmschlk
Copy link
Copy Markdown
Owner

mmschlk commented May 14, 2025

I will do minor things like adding it to changelog and adding your method more prominently into the docs next.

@mmschlk mmschlk merged commit 8fa18fe into mmschlk:main May 14, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants