shapiq_benchmark.setups.LocalConfoundingSetup

class shapiq_benchmark.setups.LocalConfoundingSetup(*, n=500, d=4, setting='ii', mode='signed', regressor='tabpfn', regressor_params=<factory>, random_state=42, unit=0)[source]

Bases: _ConfoundingSetup

A LocalConfoundingXAI game for one unit of the synthetic study.

Variables:
  • unit – The index of the explained unit. Defaults to 0.

  • n – The number of samples. Defaults to 500.

  • d – The number of covariates (players), at least 4. Defaults to 4.

  • setting – "i" (homogeneous) or "ii" (heterogeneous effect, default).

  • mode – "signed" (default), "abs", or "sq".

  • regressor – "tabpfn" (default) or a model name of shapiq_benchmark.models.

  • regressor_params – Parameters of the regressor, e.g. {"version": "v2.5"}.

  • random_state – The seed of the data and the regressors.

Examples

>>> LocalConfoundingSetup(n=200, unit=2, regressor="linear").build().n_players
4
build()[source]

Generate the data and build the game.

Return type:

LocalConfoundingXAI

to_dict()

Return the setup as a JSON-serializable dictionary (the inverse of setup_from_dict()).

Return type:

dict[str, Any]

d = 4
property key

A stable identifier of the game this setup builds, used as its cache key.

It is a digest of the setup’s name, version, RECIPE_VERSION, and fields (runtime fields excluded), so it is the same across processes and machines.

mode = 'signed'
n = 500
name = 'local_confounding'

The registered name of the setup.

random_state = 42
regressor = 'tabpfn'
regressor_params
setting = 'ii'
unit = 0
version = 1

The version of build(), part of key.