shapiq.approximator.StratifiedSamplingSVΒΆ
- class shapiq.approximator.StratifiedSamplingSV(n, random_state=None, **kwargs)[source]ΒΆ
Bases:
Approximator[Literal[βSVβ]]The Stratified Sampling algorithm for estimating the Shapley values.
The Stratified Sampling algorithm estimates the Shapley values (SV) by sampling random marginal contributions for each player and each coalition size. The marginal contributions are grouped into strata by size. The strata are aggregated for each player after sampling to obtain the final estimate. For more information, see Maleki et al. (2013) Maleki et al. [2013].
Initialize the Stratified Sampling SV approximator.
- Parameters:
- approximate(budget, game, *args, **kwargs)[source]ΒΆ
Approximates the Shapley values using ApproShapley.
- Parameters:
budget (
int) β The number of game evaluations for approximationgame (
Game|Callable[[ndarray],ndarray]) β The game function as a callable that takes a set of players and returns the value.*args (
Any) β Additional positional arguments (not used).**kwargs (
Any) β Additional keyword arguments (not used).
- Return type:
- Returns:
The estimated interaction values.