shapiq.game_theory.MoebiusConverter¶
- class shapiq.game_theory.MoebiusConverter(moebius_coefficients)[source]¶
Bases:
objectComputes a variety of game-theoretic concepts exactly from Möbius coefficients.
The MöbiusConverter class is used to compute various game-theoretic concepts like Shapley values, Shapley interactions, Banzhaf interactions, and many more from a collection of Möbius coefficients (also called Möbius Interactions, MI) of a game. The MoebiusConverter is built with the idea that some games
Computes exact Shapley Interactions using the (sparse) Möbius representation. This is much faster than exact computation, if Möbius representation is sparse.
- Variables:
n – The number of players.
moebius_coefficients – The InteractionValues object containing all non-zero (sparse) Möbius coefficients.
- Parameters:
moebius_coefficients (InteractionValues)
Initialize the MoebiusConverter.
- Parameters:
moebius_coefficients (
InteractionValues) – An InteractionValues object containing the (potentially sparse) Möbius coefficients.
- __call__(index, order=None)[source]¶
Calls the MoebiusConverter of the specified index or value.
- Parameters:
- Return type:
- Returns:
The desired interaction values or generalized values.
- Raises:
ValueError – If the index is not supported.