shapiq_benchmark.computers.ProductKernelComputer¶
- class shapiq_benchmark.computers.ProductKernelComputer(game)[source]¶
Bases:
Computer[ProductKernelGame]Product kernel games via
ProductKernelExplainer.Bind the computer to a game.
- Parameters:
game (
TypeVar(G, bound=Game)) – The game whose exact values the computer computes.- Raises:
UnsupportedComputationError – If the computer cannot handle the game.
- classmethod supported_indices()[source]¶
The indices of the product kernel explainer (
ProductKernelSHAPIQIndices).
- classmethod supports_game(game)[source]¶
ProductKernelGamegames.- Return type:
- exact_values(index, order)¶
Compute the exact interaction values of order 1 to
order.- Parameters:
- Return type:
- Returns:
The interactions of order
1toorder, with the game’s empty value as baseline.- Raises:
UnsupportedComputationError – If
(index, order)is not supported.
- supports(index, order)¶
Return whether the computer can compute
indexup toorderfor its game.- Return type:
- game¶
- name = 'product_kernel'¶
A short, stable name of the computer (part of ground-truth cache keys).