shapiq.approximator.ProxySPEX¶
- class shapiq.approximator.ProxySPEX(*, n, max_order=2, index='k-SII', proxy_model='lightgbm', hpo=True, 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 (
Union[Any,Literal['xgboost','lightgbm','tree','linear'],ProxyModelWithHPO]) –Proxy model used to approximate the value function. ProxySPEX reads interactions off the proxy’s tree structure, so only tree proxies are supported. May be:
a string identifier (
"lightgbm"(default),"xgboost","tree") selecting a tree estimator;"linear"is rejected since ProxySPEX is tree-only. Whenhpois set, a resolved gradient-boosting backend is wrapped in its default grid search (the reference HPO-informed proxy of Butler et al. [2025]);"tree"and any backend-missing fallback to aDecisionTreeRegressorstay bare. ProxySPEX does not require the optional gradient-boosting backends: if the requested package is unavailable the tag warns and falls back to a bare scikit-learnDecisionTreeRegressor.a fitted-on-call estimator implementing the scikit-learn regressor interface, or a hyperparameter-search wrapper exposing
best_estimator_(e.g.GridSearchCVor theProxyModelWithHPOwrappers).
hpo (
bool) – IfTrue(default), wrap a string-resolved gradient-boosting proxy in its default grid search (the HPO-informed proxy of Butler et al. [2025]). IfFalse, use the bare resolved estimator. Has no effect whenproxy_modelis a passed-in estimator/wrapper.random_state (
int|None) – Seed for random number generator. Defaults toNone.