shapiq.approximator.SPEX¶
- class shapiq.approximator.SPEX(*, n, max_order=2, index='k-SII', top_order=False, random_state=None, decoder_type='soft', degree_parameter=5)[source]¶
Bases:
SparseSPEX (SParse EXplainer) via Fourier transform sampling.
An approximator for cardinal interaction indices using Fourier transform sampling to efficiently compute sparse higher-order interactions. SPEX is presented in Kang et al. [2025].
Initialize the SPEX approximator.
- Parameters:
n (
int) – Number of players (features).max_order (
int) – Maximum interaction order to consider.index (
Literal['k-SII','STII','FSII','FBII','SII','SV','BV']) – The Interaction index to use. All indices supported by shapiq’sMoebiusConverterare supported.top_order (
bool) – IfTrue, only reports interactions of exactly ordermax_order. Otherwise, reports all interactions up to ordermax_order. Defaults toFalse.random_state (
int|None) – Seed for random number generator. Defaults toNone.decoder_type (
Literal['soft','hard']) – Type of decoder to use, either “soft” or “hard”. Defaults to “soft”.degree_parameter (
int) – A parameter that controls the maximum degree of the interactions to extract during execution of the algorithm. Note that this is a soft limit, and in practice, the algorithm may extract interactions of any degree. We typically find that there is little value going beyond5. Defaults to5. Note that increasing this parameter will need morebudgetin theapproximate()method.