shapiq.approximator.RegressionMSRΒΆ
- class shapiq.approximator.RegressionMSR(n, index, *, proxy_model=None, sampling_weights=None, pairing_trick=True, random_state=None)[source]ΒΆ
Bases:
ProxySHAPRegressionMSR is a proxy-based approximator that uses a regression model to approximate the value function and applies the MSR adjustment method.
The regression model is trained on a subset of the coalitions, and its predictions are adjusted using the MSR method to better match the true value function. The method was proposed by Witter et al. (2025) Witter et al. [2025] and is designed to provide more accurate approximations of the Shapley values, especially in cases where the value function is complex and non-linea
Example
>>> from shapiq_games.synthetic import DummyGame >>> from shapiq.approximator import RegressionMSR >>> game = DummyGame(n=5, interaction=(1, 2)) >>> approximator = RegressionMSR(n=5, index="SV") >>> approximator.approximate(budget=100, game=game) InteractionValues( index=SV, max_order=1, estimated=True, estimation_budget=100 )
Initialize the RegressionMSR approximator.
- Parameters:
n (
int) β The number of players in the game.index (
Literal['SV','BV']) β The index to be approximated. Must be a valid index for the chosen adjustment method.proxy_model (
Any|None) β The regression model to be used as the proxy. If None, a default regression model will be used.sampling_weights (
ndarray|None) β The sampling weights for the coalitions. If None, uniform weights will be used.pairing_trick (
bool) β Whether to use the pairing trick for sampling coalitions. Default is True.random_state (
int|None) β The random state for reproducibility. Default is None.