shapiq.approximator.ProxySPEX¶
- class shapiq.approximator.ProxySPEX(*, n, max_order=2, index='k-SII', proxy_model=None, sampling_weights=None, pairing_trick=False, top_order=False, random_state=None)[source]¶
Bases:
Approximator[Literal[‘k-SII’, ‘STII’, ‘FSII’, ‘FBII’, ‘SII’, ‘SV’, ‘BV’]]ProxySPEX (SParse EXplainer) via Fourier transform sampling.
An approximator for cardinal interaction indices using Fourier transform sampling to efficiently compute sparse higher-order interactions. ProxySPEX is presented in Butler et al. [2025].
Initialize the ProxySPEX 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.pairing_trick (
bool) – If True, the pairing trick is applied to the sampling procedure. Defaults toFalse.sampling_weights (
ndarray|None) – An optional array of weights for the sampling procedure. The weights must be of shape(n + 1,)and are used to determine the probability of sampling a coalition of a certain size. Defaults toNone.proxy_model (
Any|None) – Optional proxy model to use for approximating the value function. If None, a default LightGBM regressor with hyperparameter tuning will be used. The model must implement the scikit-learn regressor interface (i.e., it must have fit and predict methods). Defaults to None.random_state (
int|None) – Seed for random number generator. Defaults toNone.