shapiq.tree.InterventionalGameΒΆ

class shapiq.tree.InterventionalGame(model, reference_data, target_instance, class_index=None)[source]ΒΆ

Bases: Game

A cooperative game for interventional tree-based model explanations.

Initialize the InterventionalGame.

Parameters:
  • model (object) – The tree-based model to explain.

  • reference_data (ndarray) – Background dataset used as reference.

  • target_instance (ndarray) – The instance to explain.

  • class_index (int | None) – Class index for classification models. Defaults to None.

value_function(coalitions)[source]ΒΆ

Compute the value function for the given coalitions.

Parameters:

coalitions (ndarray) – Boolean array of shape (n_coalitions, n_players).

Return type:

ndarray

Returns:

Array of values for each coalition.