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).

Return type:

tuple[Literal['SII', 'BII', 'CHII', 'Co-Moebius', 'SGV', 'BGV', 'CHGV', 'IGV', 'EGV', 'k-SII', 'STII', 'FSII', 'kADD-SHAP', 'FBII', 'SV', 'BV', 'JointSV', 'Moebius', 'Fourier', 'ELC'], ...]

classmethod supports_game(game)[source]

ProductKernelGame games.

Return type:

bool

exact_values(index, order)

Compute the exact interaction values of order 1 to order.

Parameters:
  • index (Literal['SII', 'BII', 'CHII', 'Co-Moebius', 'SGV', 'BGV', 'CHGV', 'IGV', 'EGV', 'k-SII', 'STII', 'FSII', 'kADD-SHAP', 'FBII', 'SV', 'BV', 'JointSV', 'Moebius', 'Fourier', 'ELC']) – The interaction index, e.g. "k-SII".

  • order (int) – The highest interaction order.

Return type:

InteractionValues

Returns:

The interactions of order 1 to order, with the game’s empty value as baseline.

Raises:

UnsupportedComputationError – If (index, order) is not supported.

max_order()[source]

The product kernel explainer computes order-1 values only.

Return type:

int

supports(index, order)

Return whether the computer can compute index up to order for its game.

Return type:

bool

game
name = 'product_kernel'

A short, stable name of the computer (part of ground-truth cache keys).