shapiq.approximator.PermutationSamplingSIIΒΆ
- class shapiq.approximator.PermutationSamplingSII(n, max_order=2, index='k-SII', *, top_order=False, random_state=None)[source]ΒΆ
Bases:
Approximator[Literal[βSIIβ, βk-SIIβ]]Permutation Sampling approximator for the SII (and k-SII) index.
See also
PermutationSamplingSTII: The PermutationSampling approximator for the STII index
PermutationSamplingSV: The PermutationSampling approximator for the SV index
Initialize the Permutation Sampling approximator for SII (and k-SII).
- Parameters:
n (
int) β The number of players.max_order (
int) β The interaction order of the approximation. Defaults to2.index (
Literal['SII','k-SII']) β The interaction index to compute. Must be either'SII'or'k-SII'.top_order (
bool) β Whether to approximate only the top order interactions (True) or all orders up to the specified order (False, default).random_state (
int|None) β The random state to use for the permutation sampling. Defaults toNone.
- approximate(budget, game, batch_size=5, **kwargs)[source]ΒΆ
Approximates the interaction values.
- Parameters:
budget (
int) β The budget for the approximation.game (
Game|Callable[[ndarray],ndarray]) β The game function as a callable that takes a set of players and returns the value.batch_size (
int|None) β The size of the batch. IfNone, the batch size is set to1. Defaults to5.**kwargs (
Any) β Additional keyword arguments (unused).
- Returns:
The estimated interaction values.
- Return type: