shapiq.approximator.OwenSamplingSVΒΆ
- class shapiq.approximator.OwenSamplingSV(n, n_anchor_points=10, random_state=None, **kwargs)[source]ΒΆ
Bases:
Approximator[Literal[βSVβ]]Owen Sampling approximator for the Shapley values.
The Owen Sampling algorithm estimates the Shapley values (SV) by sampling random marginal contributions for each player and each coalition size. The marginal contributions are used to update an integral representation of the SV. For more information, see Okhrati and Lipani [2020]. The number of anchor points M at which the integral is to be palpated share the available budget for each player equally. A higher n_anchor_points increases the resolution of the integral reducing bias while reducing the accuracy of the estimation at each point.
- Variables:
n β The number of players.
iteration_cost β The cost of a single iteration of the approximator.
- Parameters:
Initialize the Owen Sampling SV approximator.
- Parameters:
- static get_anchor_points(n_anchor_points)[source]ΒΆ
Returns the anchor points for the Owen Sampling approximation.
- Parameters:
n_anchor_points (
int) β The number of anchor points.- Return type:
- Returns:
An array of anchor points.
- Raises:
ValueError β If the number of anchor points is less than or equal to 0.
- approximate(budget, game, *args, **kwargs)[source]ΒΆ
Approximates the Shapley values using Owen Sampling.
- 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 in this method.**kwargs (
Any) β Additional keyword arguments not used in this method.
- Return type:
- Returns:
The estimated interaction values.