shapiq.approximator.InconsistentKernelSHAPIQ¶

class shapiq.approximator.InconsistentKernelSHAPIQ(n, max_order=2, index='k-SII', *, pairing_trick=False, sampling_weights=None, random_state=None)[source]¶

Bases: Regression[Literal[‘k-SII’, ‘SII’, ‘SV’]]

The Inconsistent KernelSHAP-IQ regression approximator.

The Inconsistent KernelSHAP-IQ regression approximator for estimating the Shapley interaction index (SII) and the k-Shapley interaction index (k-SII).

Inconsistent KernelSHAP-IQ Pelegrina et al. [2023] is a variant of the KernelSHAP-IQ estimator that does not converge to the true SII values, but often provides better estimates for lower computational budgets. The algorithm is also similar to kADD-SHAP Pelegrina et al. [2023]. For details, we refer to Fumagalli et al. (2024) Fumagalli et al. [2024].

See also

  • KernelSHAPIQ: The KernelSHAPIQ

    approximator for estimating the Shapley interaction index (SII) and the k-Shapley interaction index (k-SII).

  • KernelSHAP: The KernelSHAP

    approximator for estimating the Shapley values.

  • kADDSHAP: The kADD-SHAP approximator

    for estimating the kADD-SHAP values.

  • RegressionFSII: The Faithful KernelSHAP

    approximator for estimating the Faithful Shapley interaction index (FSII).

Initialize the Inconsistent KernelSHAP-IQ approximator.

Parameters:
  • n (int) – The number of players.

  • max_order (int) – The interaction order of the approximation. Defaults to 2.

  • index (Literal['k-SII', 'SII', 'SV']) – The interaction index to be used. Choose from ['k-SII', 'SII']. Defaults to 'k-SII'.

  • pairing_trick (bool) – If True, the pairing trick is applied to the sampling procedure. Defaults to False.

  • sampling_weights (ndarray | None) – An optional array of weights for the sampling procedure. The weights must be of shape (n + 1,) and are used to determine the probability of sampling a coalition of a certain size. Defaults to None.

  • random_state (int | None) – The random state of the estimator. Defaults to None.

valid_indices: tuple[Literal['k-SII', 'SII', 'SV'], ...] = ('k-SII', 'SII', 'SV')¶

Valid indices for the InconsistentKernelSHAPIQ approximator.