shapiq.approximator.SVARMIQ¶

class shapiq.approximator.SVARMIQ(n, max_order=2, index='k-SII', *, top_order=False, pairing_trick=False, sampling_weights=None, random_state=None)[source]¶

Bases: MonteCarlo[Literal[‘k-SII’, ‘SII’, ‘STII’, ‘FSII’, ‘FBII’, ‘SV’, ‘CHII’, ‘BII’, ‘BV’]]

The SVARM-IQ approximator for Shapley interactions.

SVARM-IQ utilizes MonteCarlo approximation with two stratification strategies. SVARM-IQ is a generalization of the SVARM algorithm [Kolpaczki et al., 2024] and can approximate any-order Shapley interactions efficiently. For details about the algorithm see the original paper by Kolpaczki et al. [2024].

Initialize the SVARMIQ approximator.

Parameters:
  • n (int) – The number of players.

  • max_order (int) – The interaction order of the approximation. Defaults to 2.

  • index (Literal['k-SII', 'SII', 'STII', 'FSII', 'FBII', 'SV', 'CHII', 'BII', 'BV']) – The interaction index to be used. Choose from ['k-SII', 'SII']. Defaults to 'k-SII'.

  • top_order (bool) – If True, the top-order interactions are estimated. Defaults to False.

  • pairing_trick (bool) – If True, the pairing trick is applied to the sampling procedure. Defaults to False.

  • sampling_weights (ndarray[tuple[Any, ...], dtype[floating]] | 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 to None.

  • random_state (int | None) – The random state of the estimator. Defaults to None.