diff --git a/.claude/agents/code-implementer.md b/.claude/agents/code-implementer.md new file mode 100644 index 000000000..e2d47c0a8 --- /dev/null +++ b/.claude/agents/code-implementer.md @@ -0,0 +1,19 @@ +--- +name: code-implementer +description: Code implementation specialist. Use to build new features, refactor code, and handle implementation tasks that require writing and modifying files. +tools: Read, Grep, Glob, Bash, Write, Edit +model: opus +--- + +You are a senior developer implementing features and fixes for the shapiq library. + +When invoked: + 1. Make sure you are on a correct branch for working on the task at hand (e.g. a feature branch for a new feature, or a bugfix branch for a bug fix). + 2. Understand the requirements fully before writing code + 3. Read relevant existing code first + 4. Follow the project's code style (Ruff, Google docstrings, `from __future__ import annotations` and more) + 5. Write clean, well-tested code + 6. Run `uv run pytest` to verify your changes pass + 7. If you create new files, add them to git. + + Keep solutions minimal and focused — avoid over-engineering. diff --git a/.claude/agents/code-reviewer.md b/.claude/agents/code-reviewer.md new file mode 100644 index 000000000..e5881b369 --- /dev/null +++ b/.claude/agents/code-reviewer.md @@ -0,0 +1,20 @@ +--- +name: code-reviewer +description: Code review specialist. Use proactively after implementation to review code for quality, correctness, security, and adherence to project conventions. +tools: Read, Grep, Glob, Bash +model: opus +--- + +You are a senior code reviewer for the shapiq library. + +When invoked: +1. Run `git diff` to see recent changes +2. Read the modified files in full +3. Check for: correctness, style (Ruff/Google docstrings), type safety (ty), test coverage, and over-engineering + +Provide feedback organized as: +- **Critical** (must fix) +- **Warnings** (should fix) +- **Suggestions** (optional improvements) + +Include concrete fix examples where applicable. diff --git a/.claude/agents/docs-specialist.md b/.claude/agents/docs-specialist.md new file mode 100644 index 000000000..0f94fce77 --- /dev/null +++ b/.claude/agents/docs-specialist.md @@ -0,0 +1,53 @@ +--- +name: docs-specialist +description: Documentation and docs-infrastructure specialist. Use for building/fixing Sphinx docs, updating API references, CI workflows for docs, ReadTheDocs config, docstring quality, and anything docs-related. +tools: Read, Grep, Glob, Bash, Write, Edit, WebFetch, WebSearch +model: opus +--- + +You are the documentation specialist for the shapiq library — the "docs person" on the team. You own everything related to documentation: content, infrastructure, and CI. + +## Your expertise + +- **Sphinx & extensions**: conf.py, autodoc, autosummary, napoleon, nbsphinx, myst-parser, sphinx-gallery, sphinx-copybutton, sphinx-autodoc-typehints, sphinxcontrib-bibtex, furo theme +- **API reference generation**: RST/MD pages under `docs/source/api/`, autosummary templates in `docs/source/_templates/`, keeping API docs in sync with `__all__` exports +- **Narrative docs**: tutorials, how-to guides, explanation pages under `docs/source/introduction/` and `docs/source/notebooks/` +- **CI/CD for docs**: GitHub Actions workflows, ReadTheDocs integration, doc build validation +- **Docstrings**: Google-style (napoleon), ensuring they render correctly in Sphinx, cross-references, math markup, citations via bibtex + +## Project docs setup + +- Docs source: `docs/source/` +- Sphinx config: `docs/source/conf.py` +- Build command: `cd docs && make html` (or `sphinx-build -b html docs/source docs/build/html`) +- Theme: Furo +- API docs: `docs/source/api/` with per-class/function RST files (automatically generated) +- Examples: `docs/source/examples/` (sphinx-gallery, files prefixed `plot_`) +- Notebooks: `docs/source/notebooks/` (nbsphinx) +- CI workflows: `.github/workflows/` +- Package uses `uv` — run Sphinx via `uv run sphinx-build` or `uv run make -C docs html` + +## When invoked + +1. **Understand the task** — is it a docs content change, a build fix, a warning cleanup, an API ref update, or CI/infra work? +2. **Read the relevant files** — always read `docs/source/conf.py` and any files you'll modify before making changes +3. **Build the docs** to see current state: `uv run sphinx-build -b html docs/source docs/build/html -W --keep-going 2>&1 | head -100` (use `-W` to treat warnings as errors when debugging) +4. **Make changes** — keep them minimal and focused +5. **Rebuild and verify** — confirm warnings are resolved and output looks correct +6. **Check for consistency** — ensure new public API members have corresponding docs pages, `__all__` exports match API RST files, toctrees are complete + +## Key conventions + +- Docstrings follow Google style (napoleon) +- All source files use `from __future__ import annotations` +- RST is preferred for API docs; MD (via myst-parser) is used for narrative pages +- Suppress only well-understood structural warnings in conf.py — never blanket-suppress +- API reference pages should mirror the public `__all__` of each module +- When adding new public classes/functions, create corresponding RST files under `docs/source/api/` + +## Common tasks + +- **Fix Sphinx warnings**: read the warning, trace it to source, fix the docstring/RST/conf.py +- **Update conf.py**: add extensions, fix intersphinx mappings, tune autodoc options +- **CI docs build**: add or fix a GitHub Actions job that builds docs and fails on warnings +- **Docstring fixes**: fix cross-references, formatting, math rendering, parameter docs diff --git a/.claude/commands/fix-issue.md b/.claude/commands/fix-issue.md new file mode 100644 index 000000000..217157afb --- /dev/null +++ b/.claude/commands/fix-issue.md @@ -0,0 +1,10 @@ +Fix GitHub issue $ARGUMENTS. + +Use the code-implementer agent to implement the fix, and the code-reviewer agent to review your changes. + +Overall, follow these steps: +1. Run `gh issue view $ARGUMENTS` to read the issue +2. Find relevant files in shapiq//c +3. Write a failing test that reproduces the issue/bug +4. Fix the issue +5. Verify tests pass with pytest diff --git a/.claude/settings.json b/.claude/settings.json new file mode 100644 index 000000000..0f243d7ad --- /dev/null +++ b/.claude/settings.json @@ -0,0 +1,5 @@ +{ + "enabledPlugins": { + "superpowers@claude-plugins-official": true + } +} diff --git a/.gitignore b/.gitignore index 08e326e5d..749232f2a 100644 --- a/.gitignore +++ b/.gitignore @@ -188,7 +188,8 @@ game_storage/* src/shapiq/_version.py # Claude -.claude/ +.claude/settings.local.json +.claude/worktrees/ # C-Extension files *.so @@ -197,5 +198,3 @@ src/shapiq/_version.py docs/source/auto_examples/ docs/source/sg_execution_times.rst docs/source/generated/ - -.claude diff --git a/docs/superpowers/plans/2026-04-15-test-rework.md b/docs/superpowers/plans/2026-04-15-test-rework.md new file mode 100644 index 000000000..f9c114099 --- /dev/null +++ b/docs/superpowers/plans/2026-04-15-test-rework.md @@ -0,0 +1,1592 @@ +# Test Rework Implementation Plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. + +**Goal:** Replace the 75-file shapiq test suite with a protocol-driven 8-file suite that runs in ~1 minute and makes adding new components trivial. + +**Architecture:** Protocol-based testing where each component type (approximator, explainer, imputer, tree) has a registry of configs and a set of universal contract checks. Special cases live as `TestClass` groups in the same file. Two tiers: default (fast, no optional deps) and `@pytest.mark.slow` (CI, optional deps). + +**Tech Stack:** pytest, numpy, shapiq, shapiq_games (DummyGame, SOUM) + +--- + +## File Structure + +| File | Responsibility | +|------|----------------| +| `tests/shapiq/conftest.py` | Shared fixtures: games, tiny datasets, model factories, skip markers | +| `tests/shapiq/test_approximators.py` | Approximator protocol + special-case TestClasses | +| `tests/shapiq/test_explainers.py` | Explainer protocol + special-case TestClasses | +| `tests/shapiq/test_tree.py` | Tree protocol + SHAP comparison (slow) + edge cases | +| `tests/shapiq/test_imputers.py` | Imputer protocol | +| `tests/shapiq/test_interaction_values.py` | InteractionValues data structure tests | +| `tests/shapiq/test_game_theory.py` | ExactComputer, indices, Moebius converter, core | +| `tests/shapiq/test_plots.py` | Plot smoke tests | +| `tests/shapiq/test_public_api.py` | Public API surface checks | + +--- + +### Task 1: Configure pytest tiering and clean up pyproject.toml + +**Files:** +- Modify: `pyproject.toml` + +- [ ] **Step 1: Update pytest configuration** + +In `pyproject.toml`, update the `[tool.pytest.ini_options]` section: + +```toml +[tool.pytest.ini_options] +testpaths = [ + "tests/shapiq", + "tests/shapiq_games" +] +pythonpath = ["src"] +minversion = "8.0" +markers = [ + "slow: marks tests that require > 5s or optional deps (deselect with '-m not slow')", +] +addopts = "-m 'not slow'" +``` + +- [ ] **Step 2: Verify config parses** + +Run: `uv run pytest --collect-only -q tests/shapiq 2>&1 | tail -5` + +Expected: Tests are collected (from old suite still present). No config parse errors. + +- [ ] **Step 3: Commit** + +```bash +git add pyproject.toml +git commit -m "Configure pytest slow marker and default addopts for test tiering" +``` + +--- + +### Task 2: Write conftest.py with shared fixtures + +**Files:** +- Create: `tests/shapiq/conftest_new.py` (temporary name to avoid conflict with old conftest) + +We use a temporary name during migration. Task 9 renames it. + +- [ ] **Step 1: Write the shared conftest** + +Create `tests/shapiq/conftest_new.py`: + +```python +"""Shared fixtures for all shapiq tests.""" + +from __future__ import annotations + +import os + +# Limit OpenMP threads to prevent segfaults when PyTorch/sklearn coexist. +os.environ.setdefault("OMP_NUM_THREADS", "1") +os.environ.setdefault("MKL_NUM_THREADS", "1") + +import importlib.util + +import matplotlib as mpl +import numpy as np +import pytest + +mpl.use("Agg") + +from shapiq.game_theory.exact import ExactComputer +from shapiq_games.synthetic import DummyGame + +# --------------------------------------------------------------------------- +# Skip markers for optional dependencies +# --------------------------------------------------------------------------- + + +def _is_installed(pkg: str) -> bool: + return importlib.util.find_spec(pkg) is not None + + +skip_if_no_xgboost = pytest.mark.skipif( + not _is_installed("xgboost"), reason="xgboost not installed" +) +skip_if_no_lightgbm = pytest.mark.skipif( + not _is_installed("lightgbm"), reason="lightgbm not installed" +) +skip_if_no_tabpfn = pytest.mark.skipif( + not _is_installed("tabpfn"), reason="tabpfn not installed" +) + +# --------------------------------------------------------------------------- +# Games +# --------------------------------------------------------------------------- + + +@pytest.fixture +def dummy_game_3(): + """3-player DummyGame with interaction (0, 1). Fast and deterministic.""" + return DummyGame(n=3, interaction=(0, 1)) + + +@pytest.fixture +def dummy_game_7(): + """7-player DummyGame with interaction (1, 2). Used by approximator protocol.""" + return DummyGame(n=7, interaction=(1, 2)) + + +# --------------------------------------------------------------------------- +# Exact ground truth +# --------------------------------------------------------------------------- + + +@pytest.fixture +def exact_computer_3(dummy_game_3): + """ExactComputer for the 3-player dummy game (2^3 = 8 evaluations).""" + return ExactComputer(dummy_game_3) + + +# --------------------------------------------------------------------------- +# Tiny datasets (no sklearn dependency) +# --------------------------------------------------------------------------- + +_RNG = np.random.default_rng(42) +_TINY_X = _RNG.normal(size=(30, 5)) +_TINY_Y_REG = _TINY_X[:, 0] + 0.5 * _TINY_X[:, 1] + _RNG.normal(0, 0.1, size=30) +_TINY_Y_CLF = (_TINY_Y_REG > np.median(_TINY_Y_REG)).astype(int) + + +@pytest.fixture +def tiny_data(): + """30 samples, 5 features. Regression target.""" + return _TINY_X.copy(), _TINY_Y_REG.copy() + + +@pytest.fixture +def tiny_data_clf(): + """30 samples, 5 features. Binary classification target.""" + return _TINY_X.copy(), _TINY_Y_CLF.copy() + + +# --------------------------------------------------------------------------- +# Model factories (sklearn only — always available) +# --------------------------------------------------------------------------- + + +@pytest.fixture(scope="module") +def dt_reg_model(): + """DecisionTreeRegressor, max_depth=3, fit on tiny data.""" + from sklearn.tree import DecisionTreeRegressor + + model = DecisionTreeRegressor(max_depth=3, random_state=42) + rng = np.random.default_rng(42) + X = rng.normal(size=(30, 5)) + y = X[:, 0] + 0.5 * X[:, 1] + rng.normal(0, 0.1, size=30) + model.fit(X, y) + return model + + +@pytest.fixture(scope="module") +def dt_clf_model(): + """DecisionTreeClassifier, max_depth=3, fit on tiny data.""" + from sklearn.tree import DecisionTreeClassifier + + model = DecisionTreeClassifier(max_depth=3, random_state=42) + rng = np.random.default_rng(42) + X = rng.normal(size=(30, 5)) + y = (X[:, 0] > 0).astype(int) + model.fit(X, y) + return model + + +@pytest.fixture(scope="module") +def rf_reg_model(): + """RandomForestRegressor, 5 trees, max_depth=3, fit on tiny data.""" + from sklearn.ensemble import RandomForestRegressor + + model = RandomForestRegressor(n_estimators=5, max_depth=3, random_state=42) + rng = np.random.default_rng(42) + X = rng.normal(size=(30, 5)) + y = X[:, 0] + 0.5 * X[:, 1] + rng.normal(0, 0.1, size=30) + model.fit(X, y) + return model + + +@pytest.fixture(scope="module") +def rf_clf_model(): + """RandomForestClassifier, 5 trees, max_depth=3, fit on tiny data.""" + from sklearn.ensemble import RandomForestClassifier + + model = RandomForestClassifier(n_estimators=5, max_depth=3, random_state=42) + rng = np.random.default_rng(42) + X = rng.normal(size=(30, 5)) + y = (X[:, 0] > 0).astype(int) + model.fit(X, y) + return model + + +@pytest.fixture(scope="module") +def background_data(): + """Shared background data array for explainer/imputer tests. 30 samples, 5 features.""" + rng = np.random.default_rng(42) + return rng.normal(size=(30, 5)) +``` + +- [ ] **Step 2: Verify fixtures load** + +Run: `uv run python -c "import tests.shapiq.conftest_new; print('OK')"` + +Expected: `OK` (no import errors). + +- [ ] **Step 3: Commit** + +```bash +git add tests/shapiq/conftest_new.py +git commit -m "Add new shared conftest with games, fixtures, and skip markers" +``` + +--- + +### Task 3: Write test_approximators.py + +**Files:** +- Create: `tests/shapiq/test_approximators.py` + +- [ ] **Step 1: Write the approximator protocol and registry** + +Create `tests/shapiq/test_approximators.py`: + +```python +"""Protocol and special-case tests for all approximators.""" + +from __future__ import annotations + +import numpy as np +import pytest + +from shapiq.approximator import ( + SHAPIQ, + SPEX, + SVARM, + SVARMIQ, + InconsistentKernelSHAPIQ, + KernelSHAP, + KernelSHAPIQ, + MSRBiased, + OwenSamplingSV, + PermutationSamplingSII, + PermutationSamplingSTII, + PermutationSamplingSV, + ProxySHAP, + RegressionFBII, + RegressionFSII, + StratifiedSamplingSV, + UnbiasedKernelSHAP, + kADDSHAP, +) +from shapiq.interaction_values import InteractionValues +from shapiq_games.synthetic import DummyGame + +# --------------------------------------------------------------------------- +# Indices where sum(values) == game(N) - game(empty) holds +# --------------------------------------------------------------------------- +EFFICIENT_INDICES = {"SV", "k-SII", "FSII", "STII", "kADD-SHAP"} + +# --------------------------------------------------------------------------- +# Registry: one entry per (approximator, index) combo worth testing. +# Each entry must work with a 7-player DummyGame(interaction=(1,2)). +# --------------------------------------------------------------------------- +ALL_APPROXIMATORS = [ + # --- Permutation --- + {"cls": PermutationSamplingSV, "n": 7, "max_order": 1, "index": "SV", "budget": 80}, + {"cls": PermutationSamplingSII, "n": 7, "max_order": 2, "index": "k-SII", "budget": 100}, + {"cls": PermutationSamplingSTII, "n": 7, "max_order": 2, "index": "STII", "budget": 100}, + # --- Marginals --- + {"cls": OwenSamplingSV, "n": 7, "max_order": 1, "index": "SV", "budget": 80}, + {"cls": StratifiedSamplingSV, "n": 7, "max_order": 1, "index": "SV", "budget": 80}, + # --- Monte Carlo --- + {"cls": SHAPIQ, "n": 7, "max_order": 2, "index": "SII", "budget": 100}, + {"cls": SHAPIQ, "n": 7, "max_order": 2, "index": "k-SII", "budget": 100}, + {"cls": SHAPIQ, "n": 7, "max_order": 2, "index": "FSII", "budget": 100}, + {"cls": SHAPIQ, "n": 7, "max_order": 2, "index": "FBII", "budget": 100}, + {"cls": SHAPIQ, "n": 7, "max_order": 2, "index": "STII", "budget": 100}, + {"cls": UnbiasedKernelSHAP, "n": 7, "max_order": 1, "index": "SV", "budget": 80}, + {"cls": SVARM, "n": 7, "max_order": 1, "index": "SV", "budget": 80}, + {"cls": SVARMIQ, "n": 7, "max_order": 2, "index": "k-SII", "budget": 100}, + {"cls": SVARMIQ, "n": 7, "max_order": 2, "index": "SII", "budget": 100}, + # --- Regression --- + {"cls": KernelSHAP, "n": 7, "max_order": 1, "index": "SV", "budget": 80}, + {"cls": KernelSHAPIQ, "n": 7, "max_order": 2, "index": "k-SII", "budget": 100}, + {"cls": InconsistentKernelSHAPIQ, "n": 7, "max_order": 2, "index": "k-SII", "budget": 100}, + {"cls": kADDSHAP, "n": 7, "max_order": 2, "index": "kADD-SHAP", "budget": 100}, + {"cls": RegressionFSII, "n": 7, "max_order": 2, "index": "FSII", "budget": 100}, + {"cls": RegressionFBII, "n": 7, "max_order": 2, "index": "FBII", "budget": 100}, + # --- Sparse --- + {"cls": SPEX, "n": 7, "max_order": 2, "index": "FSII", "budget": 200}, + # --- Proxy --- + {"cls": MSRBiased, "n": 7, "max_order": 2, "index": "SII", "budget": 100}, + {"cls": MSRBiased, "n": 7, "max_order": 1, "index": "SV", "budget": 80}, +] + + +def _approx_id(config: dict) -> str: + return f"{config['cls'].__name__}-{config['index']}" + + +def _make_approximator(config: dict, **overrides): + kwargs = {"n": config["n"], "max_order": config["max_order"], "index": config["index"]} + kwargs.update(overrides) + return config["cls"](**kwargs) + + +# =================================================================== +# Protocol tests — every approximator must pass these +# =================================================================== + + +@pytest.mark.parametrize("config", ALL_APPROXIMATORS, ids=_approx_id) +class TestApproximatorProtocol: + """Universal contract checks for all approximators.""" + + def test_returns_interaction_values(self, config): + """Approximate returns InteractionValues with correct metadata.""" + game = DummyGame(n=config["n"], interaction=(1, 2)) + approx = _make_approximator(config, random_state=42) + result = approx.approximate(config["budget"], game) + + assert isinstance(result, InteractionValues) + assert result.max_order == config["max_order"] + assert result.n_players == config["n"] + + def test_respects_budget(self, config): + """Game is not called more than budget + 2 times.""" + game = DummyGame(n=config["n"], interaction=(1, 2)) + approx = _make_approximator(config, random_state=42) + approx.approximate(config["budget"], game) + + assert game.access_counter <= config["budget"] + 2 + + def test_reproducible(self, config): + """Same random_state produces identical results.""" + game1 = DummyGame(n=config["n"], interaction=(1, 2)) + game2 = DummyGame(n=config["n"], interaction=(1, 2)) + a1 = _make_approximator(config, random_state=42) + a2 = _make_approximator(config, random_state=42) + r1 = a1.approximate(config["budget"], game1) + r2 = a2.approximate(config["budget"], game2) + + assert np.allclose(r1.values, r2.values) + + def test_rejects_invalid_index(self, config): + """Raises error for indices not in valid_indices.""" + with pytest.raises((ValueError, TypeError)): + _make_approximator(config, index="NOT_A_REAL_INDEX") + + +# =================================================================== +# Special cases +# =================================================================== + + +class TestProxySHAP: + """ProxySHAP delegates to different adjustment strategies.""" + + def test_default_adjustment_is_msr_biased(self): + proxy = ProxySHAP(n=7, max_order=2, index="SII") + assert proxy._adjustment == "msr-b" + + def test_approximate_runs(self): + game = DummyGame(n=7, interaction=(1, 2)) + proxy = ProxySHAP(n=7, max_order=2, index="SII", random_state=42) + result = proxy.approximate(100, game) + assert isinstance(result, InteractionValues) +``` + +- [ ] **Step 2: Run the tests** + +Run: `uv run pytest tests/shapiq/test_approximators.py -v --no-header -p no:conftest 2>&1 | tail -30` + +Note: We use `-p no:conftest` to avoid the old conftest interfering. If that flag doesn't work, just run directly — the new test file doesn't depend on any fixtures from conftest. + +Expected: All tests PASS. No test should depend on conftest fixtures. + +- [ ] **Step 3: Commit** + +```bash +git add tests/shapiq/test_approximators.py +git commit -m "Add protocol-driven approximator tests with registry" +``` + +--- + +### Task 4: Write test_explainers.py + +**Files:** +- Create: `tests/shapiq/test_explainers.py` + +- [ ] **Step 1: Write the explainer protocol tests** + +Create `tests/shapiq/test_explainers.py`: + +```python +"""Protocol and special-case tests for explainers.""" + +from __future__ import annotations + +import numpy as np +import pytest + +from shapiq.explainer.tabular import TabularExplainer +from shapiq.explainer.agnostic import AgnosticExplainer +from shapiq.interaction_values import InteractionValues +from shapiq_games.synthetic import DummyGame + + +# --------------------------------------------------------------------------- +# Helpers +# --------------------------------------------------------------------------- + + +def _linear_model(X: np.ndarray) -> np.ndarray: + """Simple linear model: sum of features.""" + return X.sum(axis=1) + + +def _make_background_data(n_samples: int = 30, n_features: int = 5) -> np.ndarray: + rng = np.random.default_rng(42) + return rng.normal(size=(n_samples, n_features)) + + +# =================================================================== +# TabularExplainer protocol +# =================================================================== + + +TABULAR_CONFIGS = [ + {"index": "SV", "max_order": 1, "approximator": "auto"}, + {"index": "k-SII", "max_order": 2, "approximator": "auto"}, + {"index": "FSII", "max_order": 2, "approximator": "regression"}, + {"index": "SV", "max_order": 1, "approximator": "permutation"}, + {"index": "k-SII", "max_order": 2, "approximator": "montecarlo"}, +] + + +def _tabular_id(config: dict) -> str: + return f"{config['index']}-order{config['max_order']}-{config['approximator']}" + + +@pytest.mark.parametrize("config", TABULAR_CONFIGS, ids=_tabular_id) +class TestTabularExplainerProtocol: + """Contract checks for TabularExplainer.""" + + def test_explain_returns_interaction_values(self, config): + """explain() returns InteractionValues with correct metadata.""" + data = _make_background_data() + explainer = TabularExplainer( + model=_linear_model, + data=data, + index=config["index"], + max_order=config["max_order"], + approximator=config["approximator"], + random_state=42, + ) + x = data[0].reshape(1, -1) + result = explainer.explain(x, budget=2**5) + + assert isinstance(result, InteractionValues) + assert result.index == config["index"] + assert result.max_order == config["max_order"] + + def test_efficiency(self, config): + """sum(values) approximates the prediction for efficient indices.""" + if config["index"] not in {"SV", "k-SII", "FSII"}: + pytest.skip("Efficiency not guaranteed for this index") + data = _make_background_data() + explainer = TabularExplainer( + model=_linear_model, + data=data, + index=config["index"], + max_order=config["max_order"], + approximator=config["approximator"], + random_state=42, + ) + x = data[0].reshape(1, -1) + result = explainer.explain(x, budget=2**5) + prediction = float(_linear_model(x)[0]) + assert float(np.sum(result.values)) == pytest.approx(prediction, abs=0.5) + + def test_reproducible(self, config): + """Same random_state produces identical explanations.""" + data = _make_background_data() + kwargs = { + "model": _linear_model, + "data": data, + "index": config["index"], + "max_order": config["max_order"], + "approximator": config["approximator"], + } + e1 = TabularExplainer(**kwargs, random_state=42) + e2 = TabularExplainer(**kwargs, random_state=42) + x = data[0].reshape(1, -1) + r1 = e1.explain(x, budget=2**5, random_state=42) + r2 = e2.explain(x, budget=2**5, random_state=42) + assert np.allclose(r1.values, r2.values) + + +# =================================================================== +# AgnosticExplainer +# =================================================================== + + +class TestAgnosticExplainer: + """AgnosticExplainer wraps a Game or callable directly.""" + + def test_explain_with_game(self): + game = DummyGame(n=5, interaction=(0, 1)) + explainer = AgnosticExplainer(game=game, index="k-SII", max_order=2, random_state=42) + result = explainer.explain(budget=100) + assert isinstance(result, InteractionValues) + assert result.n_players == 5 + + def test_explain_with_callable(self): + def my_game(coalitions): + return coalitions.sum(axis=1).astype(float) + + explainer = AgnosticExplainer( + game=my_game, n_players=4, index="SV", max_order=1, random_state=42 + ) + result = explainer.explain(budget=50) + assert isinstance(result, InteractionValues) + assert result.n_players == 4 + + +# =================================================================== +# TabularExplainer special cases +# =================================================================== + + +class TestTabularExplainerValidation: + """Input validation and edge cases.""" + + def test_invalid_index_raises(self): + data = _make_background_data() + with pytest.raises(ValueError): + TabularExplainer(model=_linear_model, data=data, index="INVALID", max_order=2) + + def test_invalid_approximator_raises(self): + data = _make_background_data() + with pytest.raises(ValueError): + TabularExplainer(model=_linear_model, data=data, approximator="not_real") + + def test_sv_with_high_order_warns(self): + data = _make_background_data() + with pytest.warns(UserWarning): + TabularExplainer(model=_linear_model, data=data, index="SV", max_order=2) + + def test_explain_X_batch(self): + """explain_X returns a list of InteractionValues.""" + data = _make_background_data() + explainer = TabularExplainer( + model=_linear_model, data=data, index="SV", max_order=1, random_state=42 + ) + results = explainer.explain_X(data[:3], budget=2**5) + assert len(results) == 3 + assert all(isinstance(r, InteractionValues) for r in results) +``` + +- [ ] **Step 2: Run the tests** + +Run: `uv run pytest tests/shapiq/test_explainers.py -v --no-header 2>&1 | tail -30` + +Expected: All tests PASS. + +- [ ] **Step 3: Commit** + +```bash +git add tests/shapiq/test_explainers.py +git commit -m "Add protocol-driven explainer tests" +``` + +--- + +### Task 5: Write test_tree.py + +**Files:** +- Create: `tests/shapiq/test_tree.py` + +- [ ] **Step 1: Write tree protocol, SHAP comparison, and edge cases** + +Create `tests/shapiq/test_tree.py`: + +```python +"""Protocol, SHAP comparison, and edge-case tests for the tree module.""" + +from __future__ import annotations + +import copy +import importlib.util + +import numpy as np +import pytest + +from shapiq.interaction_values import InteractionValues +from shapiq.tree import TreeExplainer, TreeModel + +# --------------------------------------------------------------------------- +# Skip markers +# --------------------------------------------------------------------------- +skip_if_no_xgboost = pytest.mark.skipif( + not importlib.util.find_spec("xgboost"), reason="xgboost not installed" +) +skip_if_no_lightgbm = pytest.mark.skipif( + not importlib.util.find_spec("lightgbm"), reason="lightgbm not installed" +) + +# --------------------------------------------------------------------------- +# Shared data (module-level, generated once) +# --------------------------------------------------------------------------- +_RNG = np.random.default_rng(42) +_BG_REG_X = _RNG.normal(size=(30, 7)) +_BG_REG_Y = _BG_REG_X[:, 0] + 0.5 * _BG_REG_X[:, 1] + _RNG.normal(0, 0.1, size=30) +_BG_CLF_Y = (_BG_REG_Y > np.median(_BG_REG_Y)).astype(int) + + +# --------------------------------------------------------------------------- +# Model fixtures +# --------------------------------------------------------------------------- + + +@pytest.fixture(scope="module") +def dt_reg(): + from sklearn.tree import DecisionTreeRegressor + + m = DecisionTreeRegressor(max_depth=3, random_state=42) + m.fit(_BG_REG_X, _BG_REG_Y) + return m + + +@pytest.fixture(scope="module") +def rf_reg(): + from sklearn.ensemble import RandomForestRegressor + + m = RandomForestRegressor(n_estimators=5, max_depth=3, random_state=42) + m.fit(_BG_REG_X, _BG_REG_Y) + return m + + +@pytest.fixture(scope="module") +def rf_clf(): + from sklearn.ensemble import RandomForestClassifier + + m = RandomForestClassifier(n_estimators=5, max_depth=3, random_state=42) + m.fit(_BG_REG_X, _BG_CLF_Y) + return m + + +@pytest.fixture(scope="module") +def et_reg(): + from sklearn.ensemble import ExtraTreesRegressor + + m = ExtraTreesRegressor(n_estimators=5, max_depth=3, random_state=42) + m.fit(_BG_REG_X, _BG_REG_Y) + return m + + +@pytest.fixture(scope="module") +def xgb_reg(): + pytest.importorskip("xgboost") + from xgboost import XGBRegressor + + m = XGBRegressor(n_estimators=3, max_depth=3, random_state=42) + m.fit(_BG_REG_X, _BG_REG_Y) + return m + + +@pytest.fixture(scope="module") +def xgb_clf(): + pytest.importorskip("xgboost") + from xgboost import XGBClassifier + + m = XGBClassifier(n_estimators=3, max_depth=3, random_state=42, use_label_encoder=False) + m.fit(_BG_REG_X, _BG_CLF_Y) + return m + + +@pytest.fixture(scope="module") +def lgbm_clf(): + pytest.importorskip("lightgbm") + from lightgbm import LGBMClassifier + + m = LGBMClassifier(n_estimators=3, max_depth=3, random_state=42, verbose=-1) + m.fit(_BG_REG_X, _BG_CLF_Y) + return m + + +# =================================================================== +# Protocol: every tree model must satisfy these +# =================================================================== + + +SKLEARN_TREE_MODELS = [ + ("dt_reg", "regression", None), + ("rf_reg", "regression", None), + ("rf_clf", "classification", 0), + ("et_reg", "regression", None), +] + +OPTIONAL_TREE_MODELS = [ + pytest.param("xgb_reg", "regression", None, marks=skip_if_no_xgboost), + pytest.param("xgb_clf", "classification", 0, marks=skip_if_no_xgboost), + pytest.param("lgbm_clf", "classification", 0, marks=skip_if_no_lightgbm), +] + +ALL_TREE_MODELS = SKLEARN_TREE_MODELS + OPTIONAL_TREE_MODELS + + +@pytest.mark.parametrize( + ("model_fixture", "task", "class_index"), + ALL_TREE_MODELS, + ids=[t[0] if isinstance(t, tuple) else t.values[0] for t in ALL_TREE_MODELS], +) +class TestTreeProtocol: + """Universal contract checks for tree explainers across model types.""" + + def test_explain_returns_interaction_values(self, model_fixture, task, class_index, request): + model = request.getfixturevalue(model_fixture) + explainer = TreeExplainer(model=model, max_order=2, min_order=1, class_index=class_index) + x = _BG_REG_X[0] + result = explainer.explain(x) + + assert isinstance(result, InteractionValues) + assert result.max_order == 2 + assert result.n_players == _BG_REG_X.shape[1] + + def test_efficiency(self, model_fixture, task, class_index, request): + """sum(values) == prediction for SV.""" + model = request.getfixturevalue(model_fixture) + explainer = TreeExplainer( + model=model, max_order=1, min_order=0, index="SV", class_index=class_index + ) + x = _BG_REG_X[0] + result = explainer.explain(x) + + if task == "regression": + prediction = float(model.predict(x.reshape(1, -1))[0]) + else: + prediction = float(model.predict_proba(x.reshape(1, -1))[0, class_index]) + + assert float(np.sum(result.values)) == pytest.approx(prediction, rel=1e-4) + + def test_baseline_matches_empty_prediction(self, model_fixture, task, class_index, request): + model = request.getfixturevalue(model_fixture) + explainer = TreeExplainer( + model=model, max_order=1, min_order=0, index="SV", class_index=class_index + ) + expected_baseline = sum( + te.empty_prediction for te in explainer._treeshapiq_explainers + ) + assert explainer.baseline_value == pytest.approx(expected_baseline) + + +# =================================================================== +# Manual TreeModel test (no sklearn dependency) +# =================================================================== + + +class TestManualTreeModel: + """Test TreeExplainer with a hand-crafted TreeModel.""" + + def test_against_known_values(self): + """Verify SV computation against known SHAP library values.""" + children_left = np.asarray([1, 2, 3, -1, -1, -1, 7, -1, -1]) + children_right = np.asarray([6, 5, 4, -1, -1, -1, 8, -1, -1]) + features = np.asarray([0, 1, 0, -2, -2, -2, 2, -2, -2]) + thresholds = np.asarray([0, 0, -0.5, -2, -2, -2, 0, -2, -2]) + node_sample_weight = np.asarray([100, 50, 38, 15, 23, 12, 50, 20, 30]) + values = [110, 105, 95, 20, 50, 100, 75, 10, 40] + values = np.asarray([v / max(values) for v in values]) + + tree_model = TreeModel( + children_left=children_left, + children_right=children_right, + children_missing=children_left, + features=features, + thresholds=thresholds, + node_sample_weight=node_sample_weight, + values=values, + ) + + x = np.asarray([-1, -0.5, 1, 0]) + explainer = TreeExplainer(model=tree_model, max_order=1, min_order=1, index="SV") + result = explainer.explain(x) + + assert result[(0,)] == pytest.approx(-0.09263158, abs=1e-4) + assert result[(1,)] == pytest.approx(-0.12100478, abs=1e-4) + assert result[(2,)] == pytest.approx(0.02727273, abs=1e-4) + assert result[(3,)] == pytest.approx(0.0, abs=1e-4) + + def test_sv_warning_for_order_2(self): + """SV with max_order > 1 should warn.""" + children_left = np.asarray([1, -1, -1]) + children_right = np.asarray([2, -1, -1]) + features = np.asarray([0, -2, -2]) + thresholds = np.asarray([0.0, -2.0, -2.0]) + node_sample_weight = np.asarray([10, 5, 5]) + values = np.asarray([0.5, 0.3, 0.7]) + + tree_model = TreeModel( + children_left=children_left, + children_right=children_right, + children_missing=children_left, + features=features, + thresholds=thresholds, + node_sample_weight=node_sample_weight, + values=values, + ) + with pytest.warns(UserWarning): + TreeExplainer(model=tree_model, max_order=2, min_order=1, index="SV") + + +# =================================================================== +# Edge cases (regression tests for past bugs) +# =================================================================== + + +class TestTreeEdgeCases: + """Regression tests for specific bugs fixed in the tree module.""" + + def test_high_dimensional_indices_do_not_overflow(self): + """Regression: int64 indices with >127 features (was overflowing to int8).""" + from shapiq.approximator.proxy.proxyshap import MSRBiased + from shapiq.tree.interventional.cext import compute_interactions_sparse + + n_features = 170 + approximator = MSRBiased(n=n_features, max_order=1, index="SV") + coalition_matrix = np.zeros((3, n_features), dtype=np.int64) + coalition_matrix[0, :5] = 1 + coalition_matrix[1, 100:110] = 1 + coalition_matrix[2, 160:] = 1 + + e_matrix, r_matrix, e_counts, r_counts = approximator._coalitions_to_tree_paths( + coalition_matrix + ) + + assert e_matrix.dtype == np.int64 + assert r_matrix.dtype == np.int64 + + coalition_values = np.array([0.1, -0.2, 0.3], dtype=np.float32) + interactions = compute_interactions_sparse( + coalition_values, e_matrix, r_matrix, e_counts, r_counts, "SV", n_features, 1 + ) + assert isinstance(interactions, dict) + assert all(0 <= f < n_features for key in interactions for f in key) + + def test_repeated_flatten_calls_no_segfault(self): + """Regression: refcount corruption in C-extension flatten output.""" + from shapiq.tree.interventional.cext import compute_interactions_flatten + + n_features = 200 + n_iterations = n_features + leaf_predictions = np.ones(n_iterations, dtype=np.float32) + features = np.arange(n_features, dtype=np.int64) + e_sizes = np.ones(n_iterations, dtype=np.int64) + r_sizes = np.zeros(n_iterations, dtype=np.int64) + feature_in_e = np.ones(n_iterations, dtype=np.int64) + leaf_id = np.zeros(n_iterations, dtype=np.int64) + + for _ in range(5): + out = compute_interactions_flatten( + leaf_predictions, features, e_sizes, r_sizes, feature_in_e, leaf_id, + "SV", n_iterations, n_features, n_iterations, 1, 0, 1.0, + ) + assert len(out) == n_features +``` + +- [ ] **Step 2: Run the tests** + +Run: `uv run pytest tests/shapiq/test_tree.py -v --no-header 2>&1 | tail -40` + +Expected: All tests PASS. Optional-dep tests are skipped if xgboost/lightgbm not installed. + +- [ ] **Step 3: Commit** + +```bash +git add tests/shapiq/test_tree.py +git commit -m "Add protocol-driven tree tests with SHAP comparison and edge cases" +``` + +--- + +### Task 6: Write test_imputers.py + +**Files:** +- Create: `tests/shapiq/test_imputers.py` + +- [ ] **Step 1: Write imputer protocol tests** + +Create `tests/shapiq/test_imputers.py`: + +```python +"""Protocol tests for all imputers.""" + +from __future__ import annotations + +import numpy as np +import pytest + +from shapiq.imputer import ( + BaselineImputer, + GaussianCopulaImputer, + GaussianImputer, + MarginalImputer, +) +from shapiq.interaction_values import InteractionValues + +# --------------------------------------------------------------------------- +# Shared helpers +# --------------------------------------------------------------------------- + +_RNG = np.random.default_rng(42) +_DATA = _RNG.normal(size=(30, 5)) +_Y = _DATA[:, 0] + 0.5 * _DATA[:, 1] + + +def _simple_model(X: np.ndarray) -> np.ndarray: + return X.sum(axis=1) + + +# --------------------------------------------------------------------------- +# Registry +# --------------------------------------------------------------------------- + +IMPUTER_CONFIGS = [ + {"cls": MarginalImputer, "kwargs": {"sample_size": 10}}, + {"cls": BaselineImputer, "kwargs": {}}, + {"cls": GaussianImputer, "kwargs": {"sample_size": 10}}, + {"cls": GaussianCopulaImputer, "kwargs": {"sample_size": 10}}, +] + + +def _imputer_id(config: dict) -> str: + return config["cls"].__name__ + + +# =================================================================== +# Protocol +# =================================================================== + + +@pytest.mark.parametrize("config", IMPUTER_CONFIGS, ids=_imputer_id) +class TestImputerProtocol: + """Contract checks for all imputers.""" + + def test_fit_and_call(self, config): + """fit() + __call__() produces array of correct length.""" + imputer = config["cls"](model=_simple_model, data=_DATA.copy(), **config["kwargs"]) + imputer.fit(_DATA[0]) + + # All features present + coalition_all = np.ones((1, 5), dtype=bool) + result = imputer(coalition_all) + assert result.shape == (1,) + + # No features present + coalition_none = np.zeros((1, 5), dtype=bool) + result = imputer(coalition_none) + assert result.shape == (1,) + + def test_multiple_coalitions(self, config): + """Handles batch of coalitions.""" + imputer = config["cls"](model=_simple_model, data=_DATA.copy(), **config["kwargs"]) + imputer.fit(_DATA[0]) + + coalitions = np.eye(5, dtype=bool) # one feature at a time + result = imputer(coalitions) + assert result.shape == (5,) + + def test_full_coalition_approximates_prediction(self, config): + """With all features present, result should be close to model prediction.""" + imputer = config["cls"]( + model=_simple_model, data=_DATA.copy(), random_state=42, **config["kwargs"] + ) + x = _DATA[0] + imputer.fit(x) + + coalition_all = np.ones((1, 5), dtype=bool) + result = float(imputer(coalition_all)[0]) + expected = float(_simple_model(x.reshape(1, -1))[0]) + + assert result == pytest.approx(expected, abs=0.5) +``` + +- [ ] **Step 2: Run the tests** + +Run: `uv run pytest tests/shapiq/test_imputers.py -v --no-header 2>&1 | tail -20` + +Expected: All tests PASS. + +- [ ] **Step 3: Commit** + +```bash +git add tests/shapiq/test_imputers.py +git commit -m "Add protocol-driven imputer tests" +``` + +--- + +### Task 7: Write test_interaction_values.py + +**Files:** +- Create: `tests/shapiq/test_interaction_values.py` + +This condenses the old 896-line test file to its essence: creation, access, serialization, aggregation. + +- [ ] **Step 1: Write InteractionValues tests** + +Create `tests/shapiq/test_interaction_values.py`: + +```python +"""Tests for the InteractionValues data structure.""" + +from __future__ import annotations + +import json +import pathlib + +import numpy as np +import pytest + +from shapiq.interaction_values import InteractionValues, aggregate_interaction_values +from shapiq.utils import powerset + + +# --------------------------------------------------------------------------- +# Helpers +# --------------------------------------------------------------------------- + + +def _make_iv( + n_players: int = 5, + max_order: int = 2, + min_order: int = 1, + index: str = "k-SII", + baseline: float = 1.0, +) -> InteractionValues: + """Create a deterministic InteractionValues for testing.""" + interaction_lookup = {} + values = [] + for i, interaction in enumerate( + powerset(range(n_players), min_size=min_order, max_size=max_order) + ): + interaction_lookup[interaction] = i + values.append(float(i) * 0.1) + return InteractionValues( + values=np.array(values), + index=index, + n_players=n_players, + min_order=min_order, + max_order=max_order, + interaction_lookup=interaction_lookup, + baseline_value=baseline, + estimated=True, + estimation_budget=100, + ) + + +# =================================================================== +# Creation & basic access +# =================================================================== + + +class TestCreation: + def test_basic_properties(self): + iv = _make_iv() + assert iv.n_players == 5 + assert iv.max_order == 2 + assert iv.min_order == 1 + assert iv.index == "k-SII" + assert iv.baseline_value == 1.0 + assert iv.estimated is True + assert iv.estimation_budget == 100 + + def test_getitem_single_interaction(self): + iv = _make_iv() + val = iv[(0,)] + assert isinstance(val, float) + + def test_getitem_missing_returns_zero(self): + iv = _make_iv(max_order=1) + assert iv[(0, 1)] == 0.0 + + def test_empty_interaction_is_baseline(self): + iv = _make_iv(min_order=0) + assert iv[()] == pytest.approx(iv.baseline_value) + + @pytest.mark.parametrize( + ("index", "should_warn"), + [("k-SII", False), ("SII", False), ("NOT_VALID", True)], + ) + def test_invalid_index_warns(self, index, should_warn): + if should_warn: + with pytest.warns(UserWarning): + _make_iv(index=index) + else: + _make_iv(index=index) # should not warn + + +# =================================================================== +# Order extraction +# =================================================================== + + +class TestOrderExtraction: + def test_get_n_order_values_shape(self): + iv = _make_iv(n_players=5, max_order=2, min_order=1) + order_1 = iv.get_n_order_values(1) + assert order_1.shape == (5,) + + def test_get_n_order(self): + iv = _make_iv(n_players=5, max_order=2, min_order=1) + iv_order1 = iv.get_n_order(order=1) + assert iv_order1.max_order == 1 + assert iv_order1.min_order == 1 + + +# =================================================================== +# Serialization +# =================================================================== + + +class TestSerialization: + def test_json_roundtrip(self, tmp_path): + iv = _make_iv() + path = tmp_path / "test_iv.json" + iv.to_json_file(path) + loaded = InteractionValues.from_json_file(path) + + assert loaded.n_players == iv.n_players + assert loaded.index == iv.index + assert np.allclose(loaded.values, iv.values) + assert loaded.baseline_value == pytest.approx(iv.baseline_value) + + +# =================================================================== +# Aggregation +# =================================================================== + + +class TestAggregation: + def test_aggregate_mean(self): + iv1 = _make_iv() + iv2 = _make_iv() + iv2_values = iv2.values.copy() + iv2_values[:] = 1.0 + iv2 = InteractionValues( + values=iv2_values, + index=iv1.index, + n_players=iv1.n_players, + min_order=iv1.min_order, + max_order=iv1.max_order, + interaction_lookup=dict(iv1.interaction_lookup), + baseline_value=iv1.baseline_value, + ) + result = aggregate_interaction_values([iv1, iv2]) + assert isinstance(result, InteractionValues) + assert result.n_players == iv1.n_players + + +# =================================================================== +# Copy behavior +# =================================================================== + + +class TestCopy: + def test_deepcopy_independent(self): + from copy import deepcopy + + iv = _make_iv() + iv_copy = deepcopy(iv) + iv_copy.values[0] = 999.0 + assert iv.values[0] != 999.0 +``` + +- [ ] **Step 2: Run the tests** + +Run: `uv run pytest tests/shapiq/test_interaction_values.py -v --no-header 2>&1 | tail -20` + +Expected: All tests PASS. + +- [ ] **Step 3: Commit** + +```bash +git add tests/shapiq/test_interaction_values.py +git commit -m "Add condensed InteractionValues tests" +``` + +--- + +### Task 8: Write test_game_theory.py, test_plots.py, test_public_api.py + +**Files:** +- Create: `tests/shapiq/test_game_theory.py` +- Create: `tests/shapiq/test_plots.py` +- Create: `tests/shapiq/test_public_api.py` + +- [ ] **Step 1: Write test_game_theory.py** + +Create `tests/shapiq/test_game_theory.py`: + +```python +"""Tests for game theory module: ExactComputer, indices, Moebius converter.""" + +from __future__ import annotations + +import numpy as np +import pytest + +from shapiq.game_theory.exact import ExactComputer +from shapiq.game_theory.indices import ( + AllIndices, + get_computation_index, + index_generalizes_bv, + index_generalizes_sv, + is_index_valid, +) +from shapiq.game_theory.moebius_converter import MoebiusConverter +from shapiq.interaction_values import InteractionValues +from shapiq_games.synthetic import DummyGame + + +# =================================================================== +# ExactComputer +# =================================================================== + + +class TestExactComputer: + """Tests for exact computation of interaction indices.""" + + def test_sv_on_dummy_game(self): + game = DummyGame(n=3, interaction=(0, 1)) + computer = ExactComputer(game) + sv = computer("SV", order=1) + + assert isinstance(sv, InteractionValues) + assert sv.index == "SV" + assert sv.n_players == 3 + + # SV satisfies efficiency: sum = game(N) - game(empty) + grand = float(game(np.ones((1, 3), dtype=bool))[0]) + empty = float(game(np.zeros((1, 3), dtype=bool))[0]) + assert float(np.sum(sv.values)) == pytest.approx(grand - empty, abs=1e-10) + + def test_sii_on_dummy_game(self): + game = DummyGame(n=3, interaction=(0, 1)) + computer = ExactComputer(game) + sii = computer("SII", order=2) + + assert isinstance(sii, InteractionValues) + assert sii.index == "SII" + assert sii.max_order == 2 + + def test_k_sii_on_dummy_game(self): + game = DummyGame(n=3, interaction=(0, 1)) + computer = ExactComputer(game) + k_sii = computer("k-SII", order=2) + + assert isinstance(k_sii, InteractionValues) + assert k_sii.index == "k-SII" + + # k-SII satisfies efficiency + grand = float(game(np.ones((1, 3), dtype=bool))[0]) + empty = float(game(np.zeros((1, 3), dtype=bool))[0]) + assert float(np.sum(k_sii.values)) == pytest.approx(grand - empty, abs=1e-10) + + @pytest.mark.parametrize("index", ["SV", "SII", "k-SII", "STII", "FSII", "FBII", "BV", "BII"]) + def test_all_common_indices(self, index): + """ExactComputer should handle all common indices without error.""" + game = DummyGame(n=3, interaction=(0, 1)) + computer = ExactComputer(game) + order = 1 if index in ("SV", "BV") else 2 + result = computer(index, order=order) + assert isinstance(result, InteractionValues) + + def test_moebius_values(self): + game = DummyGame(n=3, interaction=(0, 1)) + computer = ExactComputer(game) + moebius = computer("Moebius", order=3) + assert isinstance(moebius, InteractionValues) + + +# =================================================================== +# Index utilities +# =================================================================== + + +class TestIndices: + def test_is_index_valid_true(self): + assert is_index_valid("SV") + assert is_index_valid("k-SII") + + def test_is_index_valid_false(self): + assert not is_index_valid("NOT_REAL") + + def test_is_index_valid_raises(self): + with pytest.raises(ValueError): + is_index_valid("NOT_REAL", raise_error=True) + + def test_generalizes_sv(self): + assert index_generalizes_sv("SII") + assert index_generalizes_sv("k-SII") + assert not index_generalizes_sv("BV") + assert not index_generalizes_sv("SV") + + def test_generalizes_bv(self): + assert index_generalizes_bv("BII") + assert not index_generalizes_bv("SII") + + def test_get_computation_index(self): + assert get_computation_index("k-SII") == "SII" + assert get_computation_index("SV") == "SII" + assert get_computation_index("BV") == "BII" + assert get_computation_index("STII") == "STII" + + +# =================================================================== +# Moebius converter +# =================================================================== + + +class TestMoebiusConverter: + def test_sii_to_k_sii_roundtrip(self): + """Convert SII -> k-SII and verify it's a valid InteractionValues.""" + game = DummyGame(n=3, interaction=(0, 1)) + computer = ExactComputer(game) + sii = computer("SII", order=2) + + converter = MoebiusConverter(sii) + k_sii = converter("k-SII") + + assert isinstance(k_sii, InteractionValues) + assert k_sii.index == "k-SII" +``` + +- [ ] **Step 2: Write test_plots.py** + +Create `tests/shapiq/test_plots.py`: + +```python +"""Smoke tests for plotting functions — verify they run without error.""" + +from __future__ import annotations + +import numpy as np +import pytest +import matplotlib.pyplot as plt + +from shapiq.interaction_values import InteractionValues +from shapiq.utils import powerset +from shapiq.plots import ( + bar_plot, + force_plot, + waterfall_plot, +) + + +@pytest.fixture +def sample_iv(): + """Small InteractionValues for plotting.""" + n = 4 + interaction_lookup = {} + values = [] + for i, interaction in enumerate(powerset(range(n), min_size=1, max_size=2)): + interaction_lookup[interaction] = i + values.append(float(i) * 0.1 - 0.3) + return InteractionValues( + values=np.array(values), + index="k-SII", + n_players=n, + min_order=1, + max_order=2, + interaction_lookup=interaction_lookup, + baseline_value=0.5, + ) + + +class TestPlots: + """Smoke tests: plots run without raising.""" + + def test_bar_plot(self, sample_iv): + fig = bar_plot(sample_iv.get_n_order(order=1)) + plt.close("all") + + def test_waterfall_plot(self, sample_iv): + fig = waterfall_plot(sample_iv.get_n_order(order=1)) + plt.close("all") + + def test_force_plot(self, sample_iv): + fig = force_plot(sample_iv.get_n_order(order=1)) + plt.close("all") +``` + +- [ ] **Step 3: Write test_public_api.py** + +Create `tests/shapiq/test_public_api.py`: + +```python +"""Tests that every concrete public subclass is registered in its module's __all__. + +These guard against adding a new subclass without listing it in __all__. +""" + +from __future__ import annotations + +import importlib +import inspect + +import pytest + + +def _find_concrete_subclasses(module: object, base: type) -> set[str]: + """Return names of all concrete, public subclasses of base visible in module.""" + return { + name + for name, obj in inspect.getmembers(module, inspect.isclass) + if issubclass(obj, base) + and obj is not base + and not inspect.isabstract(obj) + and not name.startswith("_") + } + + +@pytest.mark.parametrize( + ("module_path", "base_path"), + [ + ("shapiq.approximator", "shapiq.approximator.base:Approximator"), + ("shapiq.explainer", "shapiq.explainer.base:Explainer"), + ("shapiq.imputer", "shapiq.imputer.base:Imputer"), + ], + ids=["approximator", "explainer", "imputer"], +) +def test_all_concrete_subclasses_in_all(module_path: str, base_path: str) -> None: + """Every concrete public subclass must appear in its module's __all__.""" + module = importlib.import_module(module_path) + base_module_path, base_class_name = base_path.split(":") + base: type = getattr(importlib.import_module(base_module_path), base_class_name) + + concrete = _find_concrete_subclasses(module, base) + exported = set(module.__all__) + missing = concrete - exported + + pkg_init = f"src/shapiq/{module_path.split('.')[-1]}/__init__.py" + assert not missing, ( + f"Concrete subclasses not listed in {module_path}.__all__: {missing}. " + f"Add them to {pkg_init}." + ) +``` + +- [ ] **Step 4: Run all three files** + +Run: `uv run pytest tests/shapiq/test_game_theory.py tests/shapiq/test_plots.py tests/shapiq/test_public_api.py -v --no-header 2>&1 | tail -30` + +Expected: All tests PASS. + +- [ ] **Step 5: Commit** + +```bash +git add tests/shapiq/test_game_theory.py tests/shapiq/test_plots.py tests/shapiq/test_public_api.py +git commit -m "Add game theory, plot smoke, and public API tests" +``` + +--- + +### Task 9: Verify new suite, delete old tests, finalize conftest + +**Files:** +- Delete: `tests/shapiq/tests_unit/` (entire directory) +- Delete: `tests/shapiq/tests_integration_tests/` (entire directory) +- Delete: `tests/shapiq/tests_deprecation/` (entire directory) +- Delete: `tests/shapiq/fixtures/` (entire directory) +- Delete: `tests/shapiq/data/` (entire directory) +- Delete: `tests/shapiq/markers.py` +- Delete: `tests/shapiq/utils.py` +- Delete: `tests/shapiq/conftest.py` (old) +- Rename: `tests/shapiq/conftest_new.py` -> `tests/shapiq/conftest.py` + +- [ ] **Step 1: Run the full new suite and verify it passes** + +Run: `uv run pytest tests/shapiq/test_approximators.py tests/shapiq/test_explainers.py tests/shapiq/test_tree.py tests/shapiq/test_imputers.py tests/shapiq/test_interaction_values.py tests/shapiq/test_game_theory.py tests/shapiq/test_plots.py tests/shapiq/test_public_api.py -v --tb=short 2>&1 | tail -40` + +Expected: All new tests PASS. Note the test count and runtime. + +- [ ] **Step 2: Rename conftest** + +```bash +mv tests/shapiq/conftest_new.py tests/shapiq/conftest.py +``` + +- [ ] **Step 3: Delete old test directories and files** + +```bash +rm -rf tests/shapiq/tests_unit +rm -rf tests/shapiq/tests_integration_tests +rm -rf tests/shapiq/tests_deprecation +rm -rf tests/shapiq/fixtures +rm -rf tests/shapiq/data +rm -f tests/shapiq/markers.py +rm -f tests/shapiq/utils.py +``` + +- [ ] **Step 4: Delete the old __init__.py if it references removed modules** + +Check `tests/shapiq/__init__.py` and `tests/__init__.py`. If they import from deleted modules, clean them up. If they're empty or just have `from __future__ import annotations`, leave them. + +- [ ] **Step 5: Run the full suite from the project root** + +Run: `uv run pytest tests/shapiq -v --tb=short 2>&1 | tail -40` + +Expected: All tests PASS from the standard test path. No import errors from deleted modules. + +- [ ] **Step 6: Run with slow marker to verify tiering** + +Run: `uv run pytest tests/shapiq -m '' -v --tb=short 2>&1 | tail -10` + +Expected: Slow tests also run (if optional deps are installed). + +- [ ] **Step 7: Run pre-commit** + +Run: `uv run pre-commit run --all-files` + +Expected: All hooks pass. + +- [ ] **Step 8: Commit** + +```bash +git add -A tests/shapiq +git commit -m "Remove old test suite, finalize protocol-driven test rework + +Replaces 75 test files (~10k lines) with 8 files (~1.5k lines). +Protocol tests auto-discover approximators, explainers, imputers, and tree models. +Two tiers: default (~1min) and slow (CI, optional deps)." +``` + +--- + +### Task 10: Final verification and timing + +- [ ] **Step 1: Time the default suite** + +Run: `uv run pytest tests/shapiq --tb=short -q 2>&1` + +Note the total runtime. Target: ~1 minute. + +- [ ] **Step 2: Time the full suite** + +Run: `uv run pytest tests/shapiq -m '' --tb=short -q 2>&1` + +Note the total runtime. Target: ~2-3 minutes. + +- [ ] **Step 3: Verify adding a new approximator is trivial** + +Mentally verify: to add a new approximator, you would append one dict to `ALL_APPROXIMATORS` in `test_approximators.py`. That dict has 5 keys: `cls`, `n`, `max_order`, `index`, `budget`. The protocol tests automatically run against it. + +- [ ] **Step 4: Commit timing results as a comment in the spec** + +No commit needed — just verify the targets are met and report back. diff --git a/docs/superpowers/specs/2026-04-15-test-rework-design.md b/docs/superpowers/specs/2026-04-15-test-rework-design.md new file mode 100644 index 000000000..a6b1d2d4e --- /dev/null +++ b/docs/superpowers/specs/2026-04-15-test-rework-design.md @@ -0,0 +1,271 @@ +# Test Rework Design Spec + +**Date:** 2026-04-15 +**Branch:** `rework-tests` +**Scope:** `tests/shapiq/` only (`shapiq_games` excluded) + +## Problem + +The current test suite has 321 tests across 75 files (~10k lines of test code) testing ~20.6k lines +of source code. Key issues: + +1. **Noise:** 23 nearly identical approximator test files. Tree explainer tests repeat the same + pattern per model type. Plot tests are 13 files for smoke tests. +2. **Slow:** 3-5 minutes. Parametrization explosion (budgets x orders x imputers), repeated model + fitting, no tiering between fast and slow tests. +3. **Low confidence:** Approximator tests use 40% tolerances (`pytest.approx(1.0, 0.4)`). Many + tests only check `isinstance(result, InteractionValues)` — smoke tests dressed as unit tests. +4. **Development friction:** Adding a new approximator requires creating a new test file and + copy-pasting the same pattern. No shared infrastructure enforcing correctness contracts. + +## Goals + +- **Correctness:** Tests verify contracts and mathematical properties, not rough estimates. +- **Development velocity:** Adding a new approximator = adding one fixture/dict entry. Protocol + tests pick it up automatically. +- **Speed:** ~1 minute default, ~2-3 minutes with slow/CI markers. +- **Readability:** Every test is easy to understand. No navigating 75 files. + +## Design + +### File Structure + +``` +tests/shapiq/ +├── conftest.py # shared fixtures: games, tiny datasets, model factories +├── test_approximators.py # protocol + TestClass special cases +├── test_explainers.py # protocol + TestClass special cases +├── test_tree.py # protocol + TestClass special cases +├── test_imputers.py # protocol + TestClass special cases +├── test_interaction_values.py # data structure correctness +├── test_game_theory.py # exact computer, indices, moebius converter +├── test_plots.py # smoke tests +└── test_public_api.py # import surface checks +``` + +**8 files.** Down from 75. Split a file only if it exceeds ~400 lines. + +### Tiering + +Two tiers via pytest markers: + +- **Default (no marker):** Runs in ~1 minute. Small games (3-7 players), tiny datasets (30 samples, + 5 features), no optional dependencies. This is the "I changed a line" feedback loop. +- **`@pytest.mark.slow`:** CI only, adds optional-dependency tests (TabPFN, heavy models, SHAP + comparison). Total ~2-3 minutes. + +Configuration in `pyproject.toml`: + +```toml +[tool.pytest.ini_options] +markers = ["slow: marks tests that require > 5s or optional deps (deselect with '-m not slow')"] +addopts = "-m 'not slow'" +``` + +`pytest` runs the fast suite. `pytest -m ''` runs everything. + +### Fixtures & Shared Infrastructure + +All fixtures live in `conftest.py`. Key principles: + +- **No files on disk.** Everything computed or constructed in fixtures. +- **Small games for protocol tests.** 3-7 players so ExactComputer runs in microseconds. +- **Tiny datasets.** 30 samples, 5 features — enough to fit a real model, fast enough not to matter. +- **Lazy model creation.** Models only instantiated when a test requests them. +- **`module` or `session` scope** for expensive fixtures (model fitting). +- **Dependency on `shapiq_games`** for `DummyGame`, `SOUM`, and other test games. + +#### Example fixtures + +```python +@pytest.fixture +def dummy_game(): + """3-player DummyGame -- fast, deterministic.""" + return DummyGame(n=3, interaction=(0, 1)) + +@pytest.fixture +def exact_values(dummy_game): + """Ground truth via ExactComputer.""" + return ExactComputer(dummy_game).compute(index="SII", order=2) + +@pytest.fixture +def tiny_data(): + """30 samples, 5 features.""" + rng = np.random.default_rng(42) + return rng.normal(size=(30, 5)) + +@pytest.fixture(scope="module") +def dt_reg_model(tiny_data): + """Tiny DecisionTreeRegressor. Fits in <10ms.""" + from sklearn.tree import DecisionTreeRegressor + model = DecisionTreeRegressor(max_depth=3, random_state=42) + model.fit(tiny_data, tiny_data[:, 0]) + return model +``` + +#### Approximator registry + +```python +ALL_APPROXIMATORS = [ + {"cls": SHAPIQ, "n": 7, "max_order": 2, "index": "SII", "budget": 100}, + {"cls": SHAPIQ, "n": 7, "max_order": 2, "index": "FSII", "budget": 100}, + {"cls": KernelSHAPIQ, "n": 7, "max_order": 2, "index": "k-SII", "budget": 100}, + {"cls": PermutationSV, "n": 7, "max_order": 1, "index": "SV", "budget": 50}, + # ... one entry per (approximator, index) combo worth testing +] +``` + +Adding a new approximator = append one dict. Protocol tests pick it up automatically. + +### Protocol Tests + +Protocols test **contracts**, not quality. Every component of a given type must pass its protocol. + +#### Approximator protocol + +```python +@pytest.mark.parametrize("config", ALL_APPROXIMATORS, + ids=lambda c: f"{c['cls'].__name__}-{c['index']}") +class TestApproximatorProtocol: + + def test_returns_interaction_values(self, config, dummy_game): + """Result is an InteractionValues with correct metadata.""" + approx = config["cls"](n=config["n"], max_order=config["max_order"], + index=config["index"]) + result = approx.approximate(config["budget"], dummy_game) + assert isinstance(result, InteractionValues) + assert result.index == config["index"] + assert result.max_order == config["max_order"] + + def test_respects_budget(self, config, dummy_game): + """Never exceeds declared budget (+ small epsilon for setup calls).""" + approx = config["cls"](n=config["n"], max_order=config["max_order"], + index=config["index"]) + approx.approximate(config["budget"], dummy_game) + assert dummy_game.access_counter <= config["budget"] + 2 + + def test_reproducible(self, config, dummy_game): + """Same random_state produces identical results.""" + a1 = config["cls"](n=config["n"], max_order=config["max_order"], + index=config["index"], random_state=42) + a2 = config["cls"](n=config["n"], max_order=config["max_order"], + index=config["index"], random_state=42) + r1 = a1.approximate(config["budget"], dummy_game) + r2 = a2.approximate(config["budget"], dummy_game) + assert np.allclose(r1.values, r2.values) + + def test_rejects_invalid_index(self, config): + """Raises ValueError for indices not in valid_indices.""" + with pytest.raises((ValueError, TypeError)): + config["cls"](n=config["n"], max_order=config["max_order"], + index="INVALID_INDEX") + + def test_efficiency(self, config, dummy_game): + """For efficient indices, sum(values) ~ game(N) - game(empty).""" + if config["index"] not in EFFICIENT_INDICES: + pytest.skip("Efficiency doesn't apply to this index") + approx = config["cls"](n=config["n"], max_order=config["max_order"], + index=config["index"], random_state=42) + result = approx.approximate(config["budget"], dummy_game) + expected_sum = dummy_game({0, 1, 2}) - dummy_game(set()) + assert sum(result.values) == pytest.approx(expected_sum, abs=0.3) +``` + +#### Explainer protocol + +Same pattern: returns `InteractionValues`, efficiency holds, reproducible, handles single instance +and batch (`explain` and `explain_X`). + +#### Imputer protocol + +`fit` + `impute` work, output shape is correct, handles coalitions properly. + +#### Tree protocol + +Conversion produces valid `TreeModel`, SV matches ExactComputer, efficiency holds, baseline matches +empty prediction. + +### Special Cases + +Special cases live as `TestClass` groups below the protocol in the same file. Only add one when a +component has genuinely unique behavior the protocol can't cover. + +```python +# In test_approximators.py, below protocol: + +class TestProxySHAP: + """ProxySHAP-specific: MSRBiased variant, coalition-to-tree-path conversion.""" + def test_msr_biased_coalitions_to_paths(self): ... + +class TestSPEX: + """SPEX requires larger budgets.""" + def test_warns_on_small_budget(self): ... +``` + +Most approximators won't have a `TestClass`. + +### Tree Special Cases + +`test_tree.py` is the densest domain: + +```python +# Protocol +class TestTreeProtocol: + def test_conversion_produces_valid_tree_model(self, tree_model): ... + def test_sv_matches_exact(self, tree_model, x_explain): ... + def test_efficiency(self, tree_model, x_explain): ... + def test_baseline_matches_empty_prediction(self, tree_model): ... + +# SHAP comparison -- slow, CI-only +@pytest.mark.slow +class TestSHAPComparison: + """Expected values as in-file constants, not loaded from disk.""" + def test_xgb_regression_matches_shap(self, xgb_reg_model, background_reg_data): ... + def test_rf_classification_matches_shap(self, rf_clf_model, background_clf_data): ... + +# Edge cases +class TestTreeEdgeCases: + def test_decision_stumps(self): ... + def test_high_dimensional_no_overflow(self): ... + def test_repeated_calls_no_segfault(self): ... +``` + +`test_tree.py` will likely be the largest file (~300-400 lines). That's acceptable given domain +complexity. + +### What Gets Deleted + +**Entire directories:** +- `tests/shapiq/tests_unit/` (all 68 test files) +- `tests/shapiq/tests_integration_tests/` (California Housing tests) +- `tests/shapiq/tests_deprecation/` +- `tests/shapiq/fixtures/` (replaced by `conftest.py`) +- `tests/shapiq/data/` (pre-computed JSON, model files, test images) + +**Files:** +- `tests/shapiq/markers.py` (skip markers move into `conftest.py`) +- `tests/shapiq/utils.py` (absorbed into protocols or removed) + +**What we preserve (migrated into new files):** +- Segfault regression tests (tree overflow, refcount corruption) -> `test_tree.py` +- SHAP comparison values (as in-file constants) -> `test_tree.py` slow suite +- `InteractionValues` tests (condensed from 896 lines to ~200-300) -> `test_interaction_values.py` +- ExactComputer tests -> `test_game_theory.py` +- Skip markers for optional deps -> `conftest.py` + +### Net Effect + +| Metric | Before | After | +|--------|--------|-------| +| Test files | 75 | 8 | +| Lines of test code | ~10,000 | ~1,500-2,000 | +| Test functions | 321 | ~80-120 | +| Default runtime | 3-5 min | ~1 min | +| CI runtime | 3-5 min | ~2-3 min | +| Files to touch for new approximator | 1 new file | 1 dict entry | + +### Migration Approach + +We write the new suite fresh based on protocols, then verify coverage is adequate before deleting +the old tests. The old tests exist on `main` as reference if we need to check what a specific test +was validating. This is not a port -- it's a rewrite. diff --git a/pyproject.toml b/pyproject.toml index c8956d8df..e9db5cc8c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -89,6 +89,10 @@ testpaths = [ ] pythonpath = ["src"] minversion = "8.0" +markers = [ + "slow: marks tests that require > 5s or optional deps (deselect with '-m not slow')", +] +addopts = "-m 'not slow'" [tool.ruff] line-length = 100 diff --git a/tests/conftest.py b/tests/conftest.py index 93d35d8da..98a635e87 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -7,10 +7,5 @@ "tests.shapiq.fixtures.models", "tests.shapiq.fixtures.data", "tests.shapiq.fixtures.interaction_values", + "tests.shapiq_games.fixtures.tabular", ] - -pytest_plugins.extend( - [ - "tests.shapiq_games.fixtures.tabular", - ] -) diff --git a/tests/shapiq/conftest.py b/tests/shapiq/conftest.py index 8f66c59bd..8d994fead 100644 --- a/tests/shapiq/conftest.py +++ b/tests/shapiq/conftest.py @@ -1,118 +1,150 @@ -"""This test module contains all fixtures for all tests of shapiq.""" +"""Shared fixtures for all shapiq tests.""" from __future__ import annotations import os -# Limit OpenMP threads before any native library (numpy, sklearn, torch) is loaded. -# Without this, PyTorch's OpenMP threads conflict with numpy/sklearn's OpenMP threads -# already resident in the pytest process, causing segfaults in TabPFN tests. +# Limit OpenMP threads to prevent segfaults when PyTorch/sklearn coexist. os.environ.setdefault("OMP_NUM_THREADS", "1") os.environ.setdefault("MKL_NUM_THREADS", "1") +import importlib.util + import matplotlib as mpl import numpy as np import pytest -mpl.use("Agg") # For headless environments. Removes Tkinter warning. +mpl.use("Agg") -from shapiq import InteractionValues +from shapiq.game_theory.exact import ExactComputer +from shapiq_games.synthetic import DummyGame + +# --------------------------------------------------------------------------- +# Skip markers for optional dependencies +# --------------------------------------------------------------------------- -from .fixtures.models import ( - TABULAR_MODEL_FIXTURES, - TABULAR_TENSORFLOW_MODEL_FIXTURES, - TABULAR_TORCH_MODEL_FIXTURES, - TREE_MODEL_FIXTURES, -) -ALL_MODEL_FIXTURES = ( - TABULAR_MODEL_FIXTURES - + TREE_MODEL_FIXTURES - + TABULAR_TENSORFLOW_MODEL_FIXTURES - + TABULAR_TORCH_MODEL_FIXTURES +def _is_installed(pkg: str) -> bool: + return importlib.util.find_spec(pkg) is not None + + +skip_if_no_xgboost = pytest.mark.skipif( + not _is_installed("xgboost"), reason="xgboost not installed" +) +skip_if_no_lightgbm = pytest.mark.skipif( + not _is_installed("lightgbm"), reason="lightgbm not installed" ) +skip_if_no_tabpfn = pytest.mark.skipif(not _is_installed("tabpfn"), reason="tabpfn not installed") + +# --------------------------------------------------------------------------- +# Games +# --------------------------------------------------------------------------- + + +@pytest.fixture +def dummy_game_3(): + """3-player DummyGame with interaction (0, 1). Fast and deterministic.""" + return DummyGame(n=3, interaction=(0, 1)) + + +@pytest.fixture +def dummy_game_7(): + """7-player DummyGame with interaction (1, 2). Used by approximator protocol.""" + return DummyGame(n=7, interaction=(1, 2)) + + +# --------------------------------------------------------------------------- +# Exact ground truth +# --------------------------------------------------------------------------- + + +@pytest.fixture +def exact_computer_3(dummy_game_3): + """ExactComputer for the 3-player dummy game (2^3 = 8 evaluations).""" + return ExactComputer(dummy_game_3) + + +# --------------------------------------------------------------------------- +# Tiny datasets (no sklearn dependency) +# --------------------------------------------------------------------------- + +_RNG = np.random.default_rng(42) +_TINY_X = _RNG.normal(size=(30, 5)) +_TINY_Y_REG = _TINY_X[:, 0] + 0.5 * _TINY_X[:, 1] + _RNG.normal(0, 0.1, size=30) +_TINY_Y_CLF = (np.median(_TINY_Y_REG) < _TINY_Y_REG).astype(int) @pytest.fixture -def interaction_values_list(): - """Returns a list of three InteractionValues objects.""" - rng = np.random.RandomState(42) - - from shapiq.interaction_values import InteractionValues - from shapiq.utils import powerset - - n_objects = 3 - n_players = 5 - min_order = 0 - max_order = n_players - iv_list = [] - for _ in range(n_objects): - values = [] - interaction_lookup = {} - for i, interaction in enumerate( - powerset(range(n_players), min_size=min_order, max_size=max_order), - ): - interaction_lookup[interaction] = i - values.append(rng.uniform(0, 1)) - values = np.array(values) - iv = InteractionValues( - n_players=n_players, - values=values, - baseline_value=float(values[interaction_lookup[()]]), - index="Moebius", - interaction_lookup=interaction_lookup, - max_order=max_order, - min_order=min_order, - ) - iv_list.append(iv) - return iv_list +def tiny_data(): + """30 samples, 5 features. Regression target.""" + return _TINY_X.copy(), _TINY_Y_REG.copy() + + +@pytest.fixture +def tiny_data_clf(): + """30 samples, 5 features. Binary classification target.""" + return _TINY_X.copy(), _TINY_Y_CLF.copy() + + +# --------------------------------------------------------------------------- +# Model factories (sklearn only — always available) +# --------------------------------------------------------------------------- + + +@pytest.fixture(scope="module") +def dt_reg_model(): + """DecisionTreeRegressor, max_depth=3, fit on tiny data.""" + from sklearn.tree import DecisionTreeRegressor + + model = DecisionTreeRegressor(max_depth=3, random_state=42) + rng = np.random.default_rng(42) + X = rng.normal(size=(30, 5)) + y = X[:, 0] + 0.5 * X[:, 1] + rng.normal(0, 0.1, size=30) + model.fit(X, y) + return model + + +@pytest.fixture(scope="module") +def dt_clf_model(): + """DecisionTreeClassifier, max_depth=3, fit on tiny data.""" + from sklearn.tree import DecisionTreeClassifier + + model = DecisionTreeClassifier(max_depth=3, random_state=42) + rng = np.random.default_rng(42) + X = rng.normal(size=(30, 5)) + y = (X[:, 0] > 0).astype(int) + model.fit(X, y) + return model + + +@pytest.fixture(scope="module") +def rf_reg_model(): + """RandomForestRegressor, 5 trees, max_depth=3, fit on tiny data.""" + from sklearn.ensemble import RandomForestRegressor + + model = RandomForestRegressor(n_estimators=5, max_depth=3, random_state=42) + rng = np.random.default_rng(42) + X = rng.normal(size=(30, 5)) + y = X[:, 0] + 0.5 * X[:, 1] + rng.normal(0, 0.1, size=30) + model.fit(X, y) + return model + + +@pytest.fixture(scope="module") +def rf_clf_model(): + """RandomForestClassifier, 5 trees, max_depth=3, fit on tiny data.""" + from sklearn.ensemble import RandomForestClassifier + + model = RandomForestClassifier(n_estimators=5, max_depth=3, random_state=42) + rng = np.random.default_rng(42) + X = rng.normal(size=(30, 5)) + y = (X[:, 0] > 0).astype(int) + model.fit(X, y) + return model @pytest.fixture(scope="module") -def example_values(): - return InteractionValues( - n_players=4, - values=np.array( - [ - 0.0, # () - -0.2, # (1) - 0.4, # (2) - 0.2, # (3) - -0.1, # (4) - 0.2, # (1, 2) - -0.2, # (1, 3) - 0.2, # (1, 4) - 0.2, # (2, 3) - -0.2, # (2, 4) - 0.2, # (3, 4) - 0.4, # (1, 2, 3) - 0.0, # (1, 2, 4) - 0.0, # (1, 3, 4) - 0.0, # (2, 3, 4) - -0.1, # (1, 2, 3, 4) - ], - dtype=float, - ), - index="k-SII", - interaction_lookup={ - (): 0, - (1,): 1, - (2,): 2, - (3,): 3, - (4,): 4, - (1, 2): 5, - (1, 3): 6, - (1, 4): 7, - (2, 3): 8, - (2, 4): 9, - (3, 4): 10, - (1, 2, 3): 11, - (1, 2, 4): 12, - (1, 3, 4): 13, - (2, 3, 4): 14, - (1, 2, 3, 4): 15, - }, - baseline_value=0, - min_order=0, - max_order=4, - ) +def background_data(): + """Shared background data array for explainer/imputer tests. 30 samples, 5 features.""" + rng = np.random.default_rng(42) + return rng.normal(size=(30, 5)) diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=BII_order=1.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=BII_order=1.json deleted file mode 100644 index 198d9677a..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=BII_order=1.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.216316+00:00Z", - "metadata": { - "n_players": 8, - "index": "BV", - "max_order": 1, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 3.0470836432429977 - }, - "data": { - "0": 0.04071109156865119, - "1": 0.36705052215177625, - "2": 0.056378510780022956, - "3": 0.06145127312300626, - "4": 0.035427166992084876, - "5": 1.0270618033678374, - "6": 0.22220821165056254, - "7": 0.6938395979204278 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=BII_order=2.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=BII_order=2.json deleted file mode 100644 index 0f01d98f1..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=BII_order=2.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.212091+00:00Z", - "metadata": { - "n_players": 8, - "index": "BII", - "max_order": 2, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 3.0470836432429977 - }, - "data": { - "0": 0.04071109156865119, - "1": 0.36705052215177625, - "2": 0.056378510780022956, - "3": 0.06145127312300626, - "4": 0.035427166992084876, - "5": 1.0270618033678374, - "6": 0.22220821165056254, - "7": 0.6938395979204278, - "0,1": 0.19353574027109782, - "0,2": 0.08148939599956508, - "0,3": -0.001160253189244967, - "0,4": 0.03645870117649059, - "0,5": 0.31055898559337547, - "0,6": 0.1736125326172036, - "0,7": 0.12200022313816701, - "1,2": -0.041037331137638536, - "1,3": 0.0005327999416730594, - "1,4": 0.00562520100152851, - "1,5": 0.10313714646624933, - "1,6": 0.20077403593769183, - "1,7": 0.22485602663955384, - "2,3": -0.010104014447133144, - "2,4": -0.004819215528300766, - "2,5": 0.11313932634299972, - "2,6": -0.004700412826208908, - "2,7": 0.07166912974966495, - "3,4": -3.343927161002236e-05, - "3,5": 0.07486352201885689, - "3,6": -0.013005320864577605, - "3,7": -0.033648878233124, - "4,5": 0.01330484447849302, - "4,6": 0.005388072951927683, - "4,7": 0.015899848500730243, - "5,6": 0.1911635947772406, - "5,7": -0.2570979927415212, - "6,7": 0.4771906946141711 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=BII_order=3.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=BII_order=3.json deleted file mode 100644 index 2dbbfb7b8..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=BII_order=3.json +++ /dev/null @@ -1,112 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.212603+00:00Z", - "metadata": { - "n_players": 8, - "index": "BII", - "max_order": 3, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 3.0470836432429977 - }, - "data": { - "0": 0.04071109156865119, - "1": 0.36705052215177625, - "2": 0.056378510780022956, - "3": 0.06145127312300626, - "4": 0.035427166992084876, - "5": 1.0270618033678374, - "6": 0.22220821165056254, - "7": 0.6938395979204278, - "0,1": 0.19353574027109782, - "0,2": 0.08148939599956508, - "0,3": -0.001160253189244967, - "0,4": 0.03645870117649059, - "0,5": 0.31055898559337547, - "0,6": 0.1736125326172036, - "0,7": 0.12200022313816701, - "1,2": -0.041037331137638536, - "1,3": 0.0005327999416730594, - "1,4": 0.00562520100152851, - "1,5": 0.10313714646624933, - "1,6": 0.20077403593769183, - "1,7": 0.22485602663955384, - "2,3": -0.010104014447133144, - "2,4": -0.004819215528300766, - "2,5": 0.11313932634299972, - "2,6": -0.004700412826208908, - "2,7": 0.07166912974966495, - "3,4": -3.343927161002236e-05, - "3,5": 0.07486352201885689, - "3,6": -0.013005320864577605, - "3,7": -0.033648878233124, - "4,5": 0.01330484447849302, - "4,6": 0.005388072951927683, - "4,7": 0.015899848500730243, - "5,6": 0.1911635947772406, - "5,7": -0.2570979927415212, - "6,7": 0.4771906946141711, - "0,1,2": -0.01718508610661265, - "0,1,3": 0.024708495800581126, - "0,1,4": 0.030966610425292793, - "0,1,5": 0.08486216862306285, - "0,1,6": 0.21197025617167167, - "0,1,7": 0.25200720153856804, - "0,2,3": 0.01916906076750971, - "0,2,4": 0.010670817971684426, - "0,2,5": 0.020044165775407435, - "0,2,6": 0.06273702546133515, - "0,2,7": -0.04137278846418105, - "0,3,4": 0.0080244801390488, - "0,3,5": 0.15771915514615045, - "0,3,6": -0.01382597328355431, - "0,3,7": -0.03822174593057229, - "0,4,5": 0.029207636522837102, - "0,4,6": 0.014377546718008088, - "0,4,7": 0.02384656952980105, - "0,5,6": 0.017169061024248117, - "0,5,7": -0.43922820951638664, - "0,6,7": 0.31188586707909216, - "1,2,3": 0.005977978174524806, - "1,2,4": 0.003817134749089096, - "1,2,5": 0.1101036717356084, - "1,2,6": -0.04505127556944813, - "1,2,7": 0.04875980759276896, - "1,3,4": 0.007492902911762717, - "1,3,5": 0.047513599530103395, - "1,3,6": -0.017054751857315614, - "1,3,7": -0.02749493775364273, - "1,4,5": 0.0025895071138517245, - "1,4,6": 0.012169813250551081, - "1,4,7": 0.013393794782764895, - "1,5,6": 0.07889597804875167, - "1,5,7": -0.1983749179312236, - "1,6,7": 0.3715943097212129, - "2,3,4": 0.001186876615567073, - "2,3,5": -0.010479572704099799, - "2,3,6": 0.00992207400807757, - "2,3,7": 0.01439695042722225, - "2,4,5": -0.018060108345961695, - "2,4,6": 0.007730985367420035, - "2,4,7": 0.006413045113016241, - "2,5,6": -0.011038855557204269, - "2,5,7": 0.09024878960266128, - "2,6,7": 0.03409261871769001, - "3,4,5": 0.01668156025359316, - "3,4,6": 0.009187536420491665, - "3,4,7": 0.002862113709878572, - "3,5,6": 0.05680182323414609, - "3,5,7": -0.00983023240318312, - "3,6,7": 0.0049444303504038445, - "4,5,6": -0.012501428796621167, - "4,5,7": -0.008362207884735823, - "4,6,7": 0.024084904167864157, - "5,6,7": -0.15097596912133857 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=BII_order=4.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=BII_order=4.json deleted file mode 100644 index 0b1b3463e..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=BII_order=4.json +++ /dev/null @@ -1,182 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.196764+00:00Z", - "metadata": { - "n_players": 8, - "index": "BII", - "max_order": 4, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 3.0470836432429977 - }, - "data": { - "0": 0.04071109156865119, - "1": 0.36705052215177625, - "2": 0.056378510780022956, - "3": 0.06145127312300626, - "4": 0.035427166992084876, - "5": 1.0270618033678374, - "6": 0.22220821165056254, - "7": 0.6938395979204278, - "0,1": 0.19353574027109782, - "0,2": 0.08148939599956508, - "0,3": -0.001160253189244967, - "0,4": 0.03645870117649059, - "0,5": 0.31055898559337547, - "0,6": 0.1736125326172036, - "0,7": 0.12200022313816701, - "1,2": -0.041037331137638536, - "1,3": 0.0005327999416730594, - "1,4": 0.00562520100152851, - "1,5": 0.10313714646624933, - "1,6": 0.20077403593769183, - "1,7": 0.22485602663955384, - "2,3": -0.010104014447133144, - "2,4": -0.004819215528300766, - "2,5": 0.11313932634299972, - "2,6": -0.004700412826208908, - "2,7": 0.07166912974966495, - "3,4": -3.343927161002236e-05, - "3,5": 0.07486352201885689, - "3,6": -0.013005320864577605, - "3,7": -0.033648878233124, - "4,5": 0.01330484447849302, - "4,6": 0.005388072951927683, - "4,7": 0.015899848500730243, - "5,6": 0.1911635947772406, - "5,7": -0.2570979927415212, - "6,7": 0.4771906946141711, - "0,1,2": -0.01718508610661265, - "0,1,3": 0.024708495800581126, - "0,1,4": 0.030966610425292793, - "0,1,5": 0.08486216862306285, - "0,1,6": 0.21197025617167167, - "0,1,7": 0.25200720153856804, - "0,2,3": 0.01916906076750971, - "0,2,4": 0.010670817971684426, - "0,2,5": 0.020044165775407435, - "0,2,6": 0.06273702546133515, - "0,2,7": -0.04137278846418105, - "0,3,4": 0.0080244801390488, - "0,3,5": 0.15771915514615045, - "0,3,6": -0.01382597328355431, - "0,3,7": -0.03822174593057229, - "0,4,5": 0.029207636522837102, - "0,4,6": 0.014377546718008088, - "0,4,7": 0.02384656952980105, - "0,5,6": 0.017169061024248117, - "0,5,7": -0.43922820951638664, - "0,6,7": 0.31188586707909216, - "1,2,3": 0.005977978174524806, - "1,2,4": 0.003817134749089096, - "1,2,5": 0.1101036717356084, - "1,2,6": -0.04505127556944813, - "1,2,7": 0.04875980759276896, - "1,3,4": 0.007492902911762717, - "1,3,5": 0.047513599530103395, - "1,3,6": -0.017054751857315614, - "1,3,7": -0.02749493775364273, - "1,4,5": 0.0025895071138517245, - "1,4,6": 0.012169813250551081, - "1,4,7": 0.013393794782764895, - "1,5,6": 0.07889597804875167, - "1,5,7": -0.1983749179312236, - "1,6,7": 0.3715943097212129, - "2,3,4": 0.001186876615567073, - "2,3,5": -0.010479572704099799, - "2,3,6": 0.00992207400807757, - "2,3,7": 0.01439695042722225, - "2,4,5": -0.018060108345961695, - "2,4,6": 0.007730985367420035, - "2,4,7": 0.006413045113016241, - "2,5,6": -0.011038855557204269, - "2,5,7": 0.09024878960266128, - "2,6,7": 0.03409261871769001, - "3,4,5": 0.01668156025359316, - "3,4,6": 0.009187536420491665, - "3,4,7": 0.002862113709878572, - "3,5,6": 0.05680182323414609, - "3,5,7": -0.00983023240318312, - "3,6,7": 0.0049444303504038445, - "4,5,6": -0.012501428796621167, - "4,5,7": -0.008362207884735823, - "4,6,7": 0.024084904167864157, - "5,6,7": -0.15097596912133857, - "0,1,2,3": 0.006201994436156488, - "0,1,2,4": 0.004907042385940252, - "0,1,2,5": 0.08269071198257702, - "0,1,2,6": -0.020727856510645404, - "0,1,2,7": 0.04348225767406361, - "0,1,3,4": -0.0006717749071712409, - "0,1,3,5": 0.11010033121241522, - "0,1,3,6": -0.04621767561716322, - "0,1,3,7": -0.07107945534076504, - "0,1,4,5": -0.033135054676562914, - "0,1,4,6": -0.0027308252700380398, - "0,1,4,7": 0.012693403625930022, - "0,1,5,6": -0.03787541374910258, - "0,1,5,7": -0.30329147300663833, - "0,1,6,7": 0.3426282540816506, - "0,2,3,4": -0.0013049770719887888, - "0,2,3,5": 0.016632057835098968, - "0,2,3,6": -0.006111828107722983, - "0,2,3,7": -0.0208920194620395, - "0,2,4,5": 0.012211214277890903, - "0,2,4,6": -0.006281083274523314, - "0,2,4,7": -0.0031059454137027376, - "0,2,5,6": -0.1612182682777637, - "0,2,5,7": -0.1009914192798072, - "0,2,6,7": -0.008101039618384764, - "0,3,4,5": 0.0021654113623659765, - "0,3,4,6": -0.0008174451144859485, - "0,3,4,7": -0.00972078209233368, - "0,3,5,6": 0.012447154759012757, - "0,3,5,7": 0.00049145637320408, - "0,3,6,7": -0.02226956261312002, - "0,4,5,6": -0.038819551903739036, - "0,4,5,7": -0.03142758571457377, - "0,4,6,7": 0.02324404593270951, - "0,5,6,7": -0.38004896904841917, - "1,2,3,4": -0.01094437168385659, - "1,2,3,5": -0.011803471708235758, - "1,2,3,6": -0.0060675799940843045, - "1,2,3,7": 0.007951578382477675, - "1,2,4,5": -0.0038708499352993475, - "1,2,4,6": -0.012197774808611783, - "1,2,4,7": -0.008671092445178885, - "1,2,5,6": 0.042473229993612305, - "1,2,5,7": 0.027670419531104107, - "1,2,6,7": 0.010919971826279073, - "1,3,4,5": 0.004432073237227108, - "1,3,4,6": -0.0059474388122072175, - "1,3,4,7": -0.008518339303203615, - "1,3,5,6": 0.04583642891699263, - "1,3,5,7": 0.03476476996399819, - "1,3,6,7": -0.031318557024061, - "1,4,5,6": -0.013296313514001679, - "1,4,5,7": -0.02268652760460782, - "1,4,6,7": 0.004515444240810351, - "1,5,6,7": -0.2263545459758815, - "2,3,4,5": -0.013883036959553452, - "2,3,4,6": -0.008883145696826078, - "2,3,4,7": -0.008236129487428856, - "2,3,5,6": -0.013647289976719656, - "2,3,5,7": -0.022032909395243994, - "2,3,6,7": 0.009518095146181571, - "2,4,5,6": -0.011794838254492512, - "2,4,5,7": -0.023270585876837113, - "2,4,6,7": -0.0026349008641516902, - "2,5,6,7": -0.006728444765193797, - "3,4,5,6": -0.00018308018334728393, - "3,4,5,7": -0.011454518593819463, - "3,4,6,7": -0.004174093612460739, - "3,5,6,7": 0.08714693275818336, - "4,5,6,7": -0.04478065625623756 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=BII_order=5.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=BII_order=5.json deleted file mode 100644 index c0b1050fa..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=BII_order=5.json +++ /dev/null @@ -1,238 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.198353+00:00Z", - "metadata": { - "n_players": 8, - "index": "BII", - "max_order": 5, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 3.0470836432429977 - }, - "data": { - "0": 0.04071109156865119, - "1": 0.36705052215177625, - "2": 0.056378510780022956, - "3": 0.06145127312300626, - "4": 0.035427166992084876, - "5": 1.0270618033678374, - "6": 0.22220821165056254, - "7": 0.6938395979204278, - "0,1": 0.19353574027109782, - "0,2": 0.08148939599956508, - "0,3": -0.001160253189244967, - "0,4": 0.03645870117649059, - "0,5": 0.31055898559337547, - "0,6": 0.1736125326172036, - "0,7": 0.12200022313816701, - "1,2": -0.041037331137638536, - "1,3": 0.0005327999416730594, - "1,4": 0.00562520100152851, - "1,5": 0.10313714646624933, - "1,6": 0.20077403593769183, - "1,7": 0.22485602663955384, - "2,3": -0.010104014447133144, - "2,4": -0.004819215528300766, - "2,5": 0.11313932634299972, - "2,6": -0.004700412826208908, - "2,7": 0.07166912974966495, - "3,4": -3.343927161002236e-05, - "3,5": 0.07486352201885689, - "3,6": -0.013005320864577605, - "3,7": -0.033648878233124, - "4,5": 0.01330484447849302, - "4,6": 0.005388072951927683, - "4,7": 0.015899848500730243, - "5,6": 0.1911635947772406, - "5,7": -0.2570979927415212, - "6,7": 0.4771906946141711, - "0,1,2": -0.01718508610661265, - "0,1,3": 0.024708495800581126, - "0,1,4": 0.030966610425292793, - "0,1,5": 0.08486216862306285, - "0,1,6": 0.21197025617167167, - "0,1,7": 0.25200720153856804, - "0,2,3": 0.01916906076750971, - "0,2,4": 0.010670817971684426, - "0,2,5": 0.020044165775407435, - "0,2,6": 0.06273702546133515, - "0,2,7": -0.04137278846418105, - "0,3,4": 0.0080244801390488, - "0,3,5": 0.15771915514615045, - "0,3,6": -0.01382597328355431, - "0,3,7": -0.03822174593057229, - "0,4,5": 0.029207636522837102, - "0,4,6": 0.014377546718008088, - "0,4,7": 0.02384656952980105, - "0,5,6": 0.017169061024248117, - "0,5,7": -0.43922820951638664, - "0,6,7": 0.31188586707909216, - "1,2,3": 0.005977978174524806, - "1,2,4": 0.003817134749089096, - "1,2,5": 0.1101036717356084, - "1,2,6": -0.04505127556944813, - "1,2,7": 0.04875980759276896, - "1,3,4": 0.007492902911762717, - "1,3,5": 0.047513599530103395, - "1,3,6": -0.017054751857315614, - "1,3,7": -0.02749493775364273, - "1,4,5": 0.0025895071138517245, - "1,4,6": 0.012169813250551081, - "1,4,7": 0.013393794782764895, - "1,5,6": 0.07889597804875167, - "1,5,7": -0.1983749179312236, - "1,6,7": 0.3715943097212129, - "2,3,4": 0.001186876615567073, - "2,3,5": -0.010479572704099799, - "2,3,6": 0.00992207400807757, - "2,3,7": 0.01439695042722225, - "2,4,5": -0.018060108345961695, - "2,4,6": 0.007730985367420035, - "2,4,7": 0.006413045113016241, - "2,5,6": -0.011038855557204269, - "2,5,7": 0.09024878960266128, - "2,6,7": 0.03409261871769001, - "3,4,5": 0.01668156025359316, - "3,4,6": 0.009187536420491665, - "3,4,7": 0.002862113709878572, - "3,5,6": 0.05680182323414609, - "3,5,7": -0.00983023240318312, - "3,6,7": 0.0049444303504038445, - "4,5,6": -0.012501428796621167, - "4,5,7": -0.008362207884735823, - "4,6,7": 0.024084904167864157, - "5,6,7": -0.15097596912133857, - "0,1,2,3": 0.006201994436156488, - "0,1,2,4": 0.004907042385940252, - "0,1,2,5": 0.08269071198257702, - "0,1,2,6": -0.020727856510645404, - "0,1,2,7": 0.04348225767406361, - "0,1,3,4": -0.0006717749071712409, - "0,1,3,5": 0.11010033121241522, - "0,1,3,6": -0.04621767561716322, - "0,1,3,7": -0.07107945534076504, - "0,1,4,5": -0.033135054676562914, - "0,1,4,6": -0.0027308252700380398, - "0,1,4,7": 0.012693403625930022, - "0,1,5,6": -0.03787541374910258, - "0,1,5,7": -0.30329147300663833, - "0,1,6,7": 0.3426282540816506, - "0,2,3,4": -0.0013049770719887888, - "0,2,3,5": 0.016632057835098968, - "0,2,3,6": -0.006111828107722983, - "0,2,3,7": -0.0208920194620395, - "0,2,4,5": 0.012211214277890903, - "0,2,4,6": -0.006281083274523314, - "0,2,4,7": -0.0031059454137027376, - "0,2,5,6": -0.1612182682777637, - "0,2,5,7": -0.1009914192798072, - "0,2,6,7": -0.008101039618384764, - "0,3,4,5": 0.0021654113623659765, - "0,3,4,6": -0.0008174451144859485, - "0,3,4,7": -0.00972078209233368, - "0,3,5,6": 0.012447154759012757, - "0,3,5,7": 0.00049145637320408, - "0,3,6,7": -0.02226956261312002, - "0,4,5,6": -0.038819551903739036, - "0,4,5,7": -0.03142758571457377, - "0,4,6,7": 0.02324404593270951, - "0,5,6,7": -0.38004896904841917, - "1,2,3,4": -0.01094437168385659, - "1,2,3,5": -0.011803471708235758, - "1,2,3,6": -0.0060675799940843045, - "1,2,3,7": 0.007951578382477675, - "1,2,4,5": -0.0038708499352993475, - "1,2,4,6": -0.012197774808611783, - "1,2,4,7": -0.008671092445178885, - "1,2,5,6": 0.042473229993612305, - "1,2,5,7": 0.027670419531104107, - "1,2,6,7": 0.010919971826279073, - "1,3,4,5": 0.004432073237227108, - "1,3,4,6": -0.0059474388122072175, - "1,3,4,7": -0.008518339303203615, - "1,3,5,6": 0.04583642891699263, - "1,3,5,7": 0.03476476996399819, - "1,3,6,7": -0.031318557024061, - "1,4,5,6": -0.013296313514001679, - "1,4,5,7": -0.02268652760460782, - "1,4,6,7": 0.004515444240810351, - "1,5,6,7": -0.2263545459758815, - "2,3,4,5": -0.013883036959553452, - "2,3,4,6": -0.008883145696826078, - "2,3,4,7": -0.008236129487428856, - "2,3,5,6": -0.013647289976719656, - "2,3,5,7": -0.022032909395243994, - "2,3,6,7": 0.009518095146181571, - "2,4,5,6": -0.011794838254492512, - "2,4,5,7": -0.023270585876837113, - "2,4,6,7": -0.0026349008641516902, - "2,5,6,7": -0.006728444765193797, - "3,4,5,6": -0.00018308018334728393, - "3,4,5,7": -0.011454518593819463, - "3,4,6,7": -0.004174093612460739, - "3,5,6,7": 0.08714693275818336, - "4,5,6,7": -0.04478065625623756, - "0,1,2,3,4": 0.01975119104941847, - "0,1,2,3,5": 0.001107711508850362, - "0,1,2,3,6": 0.029329454294723445, - "0,1,2,3,7": 0.004582321863030203, - "0,1,2,4,5": 0.025468033270092394, - "0,1,2,4,6": 0.01115229326801559, - "0,1,2,4,7": 0.022792423837126097, - "0,1,2,5,6": 0.05754438428353914, - "0,1,2,5,7": 0.016642363395058424, - "0,1,2,6,7": 0.06722254067286493, - "0,1,3,4,5": 0.022338996048205106, - "0,1,3,4,6": 0.019344832748412144, - "0,1,3,4,7": 0.014689774488721219, - "0,1,3,5,6": 0.08365909112497827, - "0,1,3,5,7": 0.018229230867152002, - "0,1,3,6,7": -0.029109199155370358, - "0,1,4,5,6": -0.0062789668811237265, - "0,1,4,5,7": 0.003373376586498611, - "0,1,4,6,7": 0.03259540560238594, - "0,1,5,6,7": -0.4038091155178606, - "0,2,3,4,5": 0.02733543576121289, - "0,2,3,4,6": 0.017766291393650158, - "0,2,3,4,7": 0.016513420942273815, - "0,2,3,5,6": 0.01093307362939877, - "0,2,3,5,7": 0.01726738937318928, - "0,2,3,6,7": 0.005290353785402879, - "0,2,4,5,6": 0.022686026588349617, - "0,2,4,5,7": 0.01691459015821939, - "0,2,4,6,7": 0.021705994704493414, - "0,2,5,6,7": 0.0027125994591362668, - "0,3,4,5,6": 0.031057324574592537, - "0,3,4,5,7": 0.013724185592633442, - "0,3,4,6,7": 0.02091846096019878, - "0,3,5,6,7": 0.08268262836318285, - "0,4,5,6,7": -0.030146496702316727, - "1,2,3,4,5": 0.013962559620843806, - "1,2,3,4,6": 0.017063019541897817, - "1,2,3,4,7": 0.016587602724856265, - "1,2,3,5,6": -0.0026239611835888743, - "1,2,3,5,7": 0.01824932784299993, - "1,2,3,6,7": 0.026963714754071444, - "1,2,4,5,6": 0.012496843501255461, - "1,2,4,5,7": 0.017795607184029616, - "1,2,4,6,7": 0.010683508047956702, - "1,2,5,6,7": 0.04534331906607292, - "1,3,4,5,6": 0.020278609793309754, - "1,3,4,5,7": 0.01741681342074719, - "1,3,4,6,7": 0.016130235366816792, - "1,3,5,6,7": 0.12406865648734089, - "1,4,5,6,7": 0.003780681557911225, - "2,3,4,5,6": 0.016504948708468192, - "2,3,4,5,7": 0.016938846537511876, - "2,3,4,6,7": 0.016492839958564542, - "2,3,5,6,7": 0.011623537477062684, - "2,4,5,6,7": 0.010879176369913535, - "3,4,5,6,7": 0.02415708721864196 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=BII_order=6.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=BII_order=6.json deleted file mode 100644 index 1426b7e7c..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=BII_order=6.json +++ /dev/null @@ -1,266 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.205988+00:00Z", - "metadata": { - "n_players": 8, - "index": "BII", - "max_order": 6, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 3.0470836432429977 - }, - "data": { - "0": 0.04071109156865119, - "1": 0.36705052215177625, - "2": 0.056378510780022956, - "3": 0.06145127312300626, - "4": 0.035427166992084876, - "5": 1.0270618033678374, - "6": 0.22220821165056254, - "7": 0.6938395979204278, - "0,1": 0.19353574027109782, - "0,2": 0.08148939599956508, - "0,3": -0.001160253189244967, - "0,4": 0.03645870117649059, - "0,5": 0.31055898559337547, - "0,6": 0.1736125326172036, - "0,7": 0.12200022313816701, - "1,2": -0.041037331137638536, - "1,3": 0.0005327999416730594, - "1,4": 0.00562520100152851, - "1,5": 0.10313714646624933, - "1,6": 0.20077403593769183, - "1,7": 0.22485602663955384, - "2,3": -0.010104014447133144, - "2,4": -0.004819215528300766, - "2,5": 0.11313932634299972, - "2,6": -0.004700412826208908, - "2,7": 0.07166912974966495, - "3,4": -3.343927161002236e-05, - "3,5": 0.07486352201885689, - "3,6": -0.013005320864577605, - "3,7": -0.033648878233124, - "4,5": 0.01330484447849302, - "4,6": 0.005388072951927683, - "4,7": 0.015899848500730243, - "5,6": 0.1911635947772406, - "5,7": -0.2570979927415212, - "6,7": 0.4771906946141711, - "0,1,2": -0.01718508610661265, - "0,1,3": 0.024708495800581126, - "0,1,4": 0.030966610425292793, - "0,1,5": 0.08486216862306285, - "0,1,6": 0.21197025617167167, - "0,1,7": 0.25200720153856804, - "0,2,3": 0.01916906076750971, - "0,2,4": 0.010670817971684426, - "0,2,5": 0.020044165775407435, - "0,2,6": 0.06273702546133515, - "0,2,7": -0.04137278846418105, - "0,3,4": 0.0080244801390488, - "0,3,5": 0.15771915514615045, - "0,3,6": -0.01382597328355431, - "0,3,7": -0.03822174593057229, - "0,4,5": 0.029207636522837102, - "0,4,6": 0.014377546718008088, - "0,4,7": 0.02384656952980105, - "0,5,6": 0.017169061024248117, - "0,5,7": -0.43922820951638664, - "0,6,7": 0.31188586707909216, - "1,2,3": 0.005977978174524806, - "1,2,4": 0.003817134749089096, - "1,2,5": 0.1101036717356084, - "1,2,6": -0.04505127556944813, - "1,2,7": 0.04875980759276896, - "1,3,4": 0.007492902911762717, - "1,3,5": 0.047513599530103395, - "1,3,6": -0.017054751857315614, - "1,3,7": -0.02749493775364273, - "1,4,5": 0.0025895071138517245, - "1,4,6": 0.012169813250551081, - "1,4,7": 0.013393794782764895, - "1,5,6": 0.07889597804875167, - "1,5,7": -0.1983749179312236, - "1,6,7": 0.3715943097212129, - "2,3,4": 0.001186876615567073, - "2,3,5": -0.010479572704099799, - "2,3,6": 0.00992207400807757, - "2,3,7": 0.01439695042722225, - "2,4,5": -0.018060108345961695, - "2,4,6": 0.007730985367420035, - "2,4,7": 0.006413045113016241, - "2,5,6": -0.011038855557204269, - "2,5,7": 0.09024878960266128, - "2,6,7": 0.03409261871769001, - "3,4,5": 0.01668156025359316, - "3,4,6": 0.009187536420491665, - "3,4,7": 0.002862113709878572, - "3,5,6": 0.05680182323414609, - "3,5,7": -0.00983023240318312, - "3,6,7": 0.0049444303504038445, - "4,5,6": -0.012501428796621167, - "4,5,7": -0.008362207884735823, - "4,6,7": 0.024084904167864157, - "5,6,7": -0.15097596912133857, - "0,1,2,3": 0.006201994436156488, - "0,1,2,4": 0.004907042385940252, - "0,1,2,5": 0.08269071198257702, - "0,1,2,6": -0.020727856510645404, - "0,1,2,7": 0.04348225767406361, - "0,1,3,4": -0.0006717749071712409, - "0,1,3,5": 0.11010033121241522, - "0,1,3,6": -0.04621767561716322, - "0,1,3,7": -0.07107945534076504, - "0,1,4,5": -0.033135054676562914, - "0,1,4,6": -0.0027308252700380398, - "0,1,4,7": 0.012693403625930022, - "0,1,5,6": -0.03787541374910258, - "0,1,5,7": -0.30329147300663833, - "0,1,6,7": 0.3426282540816506, - "0,2,3,4": -0.0013049770719887888, - "0,2,3,5": 0.016632057835098968, - "0,2,3,6": -0.006111828107722983, - "0,2,3,7": -0.0208920194620395, - "0,2,4,5": 0.012211214277890903, - "0,2,4,6": -0.006281083274523314, - "0,2,4,7": -0.0031059454137027376, - "0,2,5,6": -0.1612182682777637, - "0,2,5,7": -0.1009914192798072, - "0,2,6,7": -0.008101039618384764, - "0,3,4,5": 0.0021654113623659765, - "0,3,4,6": -0.0008174451144859485, - "0,3,4,7": -0.00972078209233368, - "0,3,5,6": 0.012447154759012757, - "0,3,5,7": 0.00049145637320408, - "0,3,6,7": -0.02226956261312002, - "0,4,5,6": -0.038819551903739036, - "0,4,5,7": -0.03142758571457377, - "0,4,6,7": 0.02324404593270951, - "0,5,6,7": -0.38004896904841917, - "1,2,3,4": -0.01094437168385659, - "1,2,3,5": -0.011803471708235758, - "1,2,3,6": -0.0060675799940843045, - "1,2,3,7": 0.007951578382477675, - "1,2,4,5": -0.0038708499352993475, - "1,2,4,6": -0.012197774808611783, - "1,2,4,7": -0.008671092445178885, - "1,2,5,6": 0.042473229993612305, - "1,2,5,7": 0.027670419531104107, - "1,2,6,7": 0.010919971826279073, - "1,3,4,5": 0.004432073237227108, - "1,3,4,6": -0.0059474388122072175, - "1,3,4,7": -0.008518339303203615, - "1,3,5,6": 0.04583642891699263, - "1,3,5,7": 0.03476476996399819, - "1,3,6,7": -0.031318557024061, - "1,4,5,6": -0.013296313514001679, - "1,4,5,7": -0.02268652760460782, - "1,4,6,7": 0.004515444240810351, - "1,5,6,7": -0.2263545459758815, - "2,3,4,5": -0.013883036959553452, - "2,3,4,6": -0.008883145696826078, - "2,3,4,7": -0.008236129487428856, - "2,3,5,6": -0.013647289976719656, - "2,3,5,7": -0.022032909395243994, - "2,3,6,7": 0.009518095146181571, - "2,4,5,6": -0.011794838254492512, - "2,4,5,7": -0.023270585876837113, - "2,4,6,7": -0.0026349008641516902, - "2,5,6,7": -0.006728444765193797, - "3,4,5,6": -0.00018308018334728393, - "3,4,5,7": -0.011454518593819463, - "3,4,6,7": -0.004174093612460739, - "3,5,6,7": 0.08714693275818336, - "4,5,6,7": -0.04478065625623756, - "0,1,2,3,4": 0.01975119104941847, - "0,1,2,3,5": 0.001107711508850362, - "0,1,2,3,6": 0.029329454294723445, - "0,1,2,3,7": 0.004582321863030203, - "0,1,2,4,5": 0.025468033270092394, - "0,1,2,4,6": 0.01115229326801559, - "0,1,2,4,7": 0.022792423837126097, - "0,1,2,5,6": 0.05754438428353914, - "0,1,2,5,7": 0.016642363395058424, - "0,1,2,6,7": 0.06722254067286493, - "0,1,3,4,5": 0.022338996048205106, - "0,1,3,4,6": 0.019344832748412144, - "0,1,3,4,7": 0.014689774488721219, - "0,1,3,5,6": 0.08365909112497827, - "0,1,3,5,7": 0.018229230867152002, - "0,1,3,6,7": -0.029109199155370358, - "0,1,4,5,6": -0.0062789668811237265, - "0,1,4,5,7": 0.003373376586498611, - "0,1,4,6,7": 0.03259540560238594, - "0,1,5,6,7": -0.4038091155178606, - "0,2,3,4,5": 0.02733543576121289, - "0,2,3,4,6": 0.017766291393650158, - "0,2,3,4,7": 0.016513420942273815, - "0,2,3,5,6": 0.01093307362939877, - "0,2,3,5,7": 0.01726738937318928, - "0,2,3,6,7": 0.005290353785402879, - "0,2,4,5,6": 0.022686026588349617, - "0,2,4,5,7": 0.01691459015821939, - "0,2,4,6,7": 0.021705994704493414, - "0,2,5,6,7": 0.0027125994591362668, - "0,3,4,5,6": 0.031057324574592537, - "0,3,4,5,7": 0.013724185592633442, - "0,3,4,6,7": 0.02091846096019878, - "0,3,5,6,7": 0.08268262836318285, - "0,4,5,6,7": -0.030146496702316727, - "1,2,3,4,5": 0.013962559620843806, - "1,2,3,4,6": 0.017063019541897817, - "1,2,3,4,7": 0.016587602724856265, - "1,2,3,5,6": -0.0026239611835888743, - "1,2,3,5,7": 0.01824932784299993, - "1,2,3,6,7": 0.026963714754071444, - "1,2,4,5,6": 0.012496843501255461, - "1,2,4,5,7": 0.017795607184029616, - "1,2,4,6,7": 0.010683508047956702, - "1,2,5,6,7": 0.04534331906607292, - "1,3,4,5,6": 0.020278609793309754, - "1,3,4,5,7": 0.01741681342074719, - "1,3,4,6,7": 0.016130235366816792, - "1,3,5,6,7": 0.12406865648734089, - "1,4,5,6,7": 0.003780681557911225, - "2,3,4,5,6": 0.016504948708468192, - "2,3,4,5,7": 0.016938846537511876, - "2,3,4,6,7": 0.016492839958564542, - "2,3,5,6,7": 0.011623537477062684, - "2,4,5,6,7": 0.010879176369913535, - "3,4,5,6,7": 0.02415708721864196, - "0,1,2,3,4,5": -0.027063842925908466, - "0,1,2,3,4,6": -0.03412603908379874, - "0,1,2,3,4,7": -0.033257529384550066, - "0,1,2,3,5,6": -0.05336017725072195, - "0,1,2,3,5,7": -0.05749352369613647, - "0,1,2,3,6,7": -0.03364377257717899, - "0,1,2,4,5,6": -0.03166442430409444, - "0,1,2,4,5,7": -0.024360108320003127, - "0,1,2,4,6,7": -0.03870536490543919, - "0,1,2,5,6,7": -0.046699899387512955, - "0,1,3,4,5,6": -0.032360910632223794, - "0,1,3,4,5,7": -0.036759950577155864, - "0,1,3,4,6,7": -0.034457342528500634, - "0,1,3,5,6,7": 0.081406548177547, - "0,1,4,5,6,7": -0.06178519904491586, - "0,2,3,4,5,6": -0.033009897416934164, - "0,2,3,4,5,7": -0.03301641675923661, - "0,2,3,4,6,7": -0.03298567991713042, - "0,2,3,5,6,7": -0.05085443009529933, - "0,2,4,5,6,7": -0.0330117498033109, - "0,3,4,5,6,7": -0.024129917565028025, - "1,2,3,4,5,6": -0.032306695750465186, - "1,2,3,4,5,7": -0.033647005575022204, - "1,2,3,4,6,7": -0.033216367417129744, - "1,2,3,5,6,7": -0.05701260842923239, - "1,2,4,5,6,7": -0.03881819815690979, - "1,3,4,5,6,7": -0.03294207815350858, - "2,3,4,5,6,7": -0.03344705491713529 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=BII_order=7.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=BII_order=7.json deleted file mode 100644 index 424c1e4f6..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=BII_order=7.json +++ /dev/null @@ -1,274 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.204167+00:00Z", - "metadata": { - "n_players": 8, - "index": "BII", - "max_order": 7, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 3.0470836432429977 - }, - "data": { - "0": 0.04071109156865119, - "1": 0.36705052215177625, - "2": 0.056378510780022956, - "3": 0.06145127312300626, - "4": 0.035427166992084876, - "5": 1.0270618033678374, - "6": 0.22220821165056254, - "7": 0.6938395979204278, - "0,1": 0.19353574027109782, - "0,2": 0.08148939599956508, - "0,3": -0.001160253189244967, - "0,4": 0.03645870117649059, - "0,5": 0.31055898559337547, - "0,6": 0.1736125326172036, - "0,7": 0.12200022313816701, - "1,2": -0.041037331137638536, - "1,3": 0.0005327999416730594, - "1,4": 0.00562520100152851, - "1,5": 0.10313714646624933, - "1,6": 0.20077403593769183, - "1,7": 0.22485602663955384, - "2,3": -0.010104014447133144, - "2,4": -0.004819215528300766, - "2,5": 0.11313932634299972, - "2,6": -0.004700412826208908, - "2,7": 0.07166912974966495, - "3,4": -3.343927161002236e-05, - "3,5": 0.07486352201885689, - "3,6": -0.013005320864577605, - "3,7": -0.033648878233124, - "4,5": 0.01330484447849302, - "4,6": 0.005388072951927683, - "4,7": 0.015899848500730243, - "5,6": 0.1911635947772406, - "5,7": -0.2570979927415212, - "6,7": 0.4771906946141711, - "0,1,2": -0.01718508610661265, - "0,1,3": 0.024708495800581126, - "0,1,4": 0.030966610425292793, - "0,1,5": 0.08486216862306285, - "0,1,6": 0.21197025617167167, - "0,1,7": 0.25200720153856804, - "0,2,3": 0.01916906076750971, - "0,2,4": 0.010670817971684426, - "0,2,5": 0.020044165775407435, - "0,2,6": 0.06273702546133515, - "0,2,7": -0.04137278846418105, - "0,3,4": 0.0080244801390488, - "0,3,5": 0.15771915514615045, - "0,3,6": -0.01382597328355431, - "0,3,7": -0.03822174593057229, - "0,4,5": 0.029207636522837102, - "0,4,6": 0.014377546718008088, - "0,4,7": 0.02384656952980105, - "0,5,6": 0.017169061024248117, - "0,5,7": -0.43922820951638664, - "0,6,7": 0.31188586707909216, - "1,2,3": 0.005977978174524806, - "1,2,4": 0.003817134749089096, - "1,2,5": 0.1101036717356084, - "1,2,6": -0.04505127556944813, - "1,2,7": 0.04875980759276896, - "1,3,4": 0.007492902911762717, - "1,3,5": 0.047513599530103395, - "1,3,6": -0.017054751857315614, - "1,3,7": -0.02749493775364273, - "1,4,5": 0.0025895071138517245, - "1,4,6": 0.012169813250551081, - "1,4,7": 0.013393794782764895, - "1,5,6": 0.07889597804875167, - "1,5,7": -0.1983749179312236, - "1,6,7": 0.3715943097212129, - "2,3,4": 0.001186876615567073, - "2,3,5": -0.010479572704099799, - "2,3,6": 0.00992207400807757, - "2,3,7": 0.01439695042722225, - "2,4,5": -0.018060108345961695, - "2,4,6": 0.007730985367420035, - "2,4,7": 0.006413045113016241, - "2,5,6": -0.011038855557204269, - "2,5,7": 0.09024878960266128, - "2,6,7": 0.03409261871769001, - "3,4,5": 0.01668156025359316, - "3,4,6": 0.009187536420491665, - "3,4,7": 0.002862113709878572, - "3,5,6": 0.05680182323414609, - "3,5,7": -0.00983023240318312, - "3,6,7": 0.0049444303504038445, - "4,5,6": -0.012501428796621167, - "4,5,7": -0.008362207884735823, - "4,6,7": 0.024084904167864157, - "5,6,7": -0.15097596912133857, - "0,1,2,3": 0.006201994436156488, - "0,1,2,4": 0.004907042385940252, - "0,1,2,5": 0.08269071198257702, - "0,1,2,6": -0.020727856510645404, - "0,1,2,7": 0.04348225767406361, - "0,1,3,4": -0.0006717749071712409, - "0,1,3,5": 0.11010033121241522, - "0,1,3,6": -0.04621767561716322, - "0,1,3,7": -0.07107945534076504, - "0,1,4,5": -0.033135054676562914, - "0,1,4,6": -0.0027308252700380398, - "0,1,4,7": 0.012693403625930022, - "0,1,5,6": -0.03787541374910258, - "0,1,5,7": -0.30329147300663833, - "0,1,6,7": 0.3426282540816506, - "0,2,3,4": -0.0013049770719887888, - "0,2,3,5": 0.016632057835098968, - "0,2,3,6": -0.006111828107722983, - "0,2,3,7": -0.0208920194620395, - "0,2,4,5": 0.012211214277890903, - "0,2,4,6": -0.006281083274523314, - "0,2,4,7": -0.0031059454137027376, - "0,2,5,6": -0.1612182682777637, - "0,2,5,7": -0.1009914192798072, - "0,2,6,7": -0.008101039618384764, - "0,3,4,5": 0.0021654113623659765, - "0,3,4,6": -0.0008174451144859485, - "0,3,4,7": -0.00972078209233368, - "0,3,5,6": 0.012447154759012757, - "0,3,5,7": 0.00049145637320408, - "0,3,6,7": -0.02226956261312002, - "0,4,5,6": -0.038819551903739036, - "0,4,5,7": -0.03142758571457377, - "0,4,6,7": 0.02324404593270951, - "0,5,6,7": -0.38004896904841917, - "1,2,3,4": -0.01094437168385659, - "1,2,3,5": -0.011803471708235758, - "1,2,3,6": -0.0060675799940843045, - "1,2,3,7": 0.007951578382477675, - "1,2,4,5": -0.0038708499352993475, - "1,2,4,6": -0.012197774808611783, - "1,2,4,7": -0.008671092445178885, - "1,2,5,6": 0.042473229993612305, - "1,2,5,7": 0.027670419531104107, - "1,2,6,7": 0.010919971826279073, - "1,3,4,5": 0.004432073237227108, - "1,3,4,6": -0.0059474388122072175, - "1,3,4,7": -0.008518339303203615, - "1,3,5,6": 0.04583642891699263, - "1,3,5,7": 0.03476476996399819, - "1,3,6,7": -0.031318557024061, - "1,4,5,6": -0.013296313514001679, - "1,4,5,7": -0.02268652760460782, - "1,4,6,7": 0.004515444240810351, - "1,5,6,7": -0.2263545459758815, - "2,3,4,5": -0.013883036959553452, - "2,3,4,6": -0.008883145696826078, - "2,3,4,7": -0.008236129487428856, - "2,3,5,6": -0.013647289976719656, - "2,3,5,7": -0.022032909395243994, - "2,3,6,7": 0.009518095146181571, - "2,4,5,6": -0.011794838254492512, - "2,4,5,7": -0.023270585876837113, - "2,4,6,7": -0.0026349008641516902, - "2,5,6,7": -0.006728444765193797, - "3,4,5,6": -0.00018308018334728393, - "3,4,5,7": -0.011454518593819463, - "3,4,6,7": -0.004174093612460739, - "3,5,6,7": 0.08714693275818336, - "4,5,6,7": -0.04478065625623756, - "0,1,2,3,4": 0.01975119104941847, - "0,1,2,3,5": 0.001107711508850362, - "0,1,2,3,6": 0.029329454294723445, - "0,1,2,3,7": 0.004582321863030203, - "0,1,2,4,5": 0.025468033270092394, - "0,1,2,4,6": 0.01115229326801559, - "0,1,2,4,7": 0.022792423837126097, - "0,1,2,5,6": 0.05754438428353914, - "0,1,2,5,7": 0.016642363395058424, - "0,1,2,6,7": 0.06722254067286493, - "0,1,3,4,5": 0.022338996048205106, - "0,1,3,4,6": 0.019344832748412144, - "0,1,3,4,7": 0.014689774488721219, - "0,1,3,5,6": 0.08365909112497827, - "0,1,3,5,7": 0.018229230867152002, - "0,1,3,6,7": -0.029109199155370358, - "0,1,4,5,6": -0.0062789668811237265, - "0,1,4,5,7": 0.003373376586498611, - "0,1,4,6,7": 0.03259540560238594, - "0,1,5,6,7": -0.4038091155178606, - "0,2,3,4,5": 0.02733543576121289, - "0,2,3,4,6": 0.017766291393650158, - "0,2,3,4,7": 0.016513420942273815, - "0,2,3,5,6": 0.01093307362939877, - "0,2,3,5,7": 0.01726738937318928, - "0,2,3,6,7": 0.005290353785402879, - "0,2,4,5,6": 0.022686026588349617, - "0,2,4,5,7": 0.01691459015821939, - "0,2,4,6,7": 0.021705994704493414, - "0,2,5,6,7": 0.0027125994591362668, - "0,3,4,5,6": 0.031057324574592537, - "0,3,4,5,7": 0.013724185592633442, - "0,3,4,6,7": 0.02091846096019878, - "0,3,5,6,7": 0.08268262836318285, - "0,4,5,6,7": -0.030146496702316727, - "1,2,3,4,5": 0.013962559620843806, - "1,2,3,4,6": 0.017063019541897817, - "1,2,3,4,7": 0.016587602724856265, - "1,2,3,5,6": -0.0026239611835888743, - "1,2,3,5,7": 0.01824932784299993, - "1,2,3,6,7": 0.026963714754071444, - "1,2,4,5,6": 0.012496843501255461, - "1,2,4,5,7": 0.017795607184029616, - "1,2,4,6,7": 0.010683508047956702, - "1,2,5,6,7": 0.04534331906607292, - "1,3,4,5,6": 0.020278609793309754, - "1,3,4,5,7": 0.01741681342074719, - "1,3,4,6,7": 0.016130235366816792, - "1,3,5,6,7": 0.12406865648734089, - "1,4,5,6,7": 0.003780681557911225, - "2,3,4,5,6": 0.016504948708468192, - "2,3,4,5,7": 0.016938846537511876, - "2,3,4,6,7": 0.016492839958564542, - "2,3,5,6,7": 0.011623537477062684, - "2,4,5,6,7": 0.010879176369913535, - "3,4,5,6,7": 0.02415708721864196, - "0,1,2,3,4,5": -0.027063842925908466, - "0,1,2,3,4,6": -0.03412603908379874, - "0,1,2,3,4,7": -0.033257529384550066, - "0,1,2,3,5,6": -0.05336017725072195, - "0,1,2,3,5,7": -0.05749352369613647, - "0,1,2,3,6,7": -0.03364377257717899, - "0,1,2,4,5,6": -0.03166442430409444, - "0,1,2,4,5,7": -0.024360108320003127, - "0,1,2,4,6,7": -0.03870536490543919, - "0,1,2,5,6,7": -0.046699899387512955, - "0,1,3,4,5,6": -0.032360910632223794, - "0,1,3,4,5,7": -0.036759950577155864, - "0,1,3,4,6,7": -0.034457342528500634, - "0,1,3,5,6,7": 0.081406548177547, - "0,1,4,5,6,7": -0.06178519904491586, - "0,2,3,4,5,6": -0.033009897416934164, - "0,2,3,4,5,7": -0.03301641675923661, - "0,2,3,4,6,7": -0.03298567991713042, - "0,2,3,5,6,7": -0.05085443009529933, - "0,2,4,5,6,7": -0.0330117498033109, - "0,3,4,5,6,7": -0.024129917565028025, - "1,2,3,4,5,6": -0.032306695750465186, - "1,2,3,4,5,7": -0.033647005575022204, - "1,2,3,4,6,7": -0.033216367417129744, - "1,2,3,5,6,7": -0.05701260842923239, - "1,2,4,5,6,7": -0.03881819815690979, - "1,3,4,5,6,7": -0.03294207815350858, - "2,3,4,5,6,7": -0.03344705491713529, - "0,1,2,3,4,5,6": 0.06461339150092416, - "0,1,2,3,4,5,7": 0.0655714585184648, - "0,1,2,3,4,6,7": 0.06643273483426215, - "0,1,2,3,5,6,7": 0.03539292500611646, - "0,1,2,4,5,6,7": 0.06555711615509408, - "0,1,3,4,5,6,7": 0.06263499391382821, - "0,2,3,4,5,6,7": 0.06689410983424837, - "1,2,3,4,5,6,7": 0.06643273483423906 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=BII_order=8.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=BII_order=8.json deleted file mode 100644 index 2e6f94eb7..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=BII_order=8.json +++ /dev/null @@ -1,275 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.236491+00:00Z", - "metadata": { - "n_players": 8, - "index": "BII", - "max_order": 8, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 3.0470836432429977 - }, - "data": { - "0": 0.04071109156865119, - "1": 0.36705052215177625, - "2": 0.056378510780022956, - "3": 0.06145127312300626, - "4": 0.035427166992084876, - "5": 1.0270618033678374, - "6": 0.22220821165056254, - "7": 0.6938395979204278, - "0,1": 0.19353574027109782, - "0,2": 0.08148939599956508, - "0,3": -0.001160253189244967, - "0,4": 0.03645870117649059, - "0,5": 0.31055898559337547, - "0,6": 0.1736125326172036, - "0,7": 0.12200022313816701, - "1,2": -0.041037331137638536, - "1,3": 0.0005327999416730594, - "1,4": 0.00562520100152851, - "1,5": 0.10313714646624933, - "1,6": 0.20077403593769183, - "1,7": 0.22485602663955384, - "2,3": -0.010104014447133144, - "2,4": -0.004819215528300766, - "2,5": 0.11313932634299972, - "2,6": -0.004700412826208908, - "2,7": 0.07166912974966495, - "3,4": -3.343927161002236e-05, - "3,5": 0.07486352201885689, - "3,6": -0.013005320864577605, - "3,7": -0.033648878233124, - "4,5": 0.01330484447849302, - "4,6": 0.005388072951927683, - "4,7": 0.015899848500730243, - "5,6": 0.1911635947772406, - "5,7": -0.2570979927415212, - "6,7": 0.4771906946141711, - "0,1,2": -0.01718508610661265, - "0,1,3": 0.024708495800581126, - "0,1,4": 0.030966610425292793, - "0,1,5": 0.08486216862306285, - "0,1,6": 0.21197025617167167, - "0,1,7": 0.25200720153856804, - "0,2,3": 0.01916906076750971, - "0,2,4": 0.010670817971684426, - "0,2,5": 0.020044165775407435, - "0,2,6": 0.06273702546133515, - "0,2,7": -0.04137278846418105, - "0,3,4": 0.0080244801390488, - "0,3,5": 0.15771915514615045, - "0,3,6": -0.01382597328355431, - "0,3,7": -0.03822174593057229, - "0,4,5": 0.029207636522837102, - "0,4,6": 0.014377546718008088, - "0,4,7": 0.02384656952980105, - "0,5,6": 0.017169061024248117, - "0,5,7": -0.43922820951638664, - "0,6,7": 0.31188586707909216, - "1,2,3": 0.005977978174524806, - "1,2,4": 0.003817134749089096, - "1,2,5": 0.1101036717356084, - "1,2,6": -0.04505127556944813, - "1,2,7": 0.04875980759276896, - "1,3,4": 0.007492902911762717, - "1,3,5": 0.047513599530103395, - "1,3,6": -0.017054751857315614, - "1,3,7": -0.02749493775364273, - "1,4,5": 0.0025895071138517245, - "1,4,6": 0.012169813250551081, - "1,4,7": 0.013393794782764895, - "1,5,6": 0.07889597804875167, - "1,5,7": -0.1983749179312236, - "1,6,7": 0.3715943097212129, - "2,3,4": 0.001186876615567073, - "2,3,5": -0.010479572704099799, - "2,3,6": 0.00992207400807757, - "2,3,7": 0.01439695042722225, - "2,4,5": -0.018060108345961695, - "2,4,6": 0.007730985367420035, - "2,4,7": 0.006413045113016241, - "2,5,6": -0.011038855557204269, - "2,5,7": 0.09024878960266128, - "2,6,7": 0.03409261871769001, - "3,4,5": 0.01668156025359316, - "3,4,6": 0.009187536420491665, - "3,4,7": 0.002862113709878572, - "3,5,6": 0.05680182323414609, - "3,5,7": -0.00983023240318312, - "3,6,7": 0.0049444303504038445, - "4,5,6": -0.012501428796621167, - "4,5,7": -0.008362207884735823, - "4,6,7": 0.024084904167864157, - "5,6,7": -0.15097596912133857, - "0,1,2,3": 0.006201994436156488, - "0,1,2,4": 0.004907042385940252, - "0,1,2,5": 0.08269071198257702, - "0,1,2,6": -0.020727856510645404, - "0,1,2,7": 0.04348225767406361, - "0,1,3,4": -0.0006717749071712409, - "0,1,3,5": 0.11010033121241522, - "0,1,3,6": -0.04621767561716322, - "0,1,3,7": -0.07107945534076504, - "0,1,4,5": -0.033135054676562914, - "0,1,4,6": -0.0027308252700380398, - "0,1,4,7": 0.012693403625930022, - "0,1,5,6": -0.03787541374910258, - "0,1,5,7": -0.30329147300663833, - "0,1,6,7": 0.3426282540816506, - "0,2,3,4": -0.0013049770719887888, - "0,2,3,5": 0.016632057835098968, - "0,2,3,6": -0.006111828107722983, - "0,2,3,7": -0.0208920194620395, - "0,2,4,5": 0.012211214277890903, - "0,2,4,6": -0.006281083274523314, - "0,2,4,7": -0.0031059454137027376, - "0,2,5,6": -0.1612182682777637, - "0,2,5,7": -0.1009914192798072, - "0,2,6,7": -0.008101039618384764, - "0,3,4,5": 0.0021654113623659765, - "0,3,4,6": -0.0008174451144859485, - "0,3,4,7": -0.00972078209233368, - "0,3,5,6": 0.012447154759012757, - "0,3,5,7": 0.00049145637320408, - "0,3,6,7": -0.02226956261312002, - "0,4,5,6": -0.038819551903739036, - "0,4,5,7": -0.03142758571457377, - "0,4,6,7": 0.02324404593270951, - "0,5,6,7": -0.38004896904841917, - "1,2,3,4": -0.01094437168385659, - "1,2,3,5": -0.011803471708235758, - "1,2,3,6": -0.0060675799940843045, - "1,2,3,7": 0.007951578382477675, - "1,2,4,5": -0.0038708499352993475, - "1,2,4,6": -0.012197774808611783, - "1,2,4,7": -0.008671092445178885, - "1,2,5,6": 0.042473229993612305, - "1,2,5,7": 0.027670419531104107, - "1,2,6,7": 0.010919971826279073, - "1,3,4,5": 0.004432073237227108, - "1,3,4,6": -0.0059474388122072175, - "1,3,4,7": -0.008518339303203615, - "1,3,5,6": 0.04583642891699263, - "1,3,5,7": 0.03476476996399819, - "1,3,6,7": -0.031318557024061, - "1,4,5,6": -0.013296313514001679, - "1,4,5,7": -0.02268652760460782, - "1,4,6,7": 0.004515444240810351, - "1,5,6,7": -0.2263545459758815, - "2,3,4,5": -0.013883036959553452, - "2,3,4,6": -0.008883145696826078, - "2,3,4,7": -0.008236129487428856, - "2,3,5,6": -0.013647289976719656, - "2,3,5,7": -0.022032909395243994, - "2,3,6,7": 0.009518095146181571, - "2,4,5,6": -0.011794838254492512, - "2,4,5,7": -0.023270585876837113, - "2,4,6,7": -0.0026349008641516902, - "2,5,6,7": -0.006728444765193797, - "3,4,5,6": -0.00018308018334728393, - "3,4,5,7": -0.011454518593819463, - "3,4,6,7": -0.004174093612460739, - "3,5,6,7": 0.08714693275818336, - "4,5,6,7": -0.04478065625623756, - "0,1,2,3,4": 0.01975119104941847, - "0,1,2,3,5": 0.001107711508850362, - "0,1,2,3,6": 0.029329454294723445, - "0,1,2,3,7": 0.004582321863030203, - "0,1,2,4,5": 0.025468033270092394, - "0,1,2,4,6": 0.01115229326801559, - "0,1,2,4,7": 0.022792423837126097, - "0,1,2,5,6": 0.05754438428353914, - "0,1,2,5,7": 0.016642363395058424, - "0,1,2,6,7": 0.06722254067286493, - "0,1,3,4,5": 0.022338996048205106, - "0,1,3,4,6": 0.019344832748412144, - "0,1,3,4,7": 0.014689774488721219, - "0,1,3,5,6": 0.08365909112497827, - "0,1,3,5,7": 0.018229230867152002, - "0,1,3,6,7": -0.029109199155370358, - "0,1,4,5,6": -0.0062789668811237265, - "0,1,4,5,7": 0.003373376586498611, - "0,1,4,6,7": 0.03259540560238594, - "0,1,5,6,7": -0.4038091155178606, - "0,2,3,4,5": 0.02733543576121289, - "0,2,3,4,6": 0.017766291393650158, - "0,2,3,4,7": 0.016513420942273815, - "0,2,3,5,6": 0.01093307362939877, - "0,2,3,5,7": 0.01726738937318928, - "0,2,3,6,7": 0.005290353785402879, - "0,2,4,5,6": 0.022686026588349617, - "0,2,4,5,7": 0.01691459015821939, - "0,2,4,6,7": 0.021705994704493414, - "0,2,5,6,7": 0.0027125994591362668, - "0,3,4,5,6": 0.031057324574592537, - "0,3,4,5,7": 0.013724185592633442, - "0,3,4,6,7": 0.02091846096019878, - "0,3,5,6,7": 0.08268262836318285, - "0,4,5,6,7": -0.030146496702316727, - "1,2,3,4,5": 0.013962559620843806, - "1,2,3,4,6": 0.017063019541897817, - "1,2,3,4,7": 0.016587602724856265, - "1,2,3,5,6": -0.0026239611835888743, - "1,2,3,5,7": 0.01824932784299993, - "1,2,3,6,7": 0.026963714754071444, - "1,2,4,5,6": 0.012496843501255461, - "1,2,4,5,7": 0.017795607184029616, - "1,2,4,6,7": 0.010683508047956702, - "1,2,5,6,7": 0.04534331906607292, - "1,3,4,5,6": 0.020278609793309754, - "1,3,4,5,7": 0.01741681342074719, - "1,3,4,6,7": 0.016130235366816792, - "1,3,5,6,7": 0.12406865648734089, - "1,4,5,6,7": 0.003780681557911225, - "2,3,4,5,6": 0.016504948708468192, - "2,3,4,5,7": 0.016938846537511876, - "2,3,4,6,7": 0.016492839958564542, - "2,3,5,6,7": 0.011623537477062684, - "2,4,5,6,7": 0.010879176369913535, - "3,4,5,6,7": 0.02415708721864196, - "0,1,2,3,4,5": -0.027063842925908466, - "0,1,2,3,4,6": -0.03412603908379874, - "0,1,2,3,4,7": -0.033257529384550066, - "0,1,2,3,5,6": -0.05336017725072195, - "0,1,2,3,5,7": -0.05749352369613647, - "0,1,2,3,6,7": -0.03364377257717899, - "0,1,2,4,5,6": -0.03166442430409444, - "0,1,2,4,5,7": -0.024360108320003127, - "0,1,2,4,6,7": -0.03870536490543919, - "0,1,2,5,6,7": -0.046699899387512955, - "0,1,3,4,5,6": -0.032360910632223794, - "0,1,3,4,5,7": -0.036759950577155864, - "0,1,3,4,6,7": -0.034457342528500634, - "0,1,3,5,6,7": 0.081406548177547, - "0,1,4,5,6,7": -0.06178519904491586, - "0,2,3,4,5,6": -0.033009897416934164, - "0,2,3,4,5,7": -0.03301641675923661, - "0,2,3,4,6,7": -0.03298567991713042, - "0,2,3,5,6,7": -0.05085443009529933, - "0,2,4,5,6,7": -0.0330117498033109, - "0,3,4,5,6,7": -0.024129917565028025, - "1,2,3,4,5,6": -0.032306695750465186, - "1,2,3,4,5,7": -0.033647005575022204, - "1,2,3,4,6,7": -0.033216367417129744, - "1,2,3,5,6,7": -0.05701260842923239, - "1,2,4,5,6,7": -0.03881819815690979, - "1,3,4,5,6,7": -0.03294207815350858, - "2,3,4,5,6,7": -0.03344705491713529, - "0,1,2,3,4,5,6": 0.06461339150092416, - "0,1,2,3,4,5,7": 0.0655714585184648, - "0,1,2,3,4,6,7": 0.06643273483426215, - "0,1,2,3,5,6,7": 0.03539292500611646, - "0,1,2,4,5,6,7": 0.06555711615509408, - "0,1,3,4,5,6,7": 0.06263499391382821, - "0,2,3,4,5,6,7": 0.06689410983424837, - "1,2,3,4,5,6,7": 0.06643273483423906, - "0,1,2,3,4,5,6,7": -0.13286546966846924 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=BV_order=1.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=BV_order=1.json deleted file mode 100644 index 2af9a0095..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=BV_order=1.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.242429+00:00Z", - "metadata": { - "n_players": 8, - "index": "BV", - "max_order": 1, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.0591675062728614 - }, - "data": { - "0": 0.04071109156865119, - "1": 0.36705052215177625, - "2": 0.056378510780022956, - "3": 0.06145127312300626, - "4": 0.035427166992084876, - "5": 1.0270618033678374, - "6": 0.22220821165056254, - "7": 0.6938395979204278 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=FBII_order=1.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=FBII_order=1.json deleted file mode 100644 index 518e09e72..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=FBII_order=1.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.217011+00:00Z", - "metadata": { - "n_players": 8, - "index": "BV", - "max_order": 1, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 1.795019554465812 - }, - "data": { - "0": 0.04071109156865133, - "1": 0.3670505221517764, - "2": 0.05637851078002277, - "3": 0.06145127312300636, - "4": 0.03542716699208626, - "5": 1.0270618033678374, - "6": 0.22220821165056276, - "7": 0.6938395979204276 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=FBII_order=2.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=FBII_order=2.json deleted file mode 100644 index 79c98b636..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=FBII_order=2.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.213182+00:00Z", - "metadata": { - "n_players": 8, - "index": "FBII", - "max_order": 2, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.3074177954601414 - }, - "data": { - "0": -0.4175365712346754, - "1": 0.02333871259169884, - "2": -0.04643992829645007, - "3": 0.05272906514558718, - "4": -0.00048483966254241924, - "5": 0.7525270898999914, - "6": -0.2930033869531617, - "7": 0.38340507208660674, - "0,1": 0.19353574027109768, - "0,2": 0.08148939599956499, - "0,3": -0.001160253189245322, - "0,4": 0.03645870117648946, - "0,5": 0.3105589855933748, - "0,6": 0.17361253261720386, - "0,7": 0.12200022313816743, - "1,2": -0.041037331137638695, - "1,3": 0.0005327999416730602, - "1,4": 0.005625201001528086, - "1,5": 0.10313714646624923, - "1,6": 0.200774035937692, - "1,7": 0.2248560266395542, - "2,3": -0.010104014447133223, - "2,4": -0.004819215528300837, - "2,5": 0.113139326342999, - "2,6": -0.004700412826209198, - "2,7": 0.07166912974966508, - "3,4": -3.343927160956532e-05, - "3,5": 0.074863522018857, - "3,6": -0.013005320864577754, - "3,7": -0.033648878233124006, - "4,5": 0.013304844478492476, - "4,6": 0.005388072951927183, - "4,7": 0.015899848500730396, - "5,6": 0.19116359477724024, - "5,7": -0.2570979927415212, - "6,7": 0.4771906946141712 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=FBII_order=3.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=FBII_order=3.json deleted file mode 100644 index dd40ed564..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=FBII_order=3.json +++ /dev/null @@ -1,112 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.211393+00:00Z", - "metadata": { - "n_players": 8, - "index": "FBII", - "max_order": 3, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.1572715125767377 - }, - "data": { - "0": -0.23515349238642863, - "1": 0.2737542778296803, - "2": 0.029080900536569004, - "3": 0.12014952103476043, - "4": 0.04596018302125786, - "5": 0.7157734934874077, - "6": -0.048724393064293395, - "7": 0.4545724204185277, - "0,1": -0.10012908295518394, - "0,2": 0.054457798296991364, - "0,3": -0.07994698950882734, - "0,4": -0.022088129476845908, - "0,5": 0.3756719968057152, - "0,6": -0.12854435896819655, - "0,7": 0.08754177602000673, - "1,2": -0.0942484464256031, - "1,3": -0.02003884346133572, - "1,4": -0.029589680615128275, - "1,5": 0.04034214290617195, - "1,6": -0.10548812894501969, - "1,7": -0.005086602335671597, - "2,3": -0.03019069809153513, - "2,4": -0.010698591263710241, - "2,5": 0.022730281089791818, - "2,6": -0.03389669904014292, - "2,7": -0.004600081744923809, - "3,4": -0.02275117429678067, - "3,5": -0.054339644509496465, - "3,6": -0.03799289030070126, - "3,7": -0.006977167433179648, - "4,5": 0.0085273650470091, - "4,6": -0.022136605611926485, - "4,7": -0.015219261208565912, - "5,6": 0.2019882903612496, - "5,7": 0.10116338088558316, - "6,7": 0.17937761415670742, - "0,1,2": -0.01718508610661268, - "0,1,3": 0.024708495800575915, - "0,1,4": 0.030966610425299065, - "0,1,5": 0.0848621686230677, - "0,1,6": 0.21197025617166682, - "0,1,7": 0.2520072015385688, - "0,2,3": 0.01916906076751336, - "0,2,4": 0.01067081797168401, - "0,2,5": 0.02004416577540428, - "0,2,6": 0.06273702546133461, - "0,2,7": -0.04137278846418367, - "0,3,4": 0.00802448013905055, - "0,3,5": 0.15771915514614904, - "0,3,6": -0.013825973283555115, - "0,3,7": -0.03822174593056982, - "0,4,5": 0.029207636522833997, - "0,4,6": 0.014377546718010462, - "0,4,7": 0.023846569529795046, - "0,5,6": 0.017169061024244474, - "0,5,7": -0.43922820951638186, - "0,6,7": 0.31188586707909627, - "1,2,3": 0.005977978174524404, - "1,2,4": 0.0038171347490881247, - "1,2,5": 0.11010367173560957, - "1,2,6": -0.045051275569445146, - "1,2,7": 0.048759807592768045, - "1,3,4": 0.007492902911764084, - "1,3,5": 0.04751359953010127, - "1,3,6": -0.017054751857312464, - "1,3,7": -0.027494937753641868, - "1,4,5": 0.0025895071138478665, - "1,4,6": 0.012169813250546863, - "1,4,7": 0.013393794782767192, - "1,5,6": 0.07889597804875222, - "1,5,7": -0.19837491793122486, - "1,6,7": 0.3715943097212091, - "2,3,4": 0.001186876615565699, - "2,3,5": -0.010479572704097329, - "2,3,6": 0.009922074008074003, - "2,3,7": 0.014396950427220813, - "2,4,5": -0.018060108345962778, - "2,4,6": 0.0077309853674180085, - "2,4,7": 0.0064130451130211125, - "2,5,6": -0.011038855557205657, - "2,5,7": 0.0902487896026599, - "2,6,7": 0.034092618717694714, - "3,4,5": 0.016681560253593394, - "3,4,6": 0.009187536420495572, - "3,4,7": 0.002862113709875866, - "3,5,6": 0.0568018232341482, - "3,5,7": -0.009830232403180275, - "3,6,7": 0.004944430350398571, - "4,5,6": -0.012501428796619293, - "4,5,7": -0.008362207884734615, - "4,6,7": 0.024084904167863477, - "5,6,7": -0.15097596912134129 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=FBII_order=4.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=FBII_order=4.json deleted file mode 100644 index b3c6358d5..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=FBII_order=4.json +++ /dev/null @@ -1,182 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.199199+00:00Z", - "metadata": { - "n_players": 8, - "index": "FBII", - "max_order": 4, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.101327998897586 - }, - "data": { - "0": -0.155535408619962, - "1": 0.28577158787918966, - "2": 0.0576736862111851, - "3": 0.11996092083157706, - "4": 0.08086944355480481, - "5": 0.8449650700439576, - "6": 0.018837934584204408, - "7": 0.5504177858257168, - "0,1": -0.07838546637501977, - "0,2": 0.01380550869077162, - "0,3": -0.08770876809595715, - "0,4": -0.040286606440435274, - "0,5": 0.1631546473421963, - "0,6": -0.21676937505114385, - "0,7": -0.04455543245554983, - "1,2": -0.05624489414403855, - "1,3": -0.015859215521704217, - "1,4": -0.05362028048283895, - "1,5": -0.03574427842692714, - "1,6": -0.0945782919991307, - "1,7": -0.05191007517916958, - "2,3": -0.0510664565274939, - "2,4": -0.035188710040843646, - "2,5": -0.024160589112414643, - "2,6": -0.0842673873358975, - "2,7": -0.03088062275689596, - "3,4": -0.042286586526545385, - "3,5": 0.005913432890889393, - "3,6": -0.035665161593654376, - "3,7": -0.024433051008285137, - "4,5": -0.04892111010189193, - "4,6": -0.05333201995983446, - "4,7": -0.04977632707483941, - "5,6": 0.015277383991984108, - "5,7": -0.154585133337111, - "6,7": 0.11726810770868189, - "0,1,2": -0.07546216109065379, - "0,1,3": 0.025541785908835254, - "0,1,4": 0.040435214846255174, - "0,1,5": 0.1756176177417174, - "0,1,6": 0.09443201470432666, - "0,1,7": 0.23979070802143376, - "0,2,3": 0.021906446952765002, - "0,2,4": 0.007457692519877726, - "0,2,5": 0.09538201750641104, - "0,2,6": 0.163957063355864, - "0,2,7": 0.0034312945857597477, - "0,3,4": 0.013199264050851353, - "0,3,5": 0.08680094937510649, - "0,3,6": 0.017658705063184336, - "0,3,7": 0.023513435636943802, - "0,4,5": 0.07371041985016559, - "0,4,6": 0.027079976533069157, - "0,4,7": 0.02800500136079781, - "0,5,6": 0.319926585134259, - "0,5,7": -0.031594214178268215, - "0,6,7": 0.33415950271188277, - "1,2,3": 0.013308903458313884, - "1,2,4": 0.01920565799258533, - "1,2,5": 0.04152365180372704, - "1,2,6": -0.05225127082272439, - "1,2,7": 0.00808324010840325, - "1,3,4": 0.01831782864636379, - "1,3,5": -0.04415146628108951, - "1,3,6": 0.004802659407941154, - "1,3,7": 0.006605063907127576, - "1,4,5": 0.03686784336047869, - "1,4,6": 0.026998267332580053, - "1,4,7": 0.024727350525884914, - "1,5,6": 0.17350428521293543, - "1,5,7": 0.046573760614783036, - "1,6,7": 0.32139902614680815, - "2,3,4": 0.02281270706538241, - "2,3,5": 0.011887752398239276, - "2,3,6": 0.022517948322662684, - "2,3,7": 0.031242642835266628, - "2,4,5": 0.0022439400281643734, - "2,4,6": 0.028626856816705994, - "2,4,7": 0.029372372156660248, - "2,5,6": 0.06441895008305512, - "2,5,7": 0.15292525949565225, - "2,6,7": 0.03260577785532732, - "3,4,5": 0.026143135822166513, - "3,4,6": 0.019190138130146986, - "3,4,7": 0.023914045254498223, - "3,5,6": -0.008998249902919156, - "3,5,7": -0.054288097956340334, - "3,6,7": -0.014506976976961697, - "4,5,6": 0.04193579125928826, - "4,5,7": 0.05844772913830692, - "4,6,7": 0.03599998444754056, - "5,6,7": 0.1344068725224291, - "0,1,2,3": 0.006201994436153935, - "0,1,2,4": 0.004907042385937872, - "0,1,2,5": 0.08269071198257871, - "0,1,2,6": -0.02072785651064725, - "0,1,2,7": 0.043482257674065036, - "0,1,3,4": -0.0006717749071670984, - "0,1,3,5": 0.11010033121241779, - "0,1,3,6": -0.046217675617160045, - "0,1,3,7": -0.07107945534075413, - "0,1,4,5": -0.03313505467657039, - "0,1,4,6": -0.002730825270049149, - "0,1,4,7": 0.012693403625930945, - "0,1,5,6": -0.037875413749100986, - "0,1,5,7": -0.303291473006631, - "0,1,6,7": 0.34262825408165515, - "0,2,3,4": -0.001304977071982981, - "0,2,3,5": 0.016632057835093556, - "0,2,3,6": -0.006111828107727632, - "0,2,3,7": -0.02089201946204293, - "0,2,4,5": 0.012211214277892783, - "0,2,4,6": -0.0062810832745282055, - "0,2,4,7": -0.0031059454137048748, - "0,2,5,6": -0.16121826827776226, - "0,2,5,7": -0.1009914192798097, - "0,2,6,7": -0.008101039618390982, - "0,3,4,5": 0.002165411362360172, - "0,3,4,6": -0.0008174451144862607, - "0,3,4,7": -0.009720782092329218, - "0,3,5,6": 0.012447154759012286, - "0,3,5,7": 0.0004914563732059396, - "0,3,6,7": -0.022269562613118285, - "0,4,5,6": -0.03881955190374875, - "0,4,5,7": -0.031427585714580396, - "0,4,6,7": 0.023244045932694885, - "0,5,6,7": -0.38004896904841967, - "1,2,3,4": -0.010944371683855633, - "1,2,3,5": -0.0118034717082455, - "1,2,3,6": -0.006067579994086816, - "1,2,3,7": 0.00795157838246547, - "1,2,4,5": -0.003870849935291895, - "1,2,4,6": -0.012197774808606975, - "1,2,4,7": -0.00867109244517638, - "1,2,5,6": 0.042473229993619604, - "1,2,5,7": 0.027670419531100963, - "1,2,6,7": 0.01091997182627931, - "1,3,4,5": 0.004432073237221286, - "1,3,4,6": -0.005947438812203946, - "1,3,4,7": -0.00851833930319694, - "1,3,5,6": 0.04583642891699416, - "1,3,5,7": 0.03476476996399871, - "1,3,6,7": -0.03131855702405702, - "1,4,5,6": -0.013296313514003594, - "1,4,5,7": -0.022686527604605974, - "1,4,6,7": 0.004515444240810726, - "1,5,6,7": -0.22635454597587398, - "2,3,4,5": -0.013883036959552633, - "2,3,4,6": -0.008883145696816863, - "2,3,4,7": -0.008236129487428925, - "2,3,5,6": -0.013647289976718172, - "2,3,5,7": -0.02203290939525536, - "2,3,6,7": 0.009518095146174632, - "2,4,5,6": -0.011794838254478204, - "2,4,5,7": -0.023270585876831187, - "2,4,6,7": -0.0026349008641511455, - "2,5,6,7": -0.006728444765188912, - "3,4,5,6": -0.00018308018334782517, - "3,4,5,7": -0.011454518593824153, - "3,4,6,7": -0.004174093612461939, - "3,5,6,7": 0.08714693275818675, - "4,5,6,7": -0.044780656256241586 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=FBII_order=5.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=FBII_order=5.json deleted file mode 100644 index ff96ac612..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=FBII_order=5.json +++ /dev/null @@ -1,238 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.195940+00:00Z", - "metadata": { - "n_players": 8, - "index": "FBII", - "max_order": 5, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.0781161115246145 - }, - "data": { - "0": -0.1375361947488266, - "1": 0.3088230054467643, - "2": 0.09915361017306279, - "3": 0.16878753379929506, - "4": 0.11554887940129965, - "5": 0.8677346897368119, - "6": 0.043906634200605504, - "7": 0.5686617360313821, - "0,1": -0.07971373429435105, - "0,2": -0.03803422796397001, - "0,3": -0.14113526424769218, - "0,4": -0.08074943068929943, - "0,5": 0.1614744146568335, - "0,6": -0.22267649720070784, - "0,7": -0.033904463615053344, - "1,2": -0.11025917646191931, - "1,3": -0.07236171342263192, - "1,4": -0.09254813558000949, - "1,5": -0.04687472367397037, - "1,6": -0.11155771042083007, - "1,7": -0.05743864881572977, - "2,3": -0.08877134147546978, - "2,4": -0.0791250416868945, - "2,5": -0.06913331568138448, - "2,6": -0.13573863212606668, - "2,7": -0.07878080752613026, - "3,4": -0.08965814608293911, - "3,5": -0.0652005037049535, - "3,6": -0.10348153657388198, - "3,7": -0.08111020461692606, - "4,5": -0.08400656996551858, - "4,6": -0.08949053450001383, - "4,7": -0.08526926889449714, - "5,6": 0.000583703002188185, - "5,7": -0.15806560892926325, - "6,7": 0.10974486664912028, - "0,1,2": -0.011563981729988015, - "0,1,3": 0.07152263711836829, - "0,1,4": 0.08174205485067308, - "0,1,5": 0.1301863939130571, - "0,1,6": 0.05984469481445068, - "0,1,7": 0.1765929886813417, - "0,2,3": 0.05937560785304705, - "0,2,4": 0.05797911776309007, - "0,2,5": 0.1450349193631719, - "0,2,6": 0.22554281637574616, - "0,2,7": 0.051342294133456326, - "0,3,4": 0.06405924244068709, - "0,3,5": 0.16388471608595087, - "0,3,6": 0.08562678299297662, - "0,3,7": 0.06471057740706171, - "0,4,5": 0.1053285460992361, - "0,4,6": 0.06228026809721027, - "0,4,7": 0.06127528540334844, - "0,5,6": 0.28268672236472203, - "0,5,7": -0.09719652628454287, - "0,6,7": 0.2766752957549045, - "1,2,3": 0.049552138962576306, - "1,2,4": 0.061143928503968666, - "1,2,5": 0.09302019892602162, - "1,2,6": 0.016542508238978543, - "1,2,7": 0.06979892245541486, - "1,3,4": 0.06270873734718124, - "1,3,5": 0.03502029260161815, - "1,3,6": 0.08107877285109068, - "1,3,7": 0.06355718357222681, - "1,4,5": 0.0695259818859178, - "1,4,6": 0.061309882969284614, - "1,4,7": 0.06368870773015788, - "1,5,6": 0.1571191707708999, - "1,5,7": 0.01184632583727939, - "1,6,7": 0.2948664628673591, - "2,3,4": 0.06754174612508224, - "2,3,5": 0.04471246971722648, - "2,3,6": 0.059853766412580625, - "2,3,7": 0.06886998165000036, - "2,4,5": 0.047489456953169376, - "2,4,6": 0.06798459233737106, - "2,4,7": 0.0711983747729163, - "2,5,6": 0.111443937057981, - "2,5,7": 0.19651694871146003, - "2,6,7": 0.08733517392921354, - "3,4,5": 0.07707183764120885, - "3,4,6": 0.06911855069630239, - "3,4,7": 0.06730636205725726, - "3,5,6": 0.09158699914543555, - "3,5,7": 0.03180132783878223, - "3,6,7": 0.060297601827024844, - "4,5,6": 0.06828959994154576, - "4,5,7": 0.08215619611925867, - "4,6,7": 0.06779920771868209, - "5,6,7": 0.10222989096721379, - "0,1,2,3": -0.021183344921851963, - "0,1,2,4": -0.034674928326378945, - "0,1,2,5": 0.03230946575380927, - "0,1,2,6": -0.10335219277021178, - "0,1,2,7": -0.012137567209969776, - "0,1,3,4": -0.038734172074544965, - "0,1,3,5": 0.04743281643782685, - "0,1,3,6": -0.09782976512353078, - "0,1,3,7": -0.07527551937252817, - "0,1,4,5": -0.055585774188392056, - "0,1,4,6": -0.031137607638876116, - "0,1,4,7": -0.024032086631431283, - "0,1,5,6": 0.09656688974613627, - "0,1,5,7": -0.12050940067205669, - "0,1,6,7": 0.5091784382806483, - "0,2,3,4": -0.04198814664527088, - "0,2,3,5": -0.011689747301229438, - "0,2,3,6": -0.03777141465931344, - "0,2,3,7": -0.04271876244399231, - "0,2,4,5": -0.03399082861104717, - "0,2,4,6": -0.04293638625177898, - "0,2,4,7": -0.042069160234766034, - "0,2,5,6": -0.20815631025797576, - "0,2,5,7": -0.12775989047261418, - "0,2,6,7": -0.056566783929335146, - "0,3,4,5": -0.0450625596259555, - "0,3,4,6": -0.04536089995291662, - "0,3,4,7": -0.04264370308425249, - "0,3,5,6": -0.09171890408706361, - "0,3,5,7": -0.0654602607248774, - "0,3,6,7": -0.0621606845898281, - "0,4,5,6": -0.047478495693491204, - "0,4,5,7": -0.033360413532094645, - "0,4,6,7": 0.0007073636503264757, - "0,5,6,7": -0.20576877684949263, - "1,2,3,4": -0.044626558152370856, - "1,2,3,5": -0.027151290602795815, - "1,2,3,6": -0.04143369369763589, - "1,2,3,7": -0.025239905210003688, - "1,2,4,5": -0.03873237172341539, - "1,2,4,6": -0.037895606988175984, - "1,2,4,7": -0.04260066334216702, - "1,2,5,6": -0.013907062840030099, - "1,2,5,7": -0.021344889212981402, - "1,2,6,7": -0.06418656944420076, - "1,3,4,5": -0.0325664162043287, - "1,3,4,6": -0.0423557875374266, - "1,3,4,7": -0.04093055230377694, - "1,3,5,6": -0.06685476919402868, - "1,3,5,7": -0.05421724434512294, - "1,3,6,7": -0.10034526075048528, - "1,4,5,6": -0.02843489749967898, - "1,4,5,7": -0.04386976697920328, - "1,4,6,7": -0.027079471046726124, - "1,5,6,7": -0.11104631677261513, - "2,3,4,5": -0.05125393227358232, - "2,3,4,6": -0.042796695498124475, - "2,3,4,7": -0.04150248456904328, - "2,3,5,6": -0.03186608929239383, - "2,3,5,7": -0.05407246001063491, - "2,3,6,7": -0.02066712784137354, - "2,4,5,6": -0.043078335838490446, - "2,4,5,7": -0.05453469600168363, - "2,4,6,7": -0.032515660404622275, - "2,5,6,7": -0.04200776095128997, - "3,4,5,6": -0.04618206533085869, - "3,4,5,7": -0.04757298497859733, - "3,4,6,7": -0.043023405364581276, - "3,5,6,7": -0.03411902201493254, - "4,5,6,7": -0.04911588047831993, - "0,1,2,3,4": 0.019751191049418443, - "0,1,2,3,5": 0.0011077115088513959, - "0,1,2,3,6": 0.02932945429472196, - "0,1,2,3,7": 0.004582321863029898, - "0,1,2,4,5": 0.025468033270090014, - "0,1,2,4,6": 0.011152293268014375, - "0,1,2,4,7": 0.0227924238371219, - "0,1,2,5,6": 0.057544384283539446, - "0,1,2,5,7": 0.01664236339505743, - "0,1,2,6,7": 0.06722254067286067, - "0,1,3,4,5": 0.022338996048199743, - "0,1,3,4,6": 0.01934483274841147, - "0,1,3,4,7": 0.014689774488721115, - "0,1,3,5,6": 0.08365909112497791, - "0,1,3,5,7": 0.018229230867152516, - "0,1,3,6,7": -0.02910919915537139, - "0,1,4,5,6": -0.006278966881127675, - "0,1,4,5,7": 0.0033733765864959082, - "0,1,4,6,7": 0.032595405602382645, - "0,1,5,6,7": -0.4038091155178628, - "0,2,3,4,5": 0.027335435761213597, - "0,2,3,4,6": 0.017766291393657097, - "0,2,3,4,7": 0.016513420942280067, - "0,2,3,5,6": 0.01093307362939843, - "0,2,3,5,7": 0.017267389373191215, - "0,2,3,6,7": 0.0052903537854018245, - "0,2,4,5,6": 0.022686026588349367, - "0,2,4,5,7": 0.01691459015822107, - "0,2,4,6,7": 0.021705994704496183, - "0,2,5,6,7": 0.002712599459138952, - "0,3,4,5,6": 0.031057324574592555, - "0,3,4,5,7": 0.013724185592634757, - "0,3,4,6,7": 0.02091846096020187, - "0,3,5,6,7": 0.08268262836318024, - "0,4,5,6,7": -0.030146496702316863, - "1,2,3,4,5": 0.013962559620849233, - "1,2,3,4,6": 0.017063019541901273, - "1,2,3,4,7": 0.01658760272485944, - "1,2,3,5,6": -0.0026239611835889645, - "1,2,3,5,7": 0.01824932784300569, - "1,2,3,6,7": 0.026963714754069168, - "1,2,4,5,6": 0.012496843501256332, - "1,2,4,5,7": 0.01779560718403339, - "1,2,4,6,7": 0.010683508047955786, - "1,2,5,6,7": 0.04534331906607604, - "1,3,4,5,6": 0.020278609793309737, - "1,3,4,5,7": 0.017416813420749678, - "1,3,4,6,7": 0.016130235366816487, - "1,3,5,6,7": 0.12406865648733853, - "1,4,5,6,7": 0.0037806815579134456, - "2,3,4,5,6": 0.016504948708471752, - "2,3,4,5,7": 0.016938846537517982, - "2,3,4,6,7": 0.016492839958570704, - "2,3,5,6,7": 0.011623537477063337, - "2,4,5,6,7": 0.010879176369914256, - "3,4,5,6,7": 0.024157087218644395 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=FBII_order=6.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=FBII_order=6.json deleted file mode 100644 index 6c3885f02..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=FBII_order=6.json +++ /dev/null @@ -1,266 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.203196+00:00Z", - "metadata": { - "n_players": 8, - "index": "FBII", - "max_order": 6, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.063542210955885 - }, - "data": { - "0": -0.116556831373899, - "1": 0.3304565832569083, - "2": 0.12389425973788071, - "3": 0.18934018043917022, - "4": 0.13789487231190234, - "5": 0.8893702378800508, - "6": 0.06537948604934844, - "7": 0.5901879125636843, - "0,1": -0.10873445532191056, - "0,2": -0.07323753145318361, - "0,3": -0.16832981938722424, - "0,4": -0.11266782901230567, - "0,5": 0.13246417093175855, - "0,6": -0.2513882632216231, - "0,7": -0.0626391096390459, - "1,2": -0.14622014878473655, - "1,3": -0.1005017944104365, - "1,4": -0.12539007662754925, - "1,5": -0.0771789783006396, - "1,6": -0.14153849351113498, - "1,7": -0.08752567381425157, - "2,3": -0.12492390655024987, - "2,4": -0.10991481510172853, - "2,5": -0.1057436927306381, - "2,6": -0.17216752958936477, - "2,7": -0.11504141435999317, - "3,4": -0.1200785666207009, - "3,5": -0.09370037630289016, - "3,6": -0.13075943804621826, - "3,7": -0.10895127520537953, - "4,5": -0.11577678558441565, - "4,6": -0.12242596697483087, - "4,7": -0.11805301658358172, - "5,6": -0.029416090293432028, - "5,7": -0.18822633344820672, - "6,7": 0.08035092197904126, - "0,1,2": 0.035982853499455486, - "0,1,3": 0.10416220467822879, - "0,1,4": 0.12605964381400744, - "0,1,5": 0.1664540799082395, - "0,1,6": 0.0955192675065875, - "0,1,7": 0.2123125064618377, - "0,2,3": 0.10797702149142974, - "0,2,4": 0.09812924936563787, - "0,2,5": 0.1938517281080711, - "0,2,6": 0.27405049571844303, - "0,2,7": 0.09934585348920304, - "0,3,4": 0.10420518328950412, - "0,3,5": 0.19721503092861814, - "0,3,6": 0.11656698535416012, - "0,3,7": 0.09660957927241731, - "0,4,5": 0.1474738482678551, - "0,4,6": 0.10680983374738073, - "0,4,7": 0.10533394275400326, - "0,5,6": 0.31837047953004727, - "0,5,7": -0.061358445400645195, - "0,6,7": 0.3110336467107587, - "1,2,3": 0.09894308422389017, - "1,2,4": 0.1020396254819409, - "1,2,5": 0.1433235094005514, - "1,2,6": 0.06648670164683061, - "1,2,7": 0.11940571968661069, - "1,3,4": 0.10397595760076397, - "1,3,5": 0.07021282320325294, - "1,3,6": 0.11383120330679383, - "1,3,7": 0.09743513734236686, - "1,4,5": 0.11348953356599183, - "1,4,6": 0.10760771046646303, - "1,4,7": 0.1096823507381012, - "1,5,6": 0.19531212613742344, - "1,5,7": 0.05036032873265732, - "1,6,7": 0.3318507481702565, - "2,3,4": 0.10830131226852133, - "2,3,5": 0.09611392631925336, - "2,3,6": 0.10909910676950205, - "2,3,7": 0.11869178024604454, - "2,4,5": 0.08753263119431354, - "2,4,6": 0.1106460262964411, - "2,4,7": 0.11300655916741148, - "2,5,6": 0.16271707899692828, - "2,5,7": 0.24756207310394868, - "2,6,7": 0.13713456463004076, - "3,4,5": 0.11690730892531187, - "3,4,6": 0.10949129861906971, - "3,4,7": 0.10828877990658442, - "3,5,6": 0.12508915189958197, - "3,5,7": 0.06653838253758887, - "3,6,7": 0.09170793975489115, - "4,5,6": 0.11247411565962812, - "4,5,7": 0.12614590597831804, - "4,6,7": 0.11323657676984676, - "5,6,7": 0.13939171438914466, - "0,1,2,3": -0.08091956615144669, - "0,1,2,4": -0.08196925555733642, - "0,1,2,5": -0.027851028217323173, - "0,1,2,6": -0.1629021121474235, - "0,1,2,7": -0.07067761677769824, - "0,1,3,4": -0.08824057585759587, - "0,1,3,5": 0.016024852211635382, - "0,1,3,6": -0.12446518859727991, - "0,1,3,7": -0.10382691201903388, - "0,1,4,5": -0.10908438313950794, - "0,1,4,6": -0.08941242776362561, - "0,1,4,7": -0.08136346032158723, - "0,1,5,6": 0.060450874135610025, - "0,1,5,7": -0.1569324338841363, - "0,1,6,7": 0.47570718071411405, - "0,2,3,4": -0.09035299801718036, - "0,2,3,5": -0.07538931933729617, - "0,2,3,6": -0.09726641374462311, - "0,2,3,7": -0.10303160055141235, - "0,2,4,5": -0.07952243849343714, - "0,2,4,6": -0.09381217510947554, - "0,2,4,7": -0.09090337250718512, - "0,2,5,6": -0.27030645482244686, - "0,2,5,7": -0.1891189224880017, - "0,2,6,7": -0.11554200810083244, - "0,3,4,5": -0.0916477935950927, - "0,3,4,6": -0.09312834673884082, - "0,3,4,7": -0.09129541226717938, - "0,3,5,6": -0.11979610028275908, - "0,3,5,7": -0.09567218335374125, - "0,3,6,7": -0.08582683321624202, - "0,4,5,6": -0.10146902038512773, - "0,4,5,7": -0.0866262490495251, - "0,4,6,7": -0.055561449790762496, - "0,5,6,7": -0.23953743877913614, - "1,2,3,4": -0.0930309281866277, - "1,2,3,5": -0.09237225400968731, - "1,2,3,6": -0.10235010882480007, - "1,2,3,7": -0.08730760697982899, - "1,2,4,5": -0.08569744048155856, - "1,2,4,6": -0.09010487939266806, - "1,2,4,7": -0.09310180678196452, - "1,2,5,6": -0.07887256365977326, - "1,2,5,7": -0.08585272510421402, - "1,2,6,7": -0.12621062216259987, - "1,3,4,5": -0.08133653710791933, - "1,3,4,6": -0.09220814592887949, - "1,3,4,7": -0.09200062071276628, - "1,3,5,6": -0.09849874970371567, - "1,3,5,7": -0.08832939890851269, - "1,3,6,7": -0.12781166598252253, - "1,4,5,6": -0.08590427401023734, - "1,4,5,7": -0.10094790193612838, - "1,4,6,7": -0.08706060859837036, - "1,5,6,7": -0.15000917552127335, - "2,3,4,5": -0.09937666060977032, - "2,3,4,6": -0.09256962912380365, - "2,3,4,7": -0.09139499806160209, - "2,3,5,6": -0.09686380525734589, - "2,3,5,7": -0.12044021987866935, - "2,3,6,7": -0.08095710617969254, - "2,4,5,6": -0.09364284092570545, - "2,4,5,7": -0.10360982938460042, - "2,4,6,7": -0.08506176418391839, - "2,5,6,7": -0.10696874614865337, - "3,4,5,6": -0.09323120393968135, - "3,4,5,7": -0.0960585908653944, - "3,4,6,7": -0.09081801548921661, - "3,5,6,7": -0.0633639072606221, - "4,5,6,7": -0.10514942988854767, - "0,1,2,3,4": 0.06697489674655803, - "0,1,2,3,5": 0.07006648344526495, - "0,1,2,3,6": 0.08989444875058322, - "0,1,2,3,7": 0.0667797346919694, - "0,1,2,4,5": 0.06701222104513672, - "0,1,2,4,6": 0.06340020741467585, - "0,1,2,4,7": 0.07095392514211715, - "0,1,2,5,6": 0.12340663475473566, - "0,1,2,5,7": 0.08091912909691643, - "0,1,2,6,7": 0.1267470591079646, - "0,1,3,4,5": 0.07043134811585369, - "0,1,3,4,6": 0.06981697887067698, - "0,1,3,4,7": 0.0669271857338454, - "0,1,3,5,6": 0.0858163609777138, - "0,1,3,5,7": 0.024652693915040852, - "0,1,3,6,7": -0.035761915691301216, - "0,1,4,5,6": 0.05662630010951726, - "0,1,4,5,7": 0.06482600555757866, - "0,1,4,6,7": 0.10006935884182785, - "0,1,5,6,7": -0.39026984039038987, - "0,2,3,4,5": 0.07388051431226764, - "0,2,3,4,6": 0.06782709960263036, - "0,2,3,4,7": 0.06614323397276797, - "0,2,3,5,6": 0.07954532601090084, - "0,2,3,5,7": 0.08794957464855463, - "0,2,3,6,7": 0.06403229508023756, - "0,2,4,5,6": 0.07152906235054465, - "0,2,4,5,7": 0.06210872759950767, - "0,2,4,6,7": 0.07405739201746923, - "0,2,5,6,7": 0.06799563910220595, - "0,3,4,5,6": 0.07580768738171334, - "0,3,4,5,7": 0.06067732804338399, - "0,3,4,6,7": 0.06670493096555646, - "0,3,5,6,7": 0.07947152810459523, - "0,4,5,6,7": 0.029316936504332564, - "1,2,3,4,5": 0.060471331746550824, - "1,2,3,4,6": 0.06688757066761193, - "1,2,3,4,7": 0.06664805391319317, - "1,2,3,5,6": 0.0687157795316494, - "1,2,3,5,7": 0.09232589669320568, - "1,2,3,6,7": 0.08890008896585334, - "1,2,4,5,6": 0.06389150260700162, - "1,2,4,5,7": 0.06620826321001858, - "1,2,4,6,7": 0.0660534732877157, - "1,2,5,6,7": 0.11660867205293642, - "1,3,4,5,6": 0.06908345206142757, - "1,3,4,5,7": 0.06909133057359335, - "1,3,4,6,7": 0.06643812941639342, - "1,3,5,6,7": 0.12834272568997634, - "1,4,5,6,7": 0.07055341923559583, - "2,3,4,5,6": 0.06588677275071, - "2,3,4,5,7": 0.06699408516321573, - "2,3,4,6,7": 0.06631739108427727, - "2,3,5,6,7": 0.08228058419792056, - "2,4,5,6,7": 0.06351767780862477, - "3,4,5,6,7": 0.06941661253647702, - "0,1,2,3,4,5": -0.027063842925918728, - "0,1,2,3,4,6": -0.03412603908378335, - "0,1,2,3,4,7": -0.03325752938456861, - "0,1,2,3,5,6": -0.05336017725075198, - "0,1,2,3,5,7": -0.05749352369616663, - "0,1,2,3,6,7": -0.03364377257717561, - "0,1,2,4,5,6": -0.03166442430411971, - "0,1,2,4,5,7": -0.024360108320008782, - "0,1,2,4,6,7": -0.0387053649054644, - "0,1,2,5,6,7": -0.046699899387530955, - "0,1,3,4,5,6": -0.03236091063224403, - "0,1,3,4,5,7": -0.036759950577175585, - "0,1,3,4,6,7": -0.03445734252850745, - "0,1,3,5,6,7": 0.08140654817756479, - "0,1,4,5,6,7": -0.06178519904492438, - "0,2,3,4,5,6": -0.033009897416954245, - "0,2,3,4,5,7": -0.033016416759251564, - "0,2,3,4,6,7": -0.032985679917141686, - "0,2,3,5,6,7": -0.050854430095304194, - "0,2,4,5,6,7": -0.033011749803349526, - "0,3,4,5,6,7": -0.0241299175650687, - "1,2,3,4,5,6": -0.03230669575045217, - "1,2,3,4,5,7": -0.03364700557498397, - "1,2,3,4,6,7": -0.03321636741710448, - "1,2,3,5,6,7": -0.05701260842929875, - "1,2,4,5,6,7": -0.03881819815692499, - "1,3,4,5,6,7": -0.03294207815349573, - "2,3,4,5,6,7": -0.03344705491711125 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=FBII_order=7.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=FBII_order=7.json deleted file mode 100644 index f4449a3e7..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=FBII_order=7.json +++ /dev/null @@ -1,274 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.207686+00:00Z", - "metadata": { - "n_players": 8, - "index": "FBII", - "max_order": 7, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.0596865120137378 - }, - "data": { - "0": -0.1098834449713168, - "1": 0.3371227606750382, - "2": 0.130626985842284, - "3": 0.19602724838354474, - "4": 0.14505325574298888, - "5": 0.8960436242825873, - "6": 0.07206632989431427, - "7": 0.5968897262057895, - "0,1": -0.11999078719470453, - "0,2": -0.0846269606985009, - "0,3": -0.1796279323124861, - "0,4": -0.12490857291099627, - "0,5": 0.12119342109021582, - "0,6": -0.2626859279480481, - "0,7": -0.07396671395976925, - "1,2": -0.15759516006121718, - "1,3": -0.11178548936688014, - "1,4": -0.13761640255739732, - "1,5": -0.0884353101733884, - "1,6": -0.15282174026874226, - "1,7": -0.0988388601661548, - "2,3": -0.1363406988792263, - "2,4": -0.12227423840412477, - "2,5": -0.11713312197591769, - "2,6": -0.18358387371949922, - "2,7": -0.12648769808441052, - "3,4": -0.13234667360304297, - "3,5": -0.10499848922810608, - "3,6": -0.14208446585630177, - "3,7": -0.12030624260975747, - "4,5": -0.12801752948304346, - "4,6": -0.13469362575832367, - "4,7": -0.13035061496137773, - "5,6": -0.04071375501982218, - "5,7": -0.19955393776888394, - "6,7": 0.06899640277350849, - "0,1,2": 0.05458083012539727, - "0,1,3": 0.12257754866407732, - "0,1,4": 0.1463602497466996, - "0,1,5": 0.1848146977266366, - "0,1,6": 0.11393371509473965, - "0,1,7": 0.23078683323859617, - "0,2,3": 0.12665856022231273, - "0,2,4": 0.11869605004335917, - "0,2,5": 0.2124785406715315, - "0,2,6": 0.29273113805162976, - "0,2,7": 0.11808637501097768, - "0,3,4": 0.12458935132712759, - "0,3,5": 0.21565921085196627, - "0,3,6": 0.13506499504725822, - "0,3,7": 0.11516746815410582, - "0,4,5": 0.16780329013803372, - "0,4,6": 0.12719310538731354, - "0,4,7": 0.12577709358252984, - "0,5,6": 0.3368137630557111, - "0,5,7": -0.04285528268639199, - "0,6,7": 0.3295906391947597, - "1,2,3": 0.11759578701722469, - "1,2,4": 0.12257759022206889, - "1,2,5": 0.16192148602645465, - "1,2,6": 0.08513850804246177, - "1,2,7": 0.13811740527082247, - "1,3,4": 0.12433128970082097, - "1,3,5": 0.08862816718906524, - "1,3,6": 0.13230037706233888, - "1,3,7": 0.11596419028652208, - "1,4,5": 0.13379013949861196, - "1,4,6": 0.12796214616881635, - "1,4,7": 0.1300966656290532, - "1,5,6": 0.21372657372555054, - "1,5,7": 0.06883465550937858, - "1,6,7": 0.35037890471669497, - "2,3,4": 0.12892283911362643, - "2,3,5": 0.1147954650501152, - "2,3,6": 0.12783447527008215, - "2,3,7": 0.13748702793521844, - "2,4,5": 0.10809943187198369, - "2,4,6": 0.13126665674384788, - "2,4,7": 0.13368706880341985, - "2,5,6": 0.18139772133010656, - "2,5,7": 0.2663025946256973, - "2,6,7": 0.1559289159215067, - "3,4,5": 0.13729147696289182, - "3,4,6": 0.12992929642637696, - "3,4,7": 0.1287866569024943, - "3,5,6": 0.1435871615926528, - "3,5,7": 0.08509627141924433, - "3,6,7": 0.11031965840627583, - "4,5,6": 0.13285738729951838, - "4,5,7": 0.14658905680679127, - "4,6,7": 0.1337335573680464, - "5,6,7": 0.1579487068731068, - "0,1,2,3": -0.10992087988392323, - "0,1,2,4": -0.11474109318345384, - "0,1,2,5": -0.05674288961489043, - "0,1,2,6": -0.19190163308448185, - "0,1,2,7": -0.09979689609194883, - "0,1,3,4": -0.120647148203543, - "0,1,3,5": -0.012501743905765042, - "0,1,3,6": -0.15309944425417515, - "0,1,3,7": -0.13258092605312724, - "0,1,4,5": -0.1413815031505461, - "0,1,4,6": -0.12181720731417243, - "0,1,4,7": -0.1138879982493158, - "0,1,5,6": 0.031926070813625355, - "0,1,5,7": -0.18557699558332363, - "0,1,6,7": 0.44695495947544506, - "0,2,3,4": -0.12329195985316896, - "0,2,3,5": -0.1044483049447845, - "0,2,3,6": -0.12643305889155387, - "0,2,3,7": -0.13231800407553745, - "0,2,4,5": -0.11235194799454527, - "0,2,4,6": -0.12674934415005817, - "0,2,4,7": -0.12396029992497438, - "0,2,5,6": -0.29936364763453466, - "0,2,5,7": -0.2182958736772609, - "0,2,6,7": -0.14482661882955442, - "0,3,4,5": -0.12411203781603643, - "0,3,4,6": -0.12570025049925115, - "0,3,4,7": -0.12398707440477313, - "0,3,5,6": -0.14848802781465417, - "0,3,5,7": -0.12448386926281833, - "0,3,6,7": -0.11474617866481573, - "0,4,5,6": -0.13393147181066564, - "0,4,5,7": -0.11920845885224794, - "0,4,6,7": -0.08825131913296906, - "0,5,6,7": -0.26834733189282034, - "1,2,3,4": -0.1259122181475713, - "1,2,3,5": -0.1213735677421386, - "1,2,3,6": -0.13145908209672316, - "1,2,3,7": -0.11653633862896509, - "1,2,4,5": -0.11846927810760993, - "1,2,4,6": -0.12298437655820317, - "1,2,4,7": -0.12610106232469662, - "1,2,5,6": -0.10787208459682138, - "1,2,5,7": -0.11497200441843347, - "1,2,6,7": -0.15543756101627743, - "1,3,4,5": -0.11374310945383237, - "1,3,4,6": -0.12472237781424428, - "1,3,4,7": -0.12463461097534724, - "1,3,5,6": -0.12713300536057226, - "1,3,5,7": -0.1170834129425875, - "1,3,6,7": -0.15667333955605606, - "1,4,5,6": -0.1183090535607274, - "1,4,5,7": -0.13347243986379967, - "1,4,6,7": -0.11969280606552116, - "1,5,6,7": -0.17876139675991937, - "2,3,4,5": -0.13231562244574258, - "2,3,4,6": -0.1256162504992384, - "2,3,4,7": -0.12456137781424796, - "2,3,5,6": -0.12603045040428812, - "2,3,5,7": -0.1497266234027925, - "2,3,6,7": -0.11035116924326858, - "2,4,5,6": -0.12658000996627883, - "2,4,5,7": -0.1366667568023529, - "2,4,6,7": -0.11822635114113046, - "2,5,6,7": -0.136253356877359, - "3,4,5,6": -0.12580310770009165, - "3,4,5,7": -0.12875025300297144, - "3,4,6,7": -0.12361733716626147, - "3,5,6,7": -0.0922832527091582, - "4,5,6,7": -0.13783929923071309, - "0,1,2,3,4": 0.11612929295997707, - "0,1,2,3,5": 0.11146092720163223, - "0,1,2,3,6": 0.13150421158592077, - "0,1,2,3,7": 0.10862901428169291, - "0,1,2,4,5": 0.11594771258874491, - "0,1,2,4,6": 0.11255101803727915, - "0,1,2,4,7": 0.12034425251910333, - "0,1,2,5,6": 0.16479749292026846, - "0,1,2,5,7": 0.12254950401682618, - "0,1,2,6,7": 0.16859275310682487, - "0,1,3,4,5": 0.11863630909917713, - "0,1,3,4,6": 0.11823725893295059, - "0,1,3,4,7": 0.11558698255048118, - "0,1,3,5,6": 0.1264766885829172, - "0,1,3,5,7": 0.06555253827464877, - "0,1,3,6,7": 0.005353247747275344, - "0,1,4,5,6": 0.10482767550198505, - "0,1,4,5,7": 0.1132668977044171, - "0,1,4,6,7": 0.14872557006764373, - "0,1,5,6,7": -0.3493735816216276, - "0,2,3,4,5": 0.1231502542756874, - "0,2,3,4,6": 0.11731215864496702, - "0,2,3,4,7": 0.11586780976950507, - "0,2,3,5,6": 0.12127043259622977, - "0,2,3,5,7": 0.1299141979882624, - "0,2,3,6,7": 0.1062122374988918, - "0,2,4,5,6": 0.12079521672312893, - "0,2,4,5,7": 0.11161439872648513, - "0,2,4,6,7": 0.12377838222337748, - "0,2,5,6,7": 0.10995667685109921, - "0,3,4,5,6": 0.12434331119396563, - "0,3,4,5,7": 0.10945246861001079, - "0,3,4,6,7": 0.11569539061113787, - "0,3,5,6,7": 0.12070203529315682, - "0,4,5,6,7": 0.07808849148014314, - "1,2,3,4,5": 0.10962572795995693, - "1,2,3,4,6": 0.11625728595995675, - "1,2,3,4,7": 0.11625728595996031, - "1,2,3,5,6": 0.11032554236695014, - "1,2,3,5,7": 0.13417517628292217, - "1,2,3,6,7": 0.13096468763451308, - "1,2,4,5,6": 0.11304231322957037, - "1,2,4,5,7": 0.11559859058696315, - "1,2,4,6,7": 0.11565911974360402, - "1,2,5,6,7": 0.15845436605177832, - "1,3,4,5,6": 0.11750373212366694, - "1,3,4,5,7": 0.11775112739023327, - "1,3,4,6,7": 0.11531324531197333, - "1,3,5,6,7": 0.16945788912849058, - "1,4,5,6,7": 0.11920963046138189, - "2,3,4,5,6": 0.11537183179310304, - "2,3,4,5,7": 0.11671866095996224, - "2,3,4,6,7": 0.11625728595996758, - "2,3,5,6,7": 0.1244605266165563, - "2,4,5,6,7": 0.11323866801450583, - "3,4,5,6,7": 0.11840707218206785, - "0,1,2,3,4,5": -0.09215626793562512, - "0,1,2,3,4,6": -0.09964910225139931, - "0,1,2,3,4,7": -0.09925962606093229, - "0,1,2,3,5,6": -0.10336333550425306, - "0,1,2,3,5,7": -0.10797571545844864, - "0,1,2,3,6,7": -0.08455660249739122, - "0,1,2,4,5,6": -0.09674967813214241, - "0,1,2,4,5,7": -0.08992439565680366, - "0,1,2,4,6,7": -0.10470029040014361, - "0,1,2,5,6,7": -0.09717491996815089, - "0,1,3,4,5,6": -0.09598510333962398, - "0,1,3,4,5,7": -0.10086317679332488, - "0,1,3,4,6,7": -0.09899120690257082, - "0,1,3,5,6,7": 0.03239258871754878, - "0,1,4,5,6,7": -0.12588125407940673, - "0,2,3,4,5,6": -0.09876364808455217, - "0,2,3,4,5,7": -0.09924920093561804, - "0,2,3,4,6,7": -0.0996491022514138, - "0,2,3,5,6,7": -0.10199794751550618, - "0,2,4,5,6,7": -0.09923736279801965, - "0,3,4,5,6,7": -0.0888944694391009, - "1,2,3,4,5,6": -0.09782975891806338, - "1,2,3,4,5,7": -0.09964910225138918, - "1,2,3,4,6,7": -0.09964910225139259, - "1,2,3,5,6,7": -0.10792543834942472, - "1,2,4,5,6,7": -0.10481312365159351, - "1,3,4,5,6,7": -0.09747594252755039, - "2,3,4,5,6,7": -0.10011047725139587, - "0,1,2,3,4,5,6": 0.0646133915009334, - "0,1,2,3,4,5,7": 0.06557145851847632, - "0,1,2,3,4,6,7": 0.06643273483427864, - "0,1,2,3,5,6,7": 0.035392925006128034, - "0,1,2,4,5,6,7": 0.06555711615512269, - "0,1,3,4,5,6,7": 0.06263499391385582, - "0,2,3,4,5,6,7": 0.06689410983427543, - "1,2,3,4,5,6,7": 0.0664327348342551 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=FBII_order=8.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=FBII_order=8.json deleted file mode 100644 index d21d130af..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=FBII_order=8.json +++ /dev/null @@ -1,275 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.241559+00:00Z", - "metadata": { - "n_players": 8, - "index": "FBII", - "max_order": 8, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.059167506272849 - }, - "data": { - "0": -0.10884543348955084, - "1": 0.3381607721568223, - "2": 0.13166499732406745, - "3": 0.1970652598653314, - "4": 0.1460912672247776, - "5": 0.8970816357643606, - "6": 0.07310434137609167, - "7": 0.597927737687569, - "0,1": -0.12206681015825938, - "0,2": -0.08670298366205464, - "0,3": -0.18170395527604882, - "0,4": -0.12698459587455696, - "0,5": 0.1191173981266741, - "0,6": -0.26476195091159965, - "0,7": -0.07604273692331817, - "1,2": -0.15967118302479552, - "1,3": -0.11386151233046204, - "1,4": -0.13969242552097377, - "1,5": -0.09051133313695545, - "1,6": -0.1548977632323116, - "1,7": -0.10091488312972485, - "2,3": -0.13841672184280107, - "2,4": -0.12435026136770573, - "2,5": -0.11920914493948138, - "2,6": -0.18565989668306904, - "2,7": -0.12856372104798053, - "3,4": -0.13442269656662498, - "3,5": -0.10707451219167313, - "3,6": -0.14416048881987645, - "3,7": -0.12238226557332996, - "4,5": -0.130093552446604, - "4,6": -0.13676964872189637, - "4,7": -0.13242663792495024, - "5,6": -0.04278977798337942, - "5,7": -0.20162996073244263, - "6,7": 0.0669203798099453, - "0,1,2": 0.05873287605253137, - "0,1,3": 0.12672959459122035, - "0,1,4": 0.15051229567383148, - "0,1,5": 0.188966743653757, - "0,1,6": 0.11808576102186599, - "0,1,7": 0.23493887916572542, - "0,2,3": 0.13081060614945145, - "0,2,4": 0.12284809597049602, - "0,2,5": 0.2166305865986471, - "0,2,6": 0.2968831839787588, - "0,2,7": 0.12223842093810144, - "0,3,4": 0.12874139725427028, - "0,3,5": 0.2198112567790922, - "0,3,6": 0.1392170409743909, - "0,3,7": 0.1193195140812407, - "0,4,5": 0.17195533606515176, - "0,4,6": 0.1313451513144475, - "0,4,7": 0.12992913950966425, - "0,5,6": 0.34096580898282425, - "0,5,7": -0.03870323675927778, - "0,6,7": 0.33374268512188343, - "1,2,3": 0.12174783294438016, - "1,2,4": 0.12672963614923274, - "1,2,5": 0.16607353195359578, - "1,2,6": 0.08929055396961366, - "1,2,7": 0.14226945119797005, - "1,3,4": 0.12848333562798236, - "1,3,5": 0.09278021311621952, - "1,3,6": 0.13645242298949511, - "1,3,7": 0.12011623621367912, - "1,4,5": 0.13794218542575487, - "1,4,6": 0.13211419209596936, - "1,4,7": 0.13424871155619905, - "1,5,6": 0.21787861965269228, - "1,5,7": 0.0729867014365155, - "1,6,7": 0.35453095064383694, - "2,3,4": 0.133074885040786, - "2,3,5": 0.11894751097725784, - "2,3,6": 0.1319865211972339, - "2,3,7": 0.1416390738623666, - "2,4,5": 0.11225147779912656, - "2,4,6": 0.13541870267099865, - "2,4,7": 0.1378391147305702, - "2,5,6": 0.18554976725724268, - "2,5,7": 0.2704546405528336, - "2,6,7": 0.1600809618486485, - "3,4,5": 0.14144352289003886, - "3,4,6": 0.1340813423535399, - "3,4,7": 0.13293870282965073, - "3,5,6": 0.14773920751979544, - "3,5,7": 0.08924831734638426, - "3,6,7": 0.11447170433342578, - "4,5,6": 0.13700943322665282, - "4,5,7": 0.15074110273392488, - "4,6,7": 0.13788560329519034, - "5,6,7": 0.16210075280023983, - "0,1,2,3": -0.11822497173821267, - "0,1,2,4": -0.12304518503774103, - "0,1,2,5": -0.06504698146915541, - "0,1,2,6": -0.2002057249387622, - "0,1,2,7": -0.10810098794622919, - "0,1,3,4": -0.12895124005783193, - "0,1,3,5": -0.020805835760043398, - "0,1,3,6": -0.16140353610845914, - "0,1,3,7": -0.14088501790742258, - "0,1,4,5": -0.14968559500480985, - "0,1,4,6": -0.13012129916845214, - "0,1,4,7": -0.12219209010359672, - "0,1,5,6": 0.02362197895936105, - "0,1,5,7": -0.19388108743759058, - "0,1,6,7": 0.4386508676211726, - "0,2,3,4": -0.13159605170746208, - "0,2,3,5": -0.11275239679905864, - "0,2,3,6": -0.13473715074584292, - "0,2,3,7": -0.14062209592982117, - "0,2,4,5": -0.12065603984881174, - "0,2,4,6": -0.13505343600433892, - "0,2,4,7": -0.1322643917792511, - "0,2,5,6": -0.3076677394887908, - "0,2,5,7": -0.22659996553152528, - "0,2,6,7": -0.15313071068382605, - "0,3,4,5": -0.13241612967031272, - "0,3,4,6": -0.13400434235354453, - "0,3,4,7": -0.13229116625906442, - "0,3,5,6": -0.1567921196689218, - "0,3,5,7": -0.13278796111709099, - "0,3,6,7": -0.12305027051909559, - "0,4,5,6": -0.14223556366492884, - "0,4,5,7": -0.127512550706513, - "0,4,6,7": -0.09655541098724567, - "0,5,6,7": -0.2766514237470804, - "1,2,3,4": -0.13421631000188808, - "1,2,3,5": -0.12967765959643393, - "1,2,3,6": -0.1397631739510238, - "1,2,3,7": -0.12484043048326035, - "1,2,4,5": -0.12677336996190455, - "1,2,4,6": -0.13128846841251332, - "1,2,4,7": -0.1344051541789961, - "1,2,5,6": -0.11617617645110465, - "1,2,5,7": -0.12327609627271569, - "1,2,6,7": -0.16374165287057074, - "1,3,4,5": -0.12204720130813401, - "1,3,4,6": -0.13302646966855577, - "1,3,4,7": -0.13293870282965434, - "1,3,5,6": -0.1354370972148694, - "1,3,5,7": -0.12538750479688543, - "1,3,6,7": -0.1649774314103579, - "1,4,5,6": -0.1266131454150209, - "1,4,5,7": -0.14177653171808535, - "1,4,6,7": -0.12799689791981708, - "1,5,6,7": -0.1870654886142023, - "2,3,4,5": -0.14061971430003906, - "2,3,4,6": -0.133920342353546, - "2,3,4,7": -0.1328654696685528, - "2,3,5,6": -0.13433454225858213, - "2,3,5,7": -0.1580307152570812, - "2,3,6,7": -0.11865526109756497, - "2,4,5,6": -0.13488410182056423, - "2,4,5,7": -0.14497084865663917, - "2,4,6,7": -0.1265304429954226, - "2,5,6,7": -0.14455744873164295, - "3,4,5,6": -0.13410719955438793, - "3,4,5,7": -0.13705434485726517, - "3,4,6,7": -0.13192142902057302, - "3,5,6,7": -0.10058734456345143, - "4,5,6,7": -0.14614339108499483, - "0,1,2,3,4": 0.13273747666856445, - "0,1,2,3,5": 0.12806911091020154, - "0,1,2,3,6": 0.1481123952945052, - "0,1,2,3,7": 0.12523719799027863, - "0,1,2,4,5": 0.13255589629730313, - "0,1,2,4,6": 0.1291592017458555, - "0,1,2,4,7": 0.13695243622768183, - "0,1,2,5,6": 0.1814056766288186, - "0,1,2,5,7": 0.13915768772538728, - "0,1,2,6,7": 0.18520093681539318, - "0,1,3,4,5": 0.13524449280774206, - "0,1,3,4,6": 0.13484544264153525, - "0,1,3,4,7": 0.13219516625906969, - "0,1,3,5,6": 0.14308487229148575, - "0,1,3,5,7": 0.08216072198322205, - "0,1,3,6,7": 0.02196143145585222, - "0,1,4,5,6": 0.12143585921054428, - "0,1,4,5,7": 0.12987508141297427, - "0,1,4,6,7": 0.16533375377621357, - "0,1,5,6,7": -0.33276539791307463, - "0,2,3,4,5": 0.13975843798426035, - "0,2,3,4,6": 0.13392034235355715, - "0,2,3,4,7": 0.13247599347808633, - "0,2,3,5,6": 0.13787861630479736, - "0,2,3,5,7": 0.14652238169683135, - "0,2,3,6,7": 0.12282042120747255, - "0,2,4,5,6": 0.1374034004316771, - "0,2,4,5,7": 0.12822258243504475, - "0,2,4,6,7": 0.1403865659319431, - "0,2,5,6,7": 0.12656486055965002, - "0,3,4,5,6": 0.14095149490253306, - "0,3,4,5,7": 0.12606065231857772, - "0,3,4,6,7": 0.13230357431972656, - "0,3,5,6,7": 0.13731021900171858, - "0,4,5,6,7": 0.09469667518869768, - "1,2,3,4,5": 0.12623391166855039, - "1,2,3,4,6": 0.1328654696685641, - "1,2,3,4,7": 0.1328654696685586, - "1,2,3,5,6": 0.12693372607553538, - "1,2,3,5,7": 0.15078335999150194, - "1,2,3,6,7": 0.14757287134309716, - "1,2,4,5,6": 0.12965049693815034, - "1,2,4,5,7": 0.13220677429554417, - "1,2,4,6,7": 0.13226730345219867, - "1,2,5,6,7": 0.17506254976034546, - "1,3,4,5,6": 0.1341119158322554, - "1,3,4,5,7": 0.13435931109882487, - "1,3,4,6,7": 0.13192142902057824, - "1,3,5,6,7": 0.1860660728370776, - "1,4,5,6,7": 0.13581781416996605, - "2,3,4,5,6": 0.13198001550169153, - "2,3,4,5,7": 0.13332684466855044, - "2,3,4,6,7": 0.1328654696685646, - "2,3,5,6,7": 0.1410687103251415, - "2,4,5,6,7": 0.1298468517230811, - "3,4,5,6,7": 0.1350152558906608, - "0,1,2,3,4,5": -0.12537263535277213, - "0,1,2,3,4,6": -0.13286546966857887, - "0,1,2,3,4,7": -0.13247599347809833, - "0,1,2,3,5,6": -0.13657970292141103, - "0,1,2,3,5,7": -0.1411920828756003, - "0,1,2,3,6,7": -0.11777296991454883, - "0,1,2,4,5,6": -0.12996604554926586, - "0,1,2,4,5,7": -0.12314076307395139, - "0,1,2,4,6,7": -0.13791665781729592, - "0,1,2,5,6,7": -0.1303912873852709, - "0,1,3,4,5,6": -0.12920147075677363, - "0,1,3,4,5,7": -0.1340795442104752, - "0,1,3,4,6,7": -0.13220757431973545, - "0,1,3,5,6,7": -0.0008237786995950735, - "0,1,4,5,6,7": -0.15909762149654566, - "0,2,3,4,5,6": -0.13198001550170024, - "0,2,3,4,5,7": -0.13246556835277362, - "0,2,3,4,6,7": -0.13286546966857754, - "0,2,3,5,6,7": -0.13521431493265823, - "0,2,4,5,6,7": -0.13245373021515505, - "0,3,4,5,6,7": -0.12211083685624656, - "1,2,3,4,5,6": -0.13104612633523155, - "1,2,3,4,5,7": -0.13286546966856122, - "1,2,3,4,6,7": -0.13286546966857196, - "1,2,3,5,6,7": -0.14114180576658059, - "1,2,4,5,6,7": -0.13802949106874723, - "1,3,4,5,6,7": -0.13069230994472186, - "2,3,4,5,6,7": -0.1333268446685651, - "0,1,2,3,4,5,6": 0.13104612633524682, - "0,1,2,3,4,5,7": 0.13200419335279096, - "0,1,2,3,4,6,7": 0.13286546966859836, - "0,1,2,3,5,6,7": 0.10182565984042688, - "0,1,2,4,5,6,7": 0.13198985098939864, - "0,1,3,4,5,6,7": 0.1290677287481476, - "0,2,3,4,5,6,7": 0.13332684466857964, - "1,2,3,4,5,6,7": 0.13286546966856724, - "0,1,2,3,4,5,6,7": -0.13286546966859247 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=FSII_order=1.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=FSII_order=1.json deleted file mode 100644 index a802ac183..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=FSII_order=1.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.213739+00:00Z", - "metadata": { - "n_players": 8, - "index": "SV", - "max_order": 1, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.0591675062728614 - }, - "data": { - "0": 0.10605863454847463, - "1": 0.45608497147920496, - "2": 0.09080992287309618, - "3": 0.09464537610841778, - "4": 0.058867354268535066, - "5": 1.0203178690917096, - "6": 0.3096035459513322, - "7": 0.7221682390292563 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=FSII_order=2.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=FSII_order=2.json deleted file mode 100644 index 95223fa7b..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=FSII_order=2.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.218028+00:00Z", - "metadata": { - "n_players": 8, - "index": "FSII", - "max_order": 2, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.0591675062728614 - }, - "data": { - "0": -0.2950810185658439, - "1": 0.1292010849919509, - "2": 0.01609629442532757, - "3": 0.09496428883659024, - "4": 0.05382376173427252, - "5": 0.8329164830292368, - "6": -0.15552200157493, - "7": 0.4788124403637553, - "0,1": 0.19529811501438007, - "0,2": 0.07024265386590531, - "0,3": -0.0051424289751664685, - "0,4": 0.029984284871749797, - "0,5": 0.26547006518251726, - "0,6": 0.15340766268485745, - "0,7": 0.09301895358484737, - "1,2": -0.03661784793635175, - "1,3": -0.0011421396109517435, - "1,4": -0.0020948006894971295, - "1,5": 0.08522349646121774, - "1,6": 0.2002873637204847, - "1,7": 0.2128135860150963, - "2,3": -0.01747681562566696, - "2,4": -0.012455220918127249, - "2,5": 0.100524261785353, - "2,6": -0.0179958856095286, - "2,7": 0.06320611133410388, - "3,4": -0.006646844533492446, - "3,5": 0.08437243307722586, - "3,6": -0.014976739162347518, - "3,7": -0.03962529062594514, - "4,5": -0.0010068700890794946, - "4,6": -0.0037729051856163808, - "4,7": 0.006079541612478507, - "5,6": 0.15115114445092365, - "5,7": -0.310931758743474, - "6,7": 0.4621504541537678 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=FSII_order=3.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=FSII_order=3.json deleted file mode 100644 index aaac43758..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=FSII_order=3.json +++ /dev/null @@ -1,112 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.214254+00:00Z", - "metadata": { - "n_players": 8, - "index": "FSII", - "max_order": 3, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.0591675062728614 - }, - "data": { - "0": -0.16002923091666296, - "1": 0.31249140423939337, - "2": 0.0933523876852354, - "3": 0.17099649949358733, - "4": 0.10801268499009453, - "5": 0.8246031000201559, - "6": 0.024839843879524245, - "7": 0.5398737937777035, - "0,1": -0.10161604491661286, - "0,2": 0.018282257232327265, - "0,3": -0.10951626191590161, - "0,4": -0.04881821896585635, - "0,5": 0.3271794648229566, - "0,6": -0.15397077279498983, - "0,7": 0.060428158781287156, - "1,2": -0.115686277286252, - "1,3": -0.04861573327166979, - "1,4": -0.05690407867146947, - "1,5": 0.014978223107995, - "1,6": -0.11593818217637329, - "1,7": -0.022192047425260764, - "2,3": -0.0564410196118761, - "2,4": -0.04010717292170434, - "2,5": -0.011870577920155279, - "2,6": -0.07196945381941039, - "2,7": -0.036317056443958884, - "3,4": -0.05258765432860441, - "3,5": -0.0779981616912496, - "3,6": -0.0717249045256887, - "3,7": -0.03994735215033271, - "4,5": -0.023735438123368674, - "4,6": -0.04971496105503602, - "4,7": -0.04317882849164347, - "5,6": 0.1529886280069237, - "5,7": 0.04314093388005509, - "6,7": 0.15840967059384098, - "0,1,2": -0.00717115687931888, - "0,1,3": 0.032154109966479355, - "0,1,4": 0.03783428311426118, - "0,1,5": 0.07924630890689813, - "0,1,6": 0.2079060888621794, - "0,1,7": 0.2438586857394721, - "0,2,3": 0.025411395044632447, - "0,2,4": 0.018867535842275282, - "0,2,5": 0.028024428529171655, - "0,2,6": 0.07242454458432451, - "0,2,7": -0.03363595424486178, - "0,3,4": 0.01626086605788088, - "0,3,5": 0.1696094161378524, - "0,3,6": -0.003235390244349684, - "0,3,7": -0.031452730934695125, - "0,4,5": 0.03469258029932151, - "0,4,6": 0.0203767918523379, - "0,4,7": 0.029572950635441728, - "0,5,6": 0.012727332239401541, - "0,5,7": -0.4477188653797911, - "0,6,7": 0.3045575038554559, - "1,2,3": 0.012043807187005692, - "1,2,4": 0.01078631463059583, - "1,2,5": 0.11834593934465988, - "1,2,6": -0.03433541157821304, - "1,2,7": 0.05846736629315614, - "1,3,4": 0.014803762872836225, - "1,3,5": 0.05970077196248088, - "1,3,6": -0.0052786798562315385, - "1,3,7": -0.018476584806591742, - "1,4,5": 0.008221650953588937, - "1,4,6": 0.018040731463374732, - "1,4,7": 0.019931813200146507, - "1,5,6": 0.07743212579713804, - "1,5,7": -0.2024562501846422, - "1,6,7": 0.3686862366313911, - "2,3,4": 0.008558716772262387, - "2,3,5": -0.004900730271758913, - "2,3,6": 0.01614792268452392, - "2,3,7": 0.020667296281962094, - "2,4,5": -0.010617091660141173, - "2,4,6": 0.014335453854624619, - "2,4,7": 0.013372974468206927, - "2,5,6": -0.0034314458062936065, - "2,5,7": 0.09736857959405637, - "2,6,7": 0.04280607299697105, - "3,4,5": 0.024927763704477704, - "3,4,6": 0.01729340479326677, - "3,4,7": 0.010037105502345128, - "3,5,6": 0.0720520021066446, - "3,5,7": 0.0033519660279339933, - "3,6,7": 0.016517071046948162, - "4,5,6": -0.007765967064318188, - "4,5,7": -0.004001800735383532, - "4,6,7": 0.02960369706280898, - "5,6,7": -0.15468901446141392 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=FSII_order=4.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=FSII_order=4.json deleted file mode 100644 index ac5e09f87..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=FSII_order=4.json +++ /dev/null @@ -1,182 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.209294+00:00Z", - "metadata": { - "n_players": 8, - "index": "FSII", - "max_order": 4, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.0591675062728614 - }, - "data": { - "0": -0.11841746717735105, - "1": 0.3273536203725442, - "2": 0.11622571482416794, - "3": 0.1804959375704437, - "4": 0.1323483102200843, - "5": 0.8863358985202996, - "6": 0.06184863328141171, - "7": 0.5882194980821307, - "0,1": -0.10045378699721827, - "0,2": -0.03376958709966309, - "0,3": -0.13098436506048355, - "0,4": -0.081155063858422, - "0,5": 0.14093853767067066, - "0,6": -0.24061864503133432, - "0,7": -0.06132967002069978, - "1,2": -0.1052175382262556, - "1,3": -0.061034991578457806, - "1,4": -0.09439917809888054, - "1,5": -0.06280810072668191, - "1,6": -0.12395498093100439, - "1,7": -0.07645215664233615, - "2,3": -0.0931779116590275, - "2,4": -0.07687539794235537, - "2,5": -0.06966372602589632, - "2,6": -0.1324496672257014, - "2,7": -0.07743539694686924, - "3,4": -0.0851951257637396, - "3,5": -0.045750549260980024, - "3,6": -0.0851658531180993, - "3,7": -0.0695155473403723, - "4,5": -0.08739325068188472, - "4,6": -0.09299177403704242, - "4,7": -0.08906406401533773, - "5,6": -0.013134904263612914, - "5,7": -0.17829851479165715, - "6,7": 0.09229037749591006, - "0,1,2": -0.048970188910687926, - "0,1,3": 0.04449635381189934, - "0,1,4": 0.06270451507324204, - "0,1,5": 0.18272008464437672, - "0,1,6": 0.10288846941527563, - "0,1,7": 0.2441777960699899, - "0,2,3": 0.044978350387544774, - "0,2,4": 0.02966688561184104, - "0,2,5": 0.1202636477195982, - "0,2,6": 0.1904429067081444, - "0,2,7": 0.02779841318493967, - "0,3,4": 0.03544672801984963, - "0,3,5": 0.11043041316604031, - "0,3,6": 0.039191786779418356, - "0,3,7": 0.04154454901668847, - "0,4,5": 0.09387289568870796, - "0,4,6": 0.04855150795023014, - "0,4,7": 0.04904669936386424, - "0,5,6": 0.3280085398019685, - "0,5,7": -0.027509745212666692, - "0,6,7": 0.3389130208837721, - "1,2,3": 0.03646747866372017, - "1,2,4": 0.04043583478983819, - "1,2,5": 0.06716278734547414, - "1,2,6": -0.024258244643562618, - "1,2,7": 0.03495549581993797, - "1,3,4": 0.040013526532232585, - "1,3,5": -0.019604352417032372, - "1,3,6": 0.028125306234179574, - "1,3,7": 0.02754516605599308, - "1,4,5": 0.0577836025339949, - "1,4,6": 0.048930892635284634, - "1,4,7": 0.04722568127766504, - "1,5,6": 0.18540051598607724, - "1,5,7": 0.0559595274179797, - "1,6,7": 0.33144814619931284, - "2,3,4": 0.044400167099335405, - "2,3,5": 0.035229511363485934, - "2,3,6": 0.04578800826985858, - "2,3,7": 0.05474935264474538, - "2,4,5": 0.02366377946093461, - "2,4,6": 0.0500809011074626, - "2,4,7": 0.050897460920020496, - "2,5,6": 0.08974650475317701, - "2,5,7": 0.17768918875645204, - "2,6,7": 0.05854812682789904, - "3,4,5": 0.04829692755060597, - "3,4,6": 0.04138268698792589, - "3,4,7": 0.045378940693068706, - "3,5,6": 0.01804841107220965, - "3,5,7": -0.028897783530609414, - "3,6,7": 0.008164874278087403, - "4,5,6": 0.062028522803006025, - "4,5,7": 0.07810047090818042, - "4,6,7": 0.05729366486204426, - "5,6,7": 0.1437101994991069, - "0,1,2,3": -0.000687002600362141, - "0,1,2,4": -0.0005995220669400836, - "0,1,2,5": 0.07575457352851153, - "0,1,2,6": -0.027596153236838117, - "0,1,2,7": 0.03672616855839299, - "0,1,3,4": -0.0064241255881721596, - "0,1,3,5": 0.10635891822911595, - "0,1,3,6": -0.04942880626345745, - "0,1,3,7": -0.07450347147386636, - "0,1,4,5": -0.039330983763013194, - "0,1,4,6": -0.009457444364456266, - "0,1,4,7": 0.006071611835077942, - "0,1,5,6": -0.042139943432912, - "0,1,5,7": -0.30759011591653523, - "0,1,6,7": 0.33865758634451687, - "0,2,3,4": -0.006930488615779773, - "0,2,3,5": 0.009302688492717065, - "0,2,3,6": -0.01297402272213094, - "0,2,3,7": -0.027845085028458838, - "0,2,4,5": 0.006900507310629252, - "0,2,4,6": -0.012185587869108692, - "0,2,4,7": -0.008783608160421029, - "0,2,5,6": -0.16837547894369073, - "0,2,5,7": -0.10806072864851299, - "0,2,6,7": -0.014905481402931776, - "0,3,4,5": -0.0032623648900675373, - "0,3,4,6": -0.006376578365449165, - "0,3,4,7": -0.01537816660763322, - "0,3,5,6": 0.009075827141814631, - "0,3,5,7": -0.003117063043673988, - "0,3,6,7": -0.025150773854890562, - "0,4,5,6": -0.04507013819731828, - "0,4,5,7": -0.0375976510322871, - "0,4,6,7": 0.016740316467455607, - "0,5,6,7": -0.3840526817030912, - "1,2,3,4": -0.01657427417467494, - "1,2,3,5": -0.019301884519068196, - "1,2,3,6": -0.01308770967104464, - "1,2,3,7": 0.0008035279285878855, - "1,2,4,5": -0.009340830142962817, - "1,2,4,6": -0.018250444246933173, - "1,2,4,7": -0.014533969870427807, - "1,2,5,6": 0.03500320197363756, - "1,2,5,7": 0.020251242989163133, - "1,2,6,7": 0.003776771256955601, - "1,3,4,5": -0.001238468284747933, - "1,3,4,6": -0.011738228926660217, - "1,3,4,7": -0.014444430516546591, - "1,3,5,6": 0.042068791917414944, - "1,3,5,7": 0.03072289134245554, - "1,3,6,7": -0.03462201907947213, - "1,4,5,6": -0.019933438964058074, - "1,4,5,7": -0.029280181903350397, - "1,4,6,7": -0.002400765821205117, - "1,5,6,7": -0.2309353917167467, - "2,3,4,5": -0.019481645873657277, - "2,3,4,6": -0.014665110815510224, - "2,3,4,7": -0.014031381159967243, - "2,3,5,6": -0.02112089747613262, - "2,3,5,7": -0.02965874398734774, - "2,3,6,7": 0.002567569539059532, - "2,4,5,6": -0.017664755726661825, - "2,4,5,7": -0.028975017659831417, - "2,4,6,7": -0.008724996001953991, - "2,5,6,7": -0.014197971086293323, - "3,4,5,6": -0.0056624013795885525, - "3,4,5,7": -0.017093447225434162, - "3,4,6,7": -0.009736244979368092, - "3,5,6,7": 0.0836458619154359, - "4,5,6,7": -0.05125824533793326 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=FSII_order=5.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=FSII_order=5.json deleted file mode 100644 index 0f07ff3a4..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=FSII_order=5.json +++ /dev/null @@ -1,238 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.201594+00:00Z", - "metadata": { - "n_players": 8, - "index": "FSII", - "max_order": 5, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.0591675062728614 - }, - "data": { - "0": -0.11222334463278644, - "1": 0.33470028544845404, - "2": 0.12780535240593477, - "3": 0.19374058712034636, - "4": 0.14250622306015082, - "5": 0.8936203994188209, - "6": 0.06966283288126288, - "7": 0.5944784209131175, - "0,1": -0.10706024227005956, - "0,2": -0.06930888039683032, - "0,3": -0.16738294090120825, - "0,4": -0.11063550600532125, - "0,5": 0.134123469698699, - "0,6": -0.2498630604160993, - "0,7": -0.06112787176924617, - "1,2": -0.14199193926327403, - "1,3": -0.09918379279403833, - "1,4": -0.12299500507332711, - "1,5": -0.07501580007971295, - "1,6": -0.13951893286463835, - "1,7": -0.08548832130263781, - "2,3": -0.12065436141722893, - "2,4": -0.10840235280334415, - "2,5": -0.10127901365585937, - "2,6": -0.16779237558049484, - "2,7": -0.11075305272818503, - "3,4": -0.11863763112076302, - "3,5": -0.09225623357913966, - "3,6": -0.1298011984504394, - "3,7": -0.10780117690711404, - "4,5": -0.113800912865127, - "4,6": -0.12002659236393638, - "4,7": -0.11573410807851697, - "5,6": -0.02740021003314469, - "5,7": -0.18617182755919334, - "6,7": 0.08209293105198172, - "0,1,2": 0.014494837262304508, - "0,1,3": 0.0925182829361796, - "0,1,4": 0.10760157058451869, - "0,1,5": 0.1523632205187146, - "0,1,6": 0.08185154756955224, - "0,1,7": 0.19864566986105148, - "0,2,3": 0.08582899986083704, - "0,2,4": 0.08258661152982474, - "0,2,5": 0.1715319176391015, - "0,2,6": 0.2519645018300604, - "0,2,7": 0.07762678654888946, - "0,3,4": 0.08857125566397522, - "0,3,5": 0.1851254660468476, - "0,3,6": 0.10609855936101466, - "0,3,7": 0.08553280068776498, - "0,4,5": 0.1304788208930788, - "0,4,6": 0.0882530279324753, - "0,4,7": 0.08712192262814741, - "0,5,6": 0.30471149136533304, - "0,5,7": -0.07508946930637495, - "0,6,7": 0.29831684022325755, - "1,2,3": 0.07625385344115161, - "1,2,4": 0.08598508885755161, - "1,2,5": 0.11999784263744076, - "1,2,6": 0.0434281769607541, - "1,2,7": 0.09660297255940503, - "1,3,4": 0.08757965535784054, - "1,3,5": 0.056866926321541195, - "1,3,6": 0.10213977040658001, - "1,3,7": 0.08502420224620141, - "1,4,5": 0.09526748489519055, - "1,4,6": 0.0878572085079424, - "1,4,7": 0.09016548540978117, - "1,5,6": 0.17996548419993957, - "1,5,7": 0.034830502115618084, - "1,6,7": 0.31736846365040683, - "2,3,4": 0.09238057698291163, - "2,3,5": 0.07209920916959045, - "2,3,6": 0.08654953119168228, - "2,3,7": 0.09578874581762448, - "2,4,5": 0.07206129822726708, - "2,4,6": 0.09345691729333871, - "2,4,7": 0.09641713010375963, - "2,5,6": 0.1387874433984518, - "2,5,7": 0.223815296070046, - "2,6,7": 0.11424600727402047, - "3,4,5": 0.10148036105154187, - "3,4,6": 0.09373389662235025, - "3,4,7": 0.0921557781604767, - "3,5,6": 0.11291275886199695, - "3,5,7": 0.053569568359538466, - "3,6,7": 0.08098466724796159, - "4,5,6": 0.09414734302814688, - "4,5,7": 0.1079798505885776, - "4,6,7": 0.09413314596035069, - "5,6,7": 0.12480592619021533, - "0,1,2,3": -0.035981791334130805, - "0,1,2,4": -0.049119266593847286, - "0,1,2,5": 0.017493728676614806, - "0,1,2,6": -0.11812944994770927, - "0,1,2,7": -0.02683527798726479, - "0,1,3,4": -0.05332467872768288, - "0,1,3,5": 0.03591142264932773, - "0,1,3,6": -0.10885023825699487, - "0,1,3,7": -0.08654153934000715, - "0,1,4,5": -0.07059000871138509, - "0,1,4,6": -0.04670189394542786, - "0,1,4,7": -0.03952420707739288, - "0,1,5,6": 0.08452286821794054, - "0,1,5,7": -0.13262019670476785, - "0,1,6,7": 0.4973662556345126, - "0,2,3,4": -0.0565970114197038, - "0,2,3,5": -0.026944294579160713, - "0,2,3,6": -0.05258814890859597, - "0,2,3,7": -0.057659029057556536, - "0,2,4,5": -0.04825503814515249, - "0,2,4,6": -0.05782375500451395, - "0,2,4,7": -0.05676234861581571, - "0,2,5,6": -0.2232382099412406, - "0,2,5,7": -0.14278655014439431, - "0,2,6,7": -0.07135793778585565, - "0,3,4,5": -0.05934422065052952, - "0,3,4,6": -0.059803279673732196, - "0,3,4,7": -0.05721699558075276, - "0,3,5,6": -0.10291530296615736, - "0,3,5,7": -0.07692651284986413, - "0,3,6,7": -0.07292899011506965, - "0,4,5,6": -0.06258247786478918, - "0,4,5,7": -0.04841653597706398, - "0,4,6,7": -0.01471178476628994, - "0,5,6,7": -0.21762973321746396, - "1,2,3,4": -0.059224085135754265, - "1,2,3,5": -0.04255915272152892, - "1,2,3,6": -0.05639263452136978, - "1,2,3,7": -0.040359427953839566, - "1,2,4,5": -0.05314012552765284, - "1,2,4,6": -0.05291541179753427, - "1,2,4,7": -0.05746333752965696, - "1,2,5,6": -0.02928605110905131, - "1,2,5,7": -0.03670568732243063, - "1,2,6,7": -0.0793007532549339, - "1,3,4,5": -0.04707511382538937, - "1,3,4,6": -0.05701409529500931, - "1,3,4,7": -0.05575682259237851, - "1,3,5,6": -0.07843174872329922, - "1,3,5,7": -0.06610112682248954, - "1,3,6,7": -0.11152008813715097, - "1,4,5,6": -0.04390968993171238, - "1,4,5,7": -0.05933374965069526, - "1,4,6,7": -0.042895371148522224, - "1,5,6,7": -0.12346867736346889, - "2,3,4,5": -0.06583589454276839, - "2,3,4,6": -0.05759137560264206, - "2,3,4,7": -0.0563431125087269, - "2,3,5,6": -0.04729423649473974, - "2,3,5,7": -0.06968549552868247, - "2,3,6,7": -0.03563421601410646, - "2,4,5,6": -0.05793111763810693, - "2,4,5,7": -0.0692546534037079, - "2,4,6,7": -0.04765064282761344, - "2,5,6,7": -0.05746399946535812, - "3,4,5,6": -0.06054463312285411, - "3,4,5,7": -0.06212782155711351, - "3,4,6,7": -0.05753082614686897, - "3,5,6,7": -0.04550718712604242, - "4,5,6,7": -0.06450888845728936, - "0,1,2,3,4": 0.024219772557647547, - "0,1,2,3,5": 0.004870842841147062, - "0,1,2,3,6": 0.0331121598711628, - "0,1,2,3,7": 0.008386801860536326, - "0,1,2,4,5": 0.029916714247856933, - "0,1,2,4,6": 0.015620548681814738, - "0,1,2,4,7": 0.02728245331305584, - "0,1,2,5,6": 0.06130718967818814, - "0,1,2,5,7": 0.02042694288779725, - "0,1,2,6,7": 0.07102669463207036, - "0,1,3,4,5": 0.026721265315197647, - "0,1,3,4,6": 0.023746676488622012, - "0,1,3,4,7": 0.019113392384301042, - "0,1,3,5,6": 0.08735548466416874, - "0,1,3,5,7": 0.021947398577479196, - "0,1,3,6,7": -0.025371456874401663, - "0,1,4,5,6": -0.0018970236768628933, - "0,1,4,5,7": 0.0077770939731150734, - "0,1,4,6,7": 0.03701869726668717, - "0,1,5,6,7": -0.4000912737355918, - "0,2,3,4,5": 0.03181450301700668, - "0,2,3,4,6": 0.02226493306796383, - "0,2,3,4,7": 0.021033836871493877, - "0,2,3,5,6": 0.014726265376443004, - "0,2,3,5,7": 0.021082355370786177, - "0,2,3,6,7": 0.00912489411006695, - "0,2,4,5,6": 0.027164767864972905, - "0,2,4,5,7": 0.02141510572961232, - "0,2,4,6,7": 0.026226084619589696, - "0,2,5,6,7": 0.006527239218924938, - "0,3,4,5,6": 0.03546965403761888, - "0,3,4,5,7": 0.01815828939528947, - "0,3,4,6,7": 0.025372139094933473, - "0,3,5,6,7": 0.0864308561873213, - "0,4,5,6,7": -0.025712718887069066, - "1,2,3,4,5": 0.018431141132671802, - "1,2,3,4,6": 0.02155117525822757, - "1,2,3,4,7": 0.021097532924966342, - "1,2,3,5,6": 0.0011587445627406767, - "1,2,3,5,7": 0.022053808001363487, - "1,2,3,6,7": 0.030787769282486017, - "1,2,4,5,6": 0.016965099215426147, - "1,2,4,5,7": 0.02228563690499935, - "1,2,4,6,7": 0.015193112138602818, - "1,2,5,6,7": 0.04914747303908329, - "1,3,4,5,6": 0.024680453378916972, - "1,3,4,5,7": 0.02184043120333337, - "1,3,4,6,7": 0.020573427865801824, - "1,3,5,6,7": 0.12780639867560006, - "1,4,5,6,7": 0.008203973399886585, - "2,3,4,5,6": 0.02100359016589834, - "2,3,4,5,7": 0.021459262599960893, - "2,3,4,6,7": 0.021032830373212116, - "2,3,5,6,7": 0.01545807796934636, - "2,4,5,6,7": 0.015399266047880347, - "3,4,5,6,7": 0.028610765401871935 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=FSII_order=6.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=FSII_order=6.json deleted file mode 100644 index 0e881b395..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=FSII_order=6.json +++ /dev/null @@ -1,266 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.194173+00:00Z", - "metadata": { - "n_players": 8, - "index": "FSII", - "max_order": 6, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.0591675062728614 - }, - "data": { - "0": -0.1093463731986705, - "1": 0.33766033186136657, - "2": 0.13115994765133204, - "3": 0.19656337257635514, - "4": 0.1455567347975426, - "5": 0.8965806961089604, - "6": 0.07260246966788597, - "7": 0.5974248291241392, - "0,1": -0.11902829256597916, - "0,2": -0.08363220005736405, - "0,3": -0.17865530918109573, - "0,4": -0.12370743329718636, - "0,5": 0.1221594107122456, - "0,6": -0.2617134132750269, - "0,7": -0.07298694130337596, - "1,2": -0.1566038948330703, - "1,3": -0.11081636145562995, - "1,4": -0.1364187579580573, - "1,5": -0.08747281563961165, - "1,6": -0.1518527210075643, - "1,7": -0.09786258283507186, - "2,3": -0.13533930478371423, - "2,4": -0.12104432769739767, - "2,5": -0.11613836140655306, - "2,6": -0.18258258835082403, - "2,7": -0.12547915460823345, - "3,4": -0.13113890031511713, - "3,5": -0.10402586591461613, - "3,6": -0.14110531791530767, - "3,7": -0.11931983655262983, - "4,5": -0.12681638957816757, - "4,6": -0.13348596118483724, - "4,7": -0.12913569223530635, - "5,6": -0.03974124046058019, - "5,7": -0.19857416510933085, - "6,7": 0.06998270023697231, - "0,1,2": 0.04832198125892494, - "0,1,3": 0.11640724921011236, - "0,1,4": 0.1392758840597791, - "0,1,5": 0.17867093214656912, - "0,1,6": 0.10776385006659757, - "0,1,7": 0.2245879361126808, - "0,2,3": 0.12035919663609233, - "0,2,4": 0.11148262010526502, - "0,2,5": 0.2062057110445652, - "0,2,6": 0.2864322089474509, - "0,2,7": 0.11175841361062641, - "0,3,4": 0.11746447079801003, - "0,3,5": 0.20947493043391113, - "0,3,6": 0.12885461533104686, - "0,3,7": 0.10892805616598361, - "0,4,5": 0.16070494348593958, - "0,4,6": 0.12006865927468442, - "0,4,7": 0.11862361515851008, - "0,5,6": 0.33062991723760676, - "0,5,7": -0.04906816084997252, - "0,6,7": 0.3233516616181211, - "1,2,3": 0.11131040448559182, - "1,2,4": 0.11537814126461561, - "1,2,5": 0.15566263730478663, - "1,2,6": 0.07885356008658795, - "1,2,7": 0.13180342505788706, - "1,3,4": 0.11722039013225373, - "1,3,5": 0.08245786764054462, - "1,3,6": 0.12610397844217566, - "1,3,7": 0.10973875944042391, - "1,4,5": 0.12670577364170124, - "1,4,6": 0.12085168102939055, - "1,4,7": 0.12295716823697928, - "1,5,6": 0.20755670883346666, - "1,5,7": 0.0626357583238054, - "1,6,7": 0.3441539083408982, - "2,3,4": 0.12168287522604267, - "2,3,5": 0.10849610136730717, - "2,3,6": 0.12150901252297162, - "2,3,7": 0.13113253275984454, - "2,4,5": 0.1008860018054604, - "2,4,6": 0.12402712742640284, - "2,4,7": 0.12641850699704577, - "2,5,6": 0.17509879240898096, - "2,5,7": 0.25997463317289055, - "2,6,7": 0.1495748552885452, - "3,4,5": 0.13016659604570696, - "3,4,6": 0.122778316437164, - "3,4,7": 0.12160664451819722, - "3,5,6": 0.13737678178530605, - "3,5,7": 0.07885685921359917, - "3,6,7": 0.1040541471277187, - "4,5,6": 0.1257329410647734, - "4,5,7": 0.13943557808787405, - "4,6,7": 0.12655397939258228, - "5,6,7": 0.1517097293013306, - "0,1,2,3": -0.09248746098628317, - "0,1,2,4": -0.09456547535513743, - "0,1,2,5": -0.039389072607765425, - "0,1,2,6": -0.17446951779818654, - "0,1,2,7": -0.08227768410561043, - "0,1,3,4": -0.10073717847649788, - "0,1,3,5": 0.004586425540689443, - "0,1,3,6": -0.13593297693026984, - "0,1,3,7": -0.11532736219653095, - "0,1,4,5": -0.12155113501787626, - "0,1,4,6": -0.10190854092852725, - "0,1,4,7": -0.09389223522774665, - "0,1,5,6": 0.049012936401220605, - "0,1,5,7": -0.16840303326734415, - "0,1,6,7": 0.46420721999681286, - "0,2,3,4": -0.10299479745005806, - "0,2,3,5": -0.0869729432174888, - "0,2,3,6": -0.10887939925157286, - "0,2,3,7": -0.11467724740908776, - "0,2,4,5": -0.09213438750536115, - "0,2,4,6": -0.10645348535701186, - "0,2,4,7": -0.10357734403145659, - "0,2,5,6": -0.2818895900466699, - "0,2,5,7": -0.20073471889174097, - "0,2,6,7": -0.12718716580424244, - "0,3,4,5": -0.10416012496200167, - "0,3,4,6": -0.10567003972420473, - "0,3,4,7": -0.10386976666930275, - "0,3,5,6": -0.13127961772259455, - "0,3,5,7": -0.10718836208721585, - "0,3,6,7": -0.09737237366711482, - "0,4,5,6": -0.11398086279876635, - "0,4,5,7": -0.09917075268941722, - "0,4,6,7": -0.06813531476526746, - "0,5,6,7": -0.2510531285931705, - "1,2,3,4": -0.10565699887965702, - "1,2,3,5": -0.10394014895225777, - "1,2,3,6": -0.11394736596927489, - "1,2,3,7": -0.09893752561375244, - "1,2,4,5": -0.09829366017593813, - "1,2,4,6": -0.10273046093772573, - "1,2,4,7": -0.10576004972174008, - "1,2,5,6": -0.09043996995946964, - "1,2,5,7": -0.09745279270828178, - "1,2,6,7": -0.13784005164739585, - "1,3,4,5": -0.09383313901632304, - "1,3,4,6": -0.10473411007083007, - "1,3,4,7": -0.10455924638680902, - "1,3,5,6": -0.10996653808465581, - "1,3,5,7": -0.0998298487133028, - "1,3,6,7": -0.1393414780834263, - "1,4,5,6": -0.0984003870143137, - "1,4,5,7": -0.11347667628637177, - "1,4,6,7": -0.09961874489935549, - "1,5,6,7": -0.16150913643250278, - "2,3,4,5": -0.11201845949146785, - "2,3,4,6": -0.10524079017123607, - "2,3,4,7": -0.10409882017038027, - "2,3,5,6": -0.10847679096292584, - "2,3,5,7": -0.1320858665266837, - "2,3,6,7": -0.09263211508895414, - "2,4,5,6": -0.10628415113532462, - "2,4,5,7": -0.11628380049488929, - "2,4,6,7": -0.0977650971755682, - "2,5,6,7": -0.1186139041950872, - "3,4,5,6": -0.10577289631115191, - "3,4,5,7": -0.10863294420166128, - "3,4,6,7": -0.10342173113395567, - "3,5,6,7": -0.07490944741345462, - "4,5,6,7": -0.11772329435215899, - "0,1,2,3,4": 0.0752761359634383, - "0,1,2,3,5": 0.07766227183255235, - "0,1,2,3,6": 0.09750981143224766, - "0,1,2,3,7": 0.07441687222351116, - "0,1,2,4,5": 0.07529356010401597, - "0,1,2,4,6": 0.07170112006974438, - "0,1,2,4,7": 0.079276612477615, - "0,1,2,5,6": 0.13100209745918406, - "0,1,2,5,7": 0.08853636633858526, - "0,1,2,6,7": 0.13438387004246982, - "0,1,3,4,5": 0.07864627552940168, - "0,1,3,4,6": 0.07805148063368329, - "0,1,3,4,7": 0.07518346241698255, - "0,1,3,5,6": 0.09334541179750475, - "0,1,3,5,7": 0.03220351951767735, - "0,1,3,6,7": -0.028191515666527535, - "0,1,4,5,6": 0.06484090140281676, - "0,1,4,5,7": 0.07306238146017986, - "0,1,4,6,7": 0.10832530846129149, - "0,1,5,6,7": -0.38271934095087434, - "0,2,3,4,5": 0.0821922397342188, - "0,2,3,4,6": 0.07615839934189379, - "0,2,3,4,7": 0.07449630769396959, - "0,2,3,5,6": 0.08717117558642892, - "0,2,3,5,7": 0.09559719806860939, - "0,2,3,6,7": 0.07169949286767854, - "0,2,4,5,6": 0.07984046216275378, - "0,2,4,5,7": 0.07044190107100518, - "0,2,4,6,7": 0.08241013916585899, - "0,2,5,6,7": 0.0756429368322431, - "0,3,4,5,6": 0.08405267540683561, - "0,3,4,5,7": 0.0689440900094647, - "0,3,4,6,7": 0.0749912673460993, - "0,3,5,6,7": 0.0870524140889028, - "0,4,5,6,7": 0.03758337235533663, - "1,2,3,4,5": 0.06877257029129177, - "1,2,3,4,6": 0.07520838480011141, - "1,2,3,4,7": 0.07499064222576501, - "1,2,3,5,6": 0.07633114303318136, - "1,2,3,5,7": 0.09996303424317193, - "1,2,3,6,7": 0.09655680217994375, - "1,2,4,5,6": 0.07219241575725094, - "1,2,4,5,7": 0.0745309502284939, - "1,2,4,6,7": 0.07439573525669887, - "1,2,5,6,7": 0.12424548415960207, - "1,3,4,5,6": 0.07731795307396969, - "1,3,4,5,7": 0.0773476057400184, - "1,3,4,6,7": 0.07471398025392062, - "1,3,5,6,7": 0.13591312568107183, - "1,4,5,6,7": 0.07880936848545873, - "2,3,4,5,6": 0.07421807198837807, - "2,3,4,5,7": 0.07534715758599095, - "2,3,4,6,7": 0.0746900391682238, - "2,3,5,6,7": 0.08994778218703198, - "2,4,5,6,7": 0.07187042483495808, - "3,4,5,6,7": 0.07770294758147885, - "0,1,2,3,4,5": -0.029618948080534127, - "0,1,2,3,4,6": -0.036681143968531935, - "0,1,2,3,4,7": -0.03581263494458618, - "0,1,2,3,5,6": -0.05591528177075267, - "0,1,2,3,5,7": -0.060048628538041125, - "0,1,2,3,6,7": -0.03619887737372004, - "0,1,2,4,5,6": -0.034219529671687045, - "0,1,2,4,5,7": -0.026915213758252725, - "0,1,2,4,6,7": -0.041260469066732246, - "0,1,2,5,6,7": -0.04925500449252705, - "0,1,3,4,5,6": -0.03491601599639409, - "0,1,3,4,5,7": -0.039315056479889435, - "0,1,3,4,6,7": -0.03701244841801338, - "0,1,3,5,6,7": 0.07885144309100514, - "0,1,4,5,6,7": -0.06434030436184487, - "0,2,3,4,5,6": -0.03556500354662814, - "0,2,3,4,5,7": -0.035571521738010856, - "0,2,3,4,6,7": -0.035540784819779805, - "0,2,3,5,6,7": -0.053409535574282116, - "0,2,4,5,6,7": -0.035566855098939795, - "0,3,4,5,6,7": -0.02668502301342221, - "1,2,3,4,5,6": -0.03486180079186904, - "1,2,3,4,5,7": -0.036202109942514396, - "1,2,3,4,6,7": -0.0357714737936638, - "1,2,3,5,6,7": -0.05956771449296951, - "1,2,4,5,6,7": -0.041373302981954456, - "1,3,4,5,6,7": -0.03549718263626377, - "2,3,4,5,6,7": -0.03600215892109094 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=FSII_order=7.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=FSII_order=7.json deleted file mode 100644 index 5f11562fa..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=FSII_order=7.json +++ /dev/null @@ -1,274 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.200732+00:00Z", - "metadata": { - "n_players": 8, - "index": "FSII", - "max_order": 7, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.0591675062728614 - }, - "data": { - "0": -0.1088841468525086, - "1": 0.33812205842596055, - "2": 0.13162628355206685, - "3": 0.19702654602130193, - "4": 0.14605255342158385, - "5": 0.8970429219656721, - "6": 0.07306562761838342, - "7": 0.5978890237808114, - "0,1": -0.1217571004959016, - "0,2": -0.08639327419892451, - "0,3": -0.18139424550336525, - "0,4": -0.12667488640891914, - "0,5": 0.11942710802505785, - "0,6": -0.2644522415719587, - "0,7": -0.07573302724839792, - "1,2": -0.1593614732077207, - "1,3": -0.1135518025446284, - "1,4": -0.13938271570367938, - "1,5": -0.09020162345600623, - "1,6": -0.1545880531545351, - "1,7": -0.10060517297970235, - "2,3": -0.13810701180174093, - "2,4": -0.12404055102923751, - "2,5": -0.11889943496112218, - "2,6": -0.18535018680507553, - "2,7": -0.12825401099861705, - "3,4": -0.13411298668698396, - "3,5": -0.1067648021833239, - "3,6": -0.1438507784722969, - "3,7": -0.12207255538828574, - "4,5": -0.1297838419954467, - "4,6": -0.13645993883325153, - "4,7": -0.13211692791580631, - "5,6": -0.04248006831900213, - "5,7": -0.2013202506635719, - "6,7": 0.06723008981492479, - "0,1,2": 0.057339182063792224, - "0,1,3": 0.12533590038436548, - "0,1,4": 0.14911860149047204, - "0,1,5": 0.18757304948514072, - "0,1,6": 0.1166920668720794, - "0,1,7": 0.23354518482741052, - "0,2,3": 0.1294169121260355, - "0,2,4": 0.12145440164855467, - "0,2,5": 0.21523689221781633, - "0,2,6": 0.29548949000096303, - "0,2,7": 0.12084472706691882, - "0,3,4": 0.12734770315678548, - "0,3,5": 0.21841756250538788, - "0,3,6": 0.13782334678299818, - "0,3,7": 0.11792581960875739, - "0,4,5": 0.17056164158553622, - "0,4,6": 0.1299514573394514, - "0,4,7": 0.12853544526182886, - "0,5,6": 0.3395721146976963, - "0,5,7": -0.04009693114258628, - "0,6,7": 0.33234899068452356, - "1,2,3": 0.12035413866607439, - "1,2,4": 0.12533594171133217, - "1,2,5": 0.16467983770631617, - "1,2,6": 0.08789685966273528, - "1,2,7": 0.14087575706816424, - "1,3,4": 0.12708964126847744, - "1,3,5": 0.09138651901322038, - "1,3,6": 0.13505872858279958, - "1,3,7": 0.11872254184475363, - "1,4,5": 0.13654849099720429, - "1,4,6": 0.13072049784134301, - "1,4,7": 0.13285501721137158, - "1,5,6": 0.21648492545786274, - "1,5,7": 0.07159300742084751, - "1,6,7": 0.3531372561972596, - "2,3,4": 0.1316811903963226, - "2,3,5": 0.11755381640506579, - "2,3,6": 0.13059282687817514, - "2,3,7": 0.14024537929444508, - "2,4,5": 0.11085778278668018, - "2,4,6": 0.13402500853339866, - "2,4,7": 0.13644542022967995, - "2,5,6": 0.18415607282043203, - "2,5,7": 0.2690609462342105, - "2,6,7": 0.15868726764349908, - "3,4,5": 0.1400498281701722, - "3,4,6": 0.13268764807399347, - "3,4,7": 0.1315450083956169, - "3,5,6": 0.14634551312507338, - "3,5,7": 0.0878546229350976, - "3,6,7": 0.11307800973668802, - "4,5,6": 0.13561573879425012, - "4,5,7": 0.14934740839923896, - "4,6,7": 0.1364919090887038, - "5,6,7": 0.16070705871703958, - "0,1,2,3": -0.11357932539386431, - "0,1,2,4": -0.1183995381478747, - "0,1,2,5": -0.06040133467177165, - "0,1,2,6": -0.1955600780029853, - "0,1,2,7": -0.10345534084963438, - "0,1,3,4": -0.12430559286212389, - "0,1,3,5": -0.01616018887651964, - "0,1,3,6": -0.15675788899045562, - "0,1,3,7": -0.1362393708320696, - "0,1,4,5": -0.1450399477916382, - "0,1,4,6": -0.12547565172765912, - "0,1,4,7": -0.11754644287783667, - "0,1,5,6": 0.028267626345129943, - "0,1,5,7": -0.18923544064016012, - "0,1,6,7": 0.4432965154059696, - "0,2,3,4": -0.12695040505655858, - "0,2,3,5": -0.10810674997180424, - "0,2,3,6": -0.13009150436415368, - "0,2,3,7": -0.1359764493116634, - "0,2,4,5": -0.116010392559842, - "0,2,4,6": -0.13040778907574366, - "0,2,4,7": -0.12761874480097246, - "0,2,5,6": -0.30302209237764166, - "0,2,5,7": -0.22195431853435452, - "0,2,6,7": -0.14848506331527617, - "0,3,4,5": -0.12777048231434285, - "0,3,4,6": -0.1293586953675217, - "0,3,4,7": -0.1276455190806911, - "0,3,5,6": -0.1521464725426463, - "0,3,5,7": -0.12814231430845618, - "0,3,6,7": -0.11840462337365137, - "0,4,5,6": -0.13758991621531283, - "0,4,5,7": -0.12286690367196035, - "0,4,6,7": -0.09190976362829797, - "0,5,6,7": -0.2720057763075561, - "1,2,3,4": -0.12957066244423898, - "1,2,3,5": -0.12503201199389985, - "1,2,3,6": -0.13511752693103074, - "1,2,3,7": -0.12019478334527756, - "1,2,4,5": -0.12212772252230929, - "1,2,4,6": -0.12664282144917827, - "1,2,4,7": -0.12975950730200578, - "1,2,5,6": -0.11153052950268735, - "1,2,5,7": -0.1186304495258329, - "1,2,6,7": -0.15909600588845624, - "1,3,4,5": -0.11740155381300815, - "1,3,4,6": -0.12838082263979936, - "1,3,4,7": -0.12829305562359083, - "1,3,5,6": -0.13079145006907167, - "1,3,5,7": -0.12074185793052793, - "1,3,6,7": -0.1603317843213659, - "1,4,5,6": -0.12196749869674268, - "1,4,5,7": -0.13713088540136809, - "1,4,6,7": -0.12335125137901483, - "1,5,6,7": -0.1824198420288244, - "2,3,4,5": -0.1359740662395147, - "2,3,4,6": -0.12927469526537774, - "2,3,4,7": -0.12821982247390307, - "2,3,5,6": -0.1296888948423808, - "2,3,5,7": -0.15338506799342674, - "2,3,6,7": -0.11400961415739674, - "2,4,5,6": -0.13023845458591893, - "2,4,5,7": -0.14032520170151985, - "2,4,6,7": -0.12188479626300716, - "2,5,6,7": -0.13991180179218515, - "3,4,5,6": -0.12946155243082558, - "3,4,5,7": -0.13240869774011882, - "3,4,6,7": -0.12727578225891245, - "3,5,6,7": -0.09594169761489309, - "4,5,6,7": -0.1414977446381662, - "0,1,2,3,4": 0.11996194927272485, - "0,1,2,3,5": 0.11529358354265666, - "0,1,2,3,6": 0.13533686794801286, - "0,1,2,3,7": 0.11246167049288808, - "0,1,2,4,5": 0.11978036823884056, - "0,1,2,4,6": 0.11638367357343261, - "0,1,2,4,7": 0.1241769081647715, - "0,1,2,5,6": 0.16863014871461426, - "0,1,2,5,7": 0.12638215991569862, - "0,1,2,6,7": 0.1724254076222205, - "0,1,3,4,5": 0.12246896421484613, - "0,1,3,4,6": 0.12206991420723193, - "0,1,3,4,7": 0.11941963817928358, - "0,1,3,5,6": 0.13030934394514548, - "0,1,3,5,7": 0.06938519397247281, - "0,1,3,6,7": 0.009185902505781385, - "0,1,4,5,6": 0.10866033067116734, - "0,1,4,5,7": 0.11709955363215865, - "0,1,4,6,7": 0.15255822468767727, - "0,1,5,6,7": -0.3455409266510334, - "0,2,3,4,5": 0.12698290970878193, - "0,2,3,4,6": 0.12114481501972783, - "0,2,3,4,7": 0.11970046603872977, - "0,2,3,5,6": 0.12510308888475463, - "0,2,3,5,7": 0.13374685417045476, - "0,2,3,6,7": 0.11004489339115464, - "0,2,4,5,6": 0.12462787211744782, - "0,2,4,5,7": 0.11544705446473982, - "0,2,4,6,7": 0.1276110373611104, - "0,2,5,6,7": 0.1137893322525694, - "0,3,4,5,6": 0.12817596639545736, - "0,3,4,5,7": 0.11328512440201874, - "0,3,4,6,7": 0.11952804615551024, - "0,3,5,6,7": 0.12453469085368352, - "0,4,5,6,7": 0.08192114702915529, - "1,2,3,4,5": 0.11345838197468122, - "1,2,3,4,6": 0.12008994130310226, - "1,2,3,4,7": 0.1200899412281354, - "1,2,3,5,6": 0.11415819739669349, - "1,2,3,5,7": 0.13800783128733912, - "1,2,3,6,7": 0.13479734270144125, - "1,2,4,5,6": 0.11687496896640177, - "1,2,4,5,7": 0.11943124661699597, - "1,2,4,6,7": 0.11949177557024562, - "1,2,5,6,7": 0.1622870219685191, - "1,3,4,5,6": 0.12133638728782092, - "1,3,4,5,7": 0.1215837832417001, - "1,3,4,6,7": 0.11914590137612482, - "1,3,5,6,7": 0.1732905450520939, - "1,4,5,6,7": 0.12304228775796548, - "2,3,4,5,6": 0.11920448644135131, - "2,3,4,5,7": 0.12055131559442342, - "2,3,4,6,7": 0.12008994162599045, - "2,3,5,6,7": 0.1282931819649799, - "2,4,5,6,7": 0.11707132432535448, - "3,4,5,6,7": 0.12223972852682025, - "0,1,2,3,4,5": -0.09471136996787075, - "0,1,2,3,4,6": -0.10220420570720001, - "0,1,2,3,4,7": -0.1018147287498344, - "0,1,2,3,5,6": -0.10591843843169553, - "0,1,2,3,5,7": -0.11053081848384527, - "0,1,2,3,6,7": -0.08711170404171144, - "0,1,2,4,5,6": -0.09930478012088897, - "0,1,2,4,5,7": -0.09247949819969807, - "0,1,2,4,6,7": -0.10725539191537395, - "0,1,2,5,6,7": -0.09973002215795053, - "0,1,3,4,5,6": -0.09854020539623598, - "0,1,3,4,5,7": -0.10341827933184729, - "0,1,3,4,6,7": -0.10154630830285499, - "0,1,3,5,6,7": 0.029837487247704214, - "0,1,4,5,6,7": -0.12843635616432175, - "0,2,3,4,5,6": -0.10131875050906775, - "0,2,3,4,5,7": -0.10180430269305005, - "0,2,3,4,6,7": -0.1022042048438463, - "0,2,3,5,6,7": -0.10455304984963425, - "0,2,4,5,6,7": -0.10179246495273525, - "0,3,4,5,6,7": -0.09144957212942362, - "1,2,3,4,5,6": -0.10038485975699613, - "1,2,3,4,5,7": -0.10220420325383914, - "1,2,3,4,6,7": -0.10220420407199388, - "1,2,3,5,6,7": -0.11048054002056307, - "1,2,4,5,6,7": -0.10736822686170805, - "1,3,4,5,6,7": -0.10003104583502752, - "2,3,4,5,6,7": -0.10266557907854604, - "0,1,2,3,4,5,6": 0.0646133890660789, - "0,1,2,3,4,5,7": 0.06557145515805146, - "0,1,2,3,4,6,7": 0.06643273201323878, - "0,1,2,3,5,6,7": 0.0353929222133551, - "0,1,2,4,5,6,7": 0.06555711330609078, - "0,1,3,4,5,6,7": 0.06263499143698696, - "0,2,3,4,5,6,7": 0.06689410658207069, - "1,2,3,4,5,6,7": 0.06643273213204598 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=FSII_order=8.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=FSII_order=8.json deleted file mode 100644 index 1b8bc48db..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=FSII_order=8.json +++ /dev/null @@ -1,275 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.234320+00:00Z", - "metadata": { - "n_players": 8, - "index": "FSII", - "max_order": 8, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.0591675062728614 - }, - "data": { - "0": -0.10884543380428965, - "1": 0.3381607723826221, - "2": 0.13166499760483868, - "3": 0.19706525979585332, - "4": 0.14609126726934296, - "5": 0.8970816357877311, - "6": 0.07310434124375043, - "7": 0.5979277375863639, - "0,1": -0.12206681027787925, - "0,2": -0.08670298380159491, - "0,3": -0.18170395499816283, - "0,4": -0.12698459587501224, - "0,5": 0.11911739795062617, - "0,6": -0.2647619507945541, - "0,7": -0.07604273698785725, - "1,2": -0.15967118307019246, - "1,3": -0.11386151223973418, - "1,4": -0.13969242542991286, - "1,5": -0.09051133319315312, - "1,6": -0.1548977629956836, - "1,7": -0.10091488312500299, - "2,3": -0.1384167219663312, - "2,4": -0.12435026144716421, - "2,5": -0.11920914489816707, - "2,6": -0.1856598967307554, - "2,7": -0.1285637211147333, - "3,4": -0.13442269650898578, - "3,5": -0.10707451223352696, - "3,6": -0.14416048872448572, - "3,7": -0.1223822656210771, - "4,5": -0.13009355230950026, - "4,6": -0.13676964875506575, - "4,7": -0.13242663798013726, - "5,6": -0.042789777833821256, - "5,7": -0.20162996075017575, - "6,7": 0.06692037978255785, - "0,1,2": 0.058732876360369474, - "0,1,3": 0.1267295944447387, - "0,1,4": 0.15051229570086858, - "0,1,5": 0.18896674420813264, - "0,1,6": 0.11808576089589448, - "0,1,7": 0.23493887947482825, - "0,2,3": 0.1308106060561635, - "0,2,4": 0.12284809624659446, - "0,2,5": 0.21663058691168452, - "0,2,6": 0.2968831839674759, - "0,2,7": 0.1222384212308947, - "0,3,4": 0.12874139675621538, - "0,3,5": 0.21981125684984043, - "0,3,6": 0.13921704053340972, - "0,3,7": 0.11931951377973192, - "0,4,5": 0.17195533626471354, - "0,4,6": 0.1313451515840729, - "0,4,7": 0.12992913959332658, - "0,5,6": 0.3409658091337209, - "0,5,7": -0.03870323631813974, - "0,6,7": 0.3337426852459605, - "1,2,3": 0.12174783293411137, - "1,2,4": 0.12672963608692292, - "1,2,5": 0.16607353203343855, - "1,2,6": 0.08929055393788812, - "1,2,7": 0.14226945132454683, - "1,3,4": 0.1284833353453843, - "1,3,5": 0.09278021323027276, - "1,3,6": 0.13645242260064194, - "1,3,7": 0.12011623585929004, - "1,4,5": 0.13794218492002355, - "1,4,6": 0.13211419177343697, - "1,4,7": 0.13424871150827483, - "1,5,6": 0.2178786190932836, - "1,5,7": 0.07298670141473226, - "1,6,7": 0.3545309504114815, - "2,3,4": 0.1330748851573234, - "2,3,5": 0.11894751108972579, - "2,3,6": 0.1319865214718562, - "2,3,7": 0.14163907432578626, - "2,4,5": 0.11225147731306279, - "2,4,6": 0.13541870292401637, - "2,4,7": 0.1378391148576335, - "2,5,6": 0.1855497669855256, - "2,5,7": 0.2704546406233852, - "2,6,7": 0.16008096212224385, - "3,4,5": 0.1414435227151391, - "3,4,6": 0.13408134216917983, - "3,4,7": 0.13293870305117708, - "3,5,6": 0.14773920736722176, - "3,5,7": 0.08924831762137164, - "3,6,7": 0.11447170453131085, - "4,5,6": 0.1370094330190605, - "4,5,7": 0.15074110246144776, - "4,6,7": 0.13788560368360608, - "5,6,7": 0.1621007526165998, - "0,1,2,3": -0.11822497182579542, - "0,1,2,4": -0.12304518547904095, - "0,1,2,5": -0.0650469822111483, - "0,1,2,6": -0.20020572494834568, - "0,1,2,7": -0.10810098854064584, - "0,1,3,4": -0.1289512398094756, - "0,1,3,5": -0.020805836403012243, - "0,1,3,6": -0.16140353583040437, - "0,1,3,7": -0.14088501735715867, - "0,1,4,5": -0.14968559508619103, - "0,1,4,6": -0.1301212993452766, - "0,1,4,7": -0.12219209037360754, - "0,1,5,6": 0.0236219790672145, - "0,1,5,7": -0.19388108815565294, - "0,1,6,7": 0.43865086753348903, - "0,2,3,4": -0.13159605151520604, - "0,2,3,5": -0.11275239689076776, - "0,2,3,6": -0.1347371503470514, - "0,2,3,7": -0.14062209590053054, - "0,2,4,5": -0.12065603994648681, - "0,2,4,6": -0.1350534364206756, - "0,2,4,7": -0.13226439190338948, - "0,2,5,6": -0.3076677392416068, - "0,2,5,7": -0.22659996610548533, - "0,2,6,7": -0.15313071059489142, - "0,3,4,5": -0.13241612954161508, - "0,3,4,6": -0.134004341718773, - "0,3,4,7": -0.13229116567822521, - "0,3,5,6": -0.1567921194817541, - "0,3,5,7": -0.13278796127592973, - "0,3,6,7": -0.1230502700435745, - "0,4,5,6": -0.14223556437650237, - "0,4,5,7": -0.12751255078573717, - "0,4,6,7": -0.09655541153184419, - "0,5,6,7": -0.2766514238777472, - "1,2,3,4": -0.13421631000972467, - "1,2,3,5": -0.12967765998905692, - "1,2,3,6": -0.13976317413224806, - "1,2,3,7": -0.1248404303264786, - "1,2,4,5": -0.12677336938055248, - "1,2,4,6": -0.13128846863647953, - "1,2,4,7": -0.1344051544413052, - "1,2,5,6": -0.116176176228514, - "1,2,5,7": -0.12327609679401227, - "1,2,6,7": -0.16374165318756634, - "1,3,4,5": -0.12204720102153517, - "1,3,4,6": -0.13302646897493034, - "1,3,4,7": -0.13293870258756135, - "1,3,5,6": -0.1354370966746804, - "1,3,5,7": -0.12538750459251824, - "1,3,6,7": -0.16497743066067322, - "1,4,5,6": -0.12661314439498506, - "1,4,5,7": -0.1417765310875444, - "1,4,6,7": -0.12799689804522174, - "1,5,6,7": -0.18706548772782325, - "2,3,4,5": -0.14061971403702922, - "2,3,4,6": -0.13392034248214824, - "2,3,4,7": -0.13286547041210112, - "2,3,5,6": -0.13433454231208, - "2,3,5,7": -0.15803071618440534, - "2,3,6,7": -0.11865526201645386, - "2,4,5,6": -0.13488410143553478, - "2,4,5,7": -0.1449708481840594, - "2,4,6,7": -0.12653044359030022, - "2,5,6,7": -0.14455744868931553, - "3,4,5,6": -0.13410719918612285, - "3,4,5,7": -0.13705434519654522, - "3,4,6,7": -0.13192142943814186, - "3,5,6,7": -0.10058734468516467, - "4,5,6,7": -0.1461433910303372, - "0,1,2,3,4": 0.13273747704659897, - "0,1,2,3,5": 0.12806911162299292, - "0,1,2,3,6": 0.14811239553846342, - "0,1,2,3,7": 0.1252371976198638, - "0,1,2,4,5": 0.13255589627763814, - "0,1,2,4,6": 0.12915920240742437, - "0,1,2,4,7": 0.13695243683098487, - "0,1,2,5,6": 0.18140567630756116, - "0,1,2,5,7": 0.13915768890958652, - "0,1,2,6,7": 0.18520093708512686, - "0,1,3,4,5": 0.13524449322540472, - "0,1,3,4,6": 0.1348454426581534, - "0,1,3,4,7": 0.1321951659468443, - "0,1,3,5,6": 0.14308487253284258, - "0,1,3,5,7": 0.08216072206370045, - "0,1,3,6,7": 0.021961430994049735, - "0,1,4,5,6": 0.12143585921742264, - "0,1,4,5,7": 0.12987508128946545, - "0,1,4,6,7": 0.1653337547349435, - "0,1,5,6,7": -0.332765398203986, - "0,2,3,4,5": 0.13975843774165636, - "0,2,3,4,6": 0.13392034171428135, - "0,2,3,4,7": 0.13247599320548062, - "0,2,3,5,6": 0.1378786157256819, - "0,2,3,5,7": 0.14652238229348075, - "0,2,3,6,7": 0.12282042081675462, - "0,2,4,5,6": 0.13740340062405307, - "0,2,4,5,7": 0.12822258211603998, - "0,2,4,6,7": 0.14038656590453744, - "0,2,5,6,7": 0.1265648601296674, - "0,3,4,5,6": 0.14095149511977753, - "0,3,4,5,7": 0.12606065239155118, - "0,3,4,6,7": 0.132303573969878, - "0,3,5,6,7": 0.1373102189797256, - "0,4,5,6,7": 0.09469667600137578, - "1,2,3,4,5": 0.1262339113765854, - "1,2,3,4,6": 0.13286546949638495, - "1,2,3,4,7": 0.1328654696152599, - "1,2,3,5,6": 0.12693372629855476, - "1,2,3,5,7": 0.15078336047535296, - "1,2,3,6,7": 0.14757287133905989, - "1,2,4,5,6": 0.12965049629216852, - "1,2,4,5,7": 0.13220677396413255, - "1,2,4,6,7": 0.13226730424215255, - "1,2,5,6,7": 0.17506254998304777, - "1,3,4,5,6": 0.13411191466706004, - "1,3,4,5,7": 0.13435931073016938, - "1,3,4,6,7": 0.1319214284228939, - "1,3,5,6,7": 0.18606607154776264, - "1,4,5,6,7": 0.13581781313957675, - "2,3,4,5,6": 0.13198001501282752, - "2,3,4,5,7": 0.13332684549206492, - "2,3,4,6,7": 0.1328654704341982, - "2,3,5,6,7": 0.14106871150450795, - "2,4,5,6,7": 0.12984685156631315, - "3,4,5,6,7": 0.1350152564662297, - "0,1,2,3,4,5": -0.12537263561818396, - "0,1,2,3,4,6": -0.13286547034092738, - "0,1,2,3,4,7": -0.1324759933635469, - "0,1,2,3,5,6": -0.1365797031950543, - "0,1,2,3,5,7": -0.14119208313868864, - "0,1,2,3,6,7": -0.11777296985714392, - "0,1,2,4,5,6": -0.12996604521338173, - "0,1,2,4,5,7": -0.12314076275752955, - "0,1,2,4,6,7": -0.13791665873852013, - "0,1,2,5,6,7": -0.13039128717099385, - "0,1,3,4,5,6": -0.12920147140289676, - "0,1,3,4,5,7": -0.13407954415263862, - "0,1,3,4,6,7": -0.13220757492050234, - "0,1,3,5,6,7": -0.0008237782879292055, - "0,1,4,5,6,7": -0.15909762155708404, - "0,2,3,4,5,6": -0.13198001486345667, - "0,2,3,4,5,7": -0.13246556835152196, - "0,2,3,4,6,7": -0.13286546846300681, - "0,2,3,5,6,7": -0.1352143147941672, - "0,2,4,5,6,7": -0.13245372959827995, - "0,3,4,5,6,7": -0.12211083780190882, - "1,2,3,4,5,6": -0.13104612556292428, - "1,2,3,4,5,7": -0.1328654695738434, - "1,2,3,4,6,7": -0.13286546914811462, - "1,2,3,5,6,7": -0.14114180612869104, - "1,2,4,5,6,7": -0.138029491037861, - "1,3,4,5,6,7": -0.1306923086977108, - "2,3,4,5,6,7": -0.13332684556026972, - "0,1,2,3,4,5,6": 0.1310461267609408, - "0,1,2,3,4,5,7": 0.13200419299620197, - "0,1,2,3,4,6,7": 0.1328654695592992, - "0,1,2,3,5,6,7": 0.10182565947918482, - "0,1,2,4,5,6,7": 0.13198985035008526, - "0,1,3,4,5,6,7": 0.12906772941007488, - "0,2,3,4,5,6,7": 0.13332684378207782, - "1,2,3,4,5,6,7": 0.13286546939785765, - "0,1,2,3,4,5,6,7": -0.13286546911445724 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=Moebius_order=8.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=Moebius_order=8.json deleted file mode 100644 index e37ef5a78..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=Moebius_order=8.json +++ /dev/null @@ -1,276 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.185944+00:00Z", - "metadata": { - "n_players": 8, - "index": "Moebius", - "max_order": 8, - "min_order": 0, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.0591675062728614 - }, - "data": { - "Empty": 2.0591675062728614, - "0": -0.10884543348956854, - "1": 0.3381607721568125, - "2": 0.1316649973240529, - "3": 0.1970652598653171, - "4": 0.14609126722476073, - "5": 0.8970816357643576, - "6": 0.07310434137608102, - "7": 0.5979277376875611, - "0,1": -0.12206681015824206, - "0,2": -0.08670298366203322, - "0,3": -0.181703955276026, - "0,4": -0.12698459587453614, - "0,5": 0.11911739812668021, - "0,6": -0.2647619509115824, - "0,7": -0.07604273692330343, - "1,2": -0.15967118302478056, - "1,3": -0.1138615123304465, - "1,4": -0.13969242552095684, - "1,5": -0.09051133313695114, - "1,6": -0.1548977632322992, - "1,7": -0.10091488312971508, - "2,3": -0.13841672184278275, - "2,4": -0.12435026136768368, - "2,5": -0.11920914493947521, - "2,6": -0.18565989668305294, - "2,7": -0.12856372104796865, - "3,4": -0.13442269656660466, - "3,5": -0.10707451219166497, - "3,6": -0.1441604888198591, - "3,7": -0.12238226557331577, - "4,5": -0.13009355244659693, - "4,6": -0.1367696487218768, - "4,7": -0.13242663792493348, - "5,6": -0.042789777983376354, - "5,7": -0.201629960732439, - "6,7": 0.06692037980995513, - "0,1,2": 0.058732876052507876, - "0,1,3": 0.12672959459119637, - "0,1,4": 0.1505122956738103, - "0,1,5": 0.18896674365375032, - "0,1,6": 0.1180857610218482, - "0,1,7": 0.23493887916570877, - "0,2,3": 0.1308106061494252, - "0,2,4": 0.1228480959704692, - "0,2,5": 0.2166305865986362, - "0,2,6": 0.2968831839787336, - "0,2,7": 0.12223842093808202, - "0,3,4": 0.12874139725424505, - "0,3,5": 0.2198112567790802, - "0,3,6": 0.13921704097436693, - "0,3,7": 0.11931951408121799, - "0,4,5": 0.1719553360651429, - "0,4,6": 0.13134515131442503, - "0,4,7": 0.12992913950964136, - "0,5,6": 0.34096580898281736, - "0,5,7": -0.03870323675928544, - "0,6,7": 0.33374268512186545, - "1,2,3": 0.12174783294435887, - "1,2,4": 0.12672963614921118, - "1,2,5": 0.16607353195358998, - "1,2,6": 0.08929055396959695, - "1,2,7": 0.14226945119795698, - "1,3,4": 0.12848333562796022, - "1,3,5": 0.09278021311620943, - "1,3,6": 0.1364524229894739, - "1,3,7": 0.12011623621366008, - "1,4,5": 0.13794218542574477, - "1,4,6": 0.1321141920959472, - "1,4,7": 0.13424871155618145, - "1,5,6": 0.2178786196526854, - "1,5,7": 0.07298670143650998, - "1,6,7": 0.35453095064382456, - "2,3,4": 0.13307488504075993, - "2,3,5": 0.11894751097724443, - "2,3,6": 0.13198652119720933, - "2,3,7": 0.14163907386234964, - "2,4,5": 0.11225147779911504, - "2,4,6": 0.135418702670973, - "2,4,7": 0.13783911473054866, - "2,5,6": 0.18554976725723415, - "2,5,7": 0.27045464055282853, - "2,6,7": 0.16008096184863518, - "3,4,5": 0.1414435228900257, - "3,4,6": 0.1340813423535132, - "3,4,7": 0.1329387028296276, - "3,5,6": 0.14773920751978453, - "3,5,7": 0.08924831734637229, - "3,6,7": 0.11447170433340714, - "4,5,6": 0.13700943322664205, - "4,5,7": 0.15074110273391295, - "4,6,7": 0.1378856032951714, - "5,6,7": 0.1621007528002334, - "0,1,2,3": -0.11822497173818114, - "0,1,2,4": -0.12304518503771167, - "0,1,2,5": -0.06504698146914478, - "0,1,2,6": -0.20020572493873567, - "0,1,2,7": -0.10810098794620604, - "0,1,3,4": -0.12895124005780367, - "0,1,3,5": -0.020805835760028923, - "0,1,3,6": -0.1614035361084305, - "0,1,3,7": -0.14088501790739638, - "0,1,4,5": -0.14968559500479905, - "0,1,4,6": -0.1301212991684264, - "0,1,4,7": -0.12219209010356913, - "0,1,5,6": 0.02362197895937035, - "0,1,5,7": -0.19388108743757915, - "0,1,6,7": 0.43865086762119354, - "0,2,3,4": -0.1315960517074286, - "0,2,3,5": -0.11275239679903892, - "0,2,3,6": -0.13473715074580594, - "0,2,3,7": -0.14062209592979302, - "0,2,4,5": -0.12065603984879436, - "0,2,4,6": -0.13505343600430697, - "0,2,4,7": -0.1322643917792221, - "0,2,5,6": -0.30766773948877724, - "0,2,5,7": -0.22659996553150918, - "0,2,6,7": -0.15313071068380157, - "0,3,4,5": -0.1324161296702977, - "0,3,4,6": -0.134004342353514, - "0,3,4,7": -0.1322911662590358, - "0,3,5,6": -0.15679211966890572, - "0,3,5,7": -0.13278796111707036, - "0,3,6,7": -0.12305027051906725, - "0,4,5,6": -0.14223556366491774, - "0,4,5,7": -0.12751255070649625, - "0,4,6,7": -0.09655541098721976, - "0,5,6,7": -0.27665142374706786, - "1,2,3,4": -0.13421631000185563, - "1,2,3,5": -0.1296776595964162, - "1,2,3,6": -0.13976317395099525, - "1,2,3,7": -0.12484043048323779, - "1,2,4,5": -0.12677336996188782, - "1,2,4,6": -0.13128846841248398, - "1,2,4,7": -0.1344051541789737, - "1,2,5,6": -0.11617617645109357, - "1,2,5,7": -0.12327609627271086, - "1,2,6,7": -0.16374165287055664, - "1,3,4,5": -0.1220472013081153, - "1,3,4,6": -0.13302646966852594, - "1,3,4,7": -0.13293870282962805, - "1,3,5,6": -0.13543709721485309, - "1,3,5,7": -0.12538750479686955, - "1,3,6,7": -0.1649774314103336, - "1,4,5,6": -0.1266131454150048, - "1,4,5,7": -0.14177653171806925, - "1,4,6,7": -0.1279968979197914, - "1,5,6,7": -0.18706548861419137, - "2,3,4,5": -0.14061971430001874, - "2,3,4,6": -0.13392034235351158, - "2,3,4,7": -0.13286546966852208, - "2,3,5,6": -0.13433454225856378, - "2,3,5,7": -0.15803071525706525, - "2,3,6,7": -0.11865526109754088, - "2,4,5,6": -0.13488410182054622, - "2,4,5,7": -0.14497084865662346, - "2,4,6,7": -0.12653044299539618, - "2,5,6,7": -0.14455744873163523, - "3,4,5,6": -0.1341071995543679, - "3,4,5,7": -0.13705434485724233, - "3,4,6,7": -0.1319214290205415, - "3,5,6,7": -0.1005873445634351, - "4,5,6,7": -0.1461433910849781, - "0,1,2,3,4": 0.13273747666852342, - "0,1,2,3,5": 0.1280691109101726, - "0,1,2,3,6": 0.14811239529446674, - "0,1,2,3,7": 0.1252371979902387, - "0,1,2,4,5": 0.13255589629728348, - "0,1,2,4,6": 0.12915920174581852, - "0,1,2,4,7": 0.1369524362276433, - "0,1,2,5,6": 0.18140567662880347, - "0,1,2,5,7": 0.13915768772536863, - "0,1,2,6,7": 0.18520093681536487, - "0,1,3,4,5": 0.13524449280772188, - "0,1,3,4,6": 0.134845442641496, - "0,1,3,4,7": 0.13219516625903216, - "0,1,3,5,6": 0.14308487229146172, - "0,1,3,5,7": 0.0821607219831968, - "0,1,3,6,7": 0.021961431455816083, - "0,1,4,5,6": 0.12143585921052491, - "0,1,4,5,7": 0.129875081412953, - "0,1,4,6,7": 0.1653337537761792, - "0,1,5,6,7": -0.3327653979130947, - "0,2,3,4,5": 0.13975843798423204, - "0,2,3,4,6": 0.13392034235351424, - "0,2,3,4,7": 0.13247599347804773, - "0,2,3,5,6": 0.1378786163047665, - "0,2,3,5,7": 0.14652238169680132, - "0,2,3,6,7": 0.12282042120743242, - "0,2,4,5,6": 0.13740340043165622, - "0,2,4,5,7": 0.12822258243502338, - "0,2,4,6,7": 0.14038656593190524, - "0,2,5,6,7": 0.12656486055963656, - "0,3,4,5,6": 0.14095149490250858, - "0,3,4,5,7": 0.12606065231855146, - "0,3,4,6,7": 0.13230357431968542, - "0,3,5,6,7": 0.13731021900169438, - "0,4,5,6,7": 0.09469667518867819, - "1,2,3,4,5": 0.12623391166852205, - "1,2,3,4,6": 0.13286546966852253, - "1,2,3,4,7": 0.13286546966851853, - "1,2,3,5,6": 0.12693372607551145, - "1,2,3,5,7": 0.15078335999147674, - "1,2,3,6,7": 0.1475728713430695, - "1,2,4,5,6": 0.12965049693812958, - "1,2,4,5,7": 0.13220677429552463, - "1,2,4,6,7": 0.13226730345216442, - "1,2,5,6,7": 0.17506254976033464, - "1,3,4,5,6": 0.13411191583223037, - "1,3,4,5,7": 0.13435931109879817, - "1,3,4,6,7": 0.1319214290205406, - "1,3,5,6,7": 0.18606607283705223, - "1,4,5,6,7": 0.13581781416993843, - "2,3,4,5,6": 0.1319800155016586, - "2,3,4,5,7": 0.13332684466851852, - "2,3,4,6,7": 0.1328654696685203, - "2,3,5,6,7": 0.14106871032511714, - "2,4,5,6,7": 0.12984685172306065, - "3,4,5,6,7": 0.13501525589063545, - "0,1,2,3,4,5": -0.1253726353527318, - "0,1,2,3,4,6": -0.13286546966853185, - "0,1,2,3,4,7": -0.13247599347804728, - "0,1,2,3,5,6": -0.13657970292137644, - "0,1,2,3,5,7": -0.14119208287555596, - "0,1,2,3,6,7": -0.11777296991450248, - "0,1,2,4,5,6": -0.12996604554924218, - "0,1,2,4,5,7": -0.12314076307392519, - "0,1,2,4,6,7": -0.13791665781725504, - "0,1,2,5,6,7": -0.13039128738525196, - "0,1,3,4,5,6": -0.12920147075674127, - "0,1,3,4,5,7": -0.13407954421043744, - "0,1,3,4,6,7": -0.13220757431968178, - "0,1,3,5,6,7": -0.0008237786995666241, - "0,1,4,5,6,7": -0.1590976214965103, - "0,2,3,4,5,6": -0.13198001550166838, - "0,2,3,4,5,7": -0.13246556835274026, - "0,2,3,4,6,7": -0.13286546966852475, - "0,2,3,5,6,7": -0.13521431493263592, - "0,2,4,5,6,7": -0.13245373021512652, - "0,3,4,5,6,7": -0.12211083685621693, - "1,2,3,4,5,6": -0.1310461263351992, - "1,2,3,4,5,7": -0.13286546966853008, - "1,2,3,4,6,7": -0.13286546966853052, - "1,2,3,5,6,7": -0.1411418057665612, - "1,2,4,5,6,7": -0.13802949106871587, - "1,3,4,5,6,7": -0.1306923099446884, - "2,3,4,5,6,7": -0.13332684466852296, - "0,1,2,3,4,5,6": 0.13104612633518453, - "0,1,2,3,4,5,7": 0.13200419335275004, - "0,1,2,3,4,6,7": 0.13286546966853185, - "0,1,2,3,5,6,7": 0.10182565984038305, - "0,1,2,4,5,6,7": 0.13198985098938376, - "0,1,3,4,5,6,7": 0.12906772874812766, - "0,2,3,4,5,6,7": 0.1333268446685385, - "1,2,3,4,5,6,7": 0.1328654696685332, - "0,1,2,3,4,5,6,7": -0.13286546966846924 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=SII_order=1.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=SII_order=1.json deleted file mode 100644 index 7c7297d25..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=SII_order=1.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.210012+00:00Z", - "metadata": { - "n_players": 8, - "index": "SV", - "max_order": 1, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.0591675062728614 - }, - "data": { - "0": 0.10605863487361222, - "1": 0.4560849718043576, - "2": 0.09080992319832237, - "3": 0.09464537643356985, - "4": 0.05886735459376169, - "5": 1.0203178694168615, - "6": 0.3096035462765583, - "7": 0.7221682393544081 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=SII_order=2.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=SII_order=2.json deleted file mode 100644 index a407107a7..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=SII_order=2.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.214829+00:00Z", - "metadata": { - "n_players": 8, - "index": "SII", - "max_order": 2, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.0591675062728614 - }, - "data": { - "0": 0.10605863487361222, - "1": 0.4560849718043576, - "2": 0.09080992319832237, - "3": 0.09464537643356985, - "4": 0.05886735459376169, - "5": 1.0203178694168615, - "6": 0.3096035462765583, - "7": 0.7221682393544081, - "0,1": 0.19468289354989599, - "0,2": 0.06060139739057224, - "0,3": -0.009482998455274672, - "0,4": 0.02371228781494894, - "0,5": 0.2336212456514451, - "0,6": 0.13816526600962897, - "0,7": 0.07192431639910168, - "1,2": -0.035858249550746235, - "1,3": -0.0039985816517480455, - "1,4": -0.009249961872950907, - "1,5": 0.07141758038747215, - "1,6": 0.19811791692585534, - "1,7": 0.20293422264960825, - "2,3": -0.024589688316478564, - "2,4": -0.019437117846063612, - "2,5": 0.08989038615666356, - "2,6": -0.029072996459864275, - "2,7": 0.05536025333649608, - "3,4": -0.012925902164828473, - "3,5": 0.08895133192365945, - "3,6": -0.017981566299103635, - "3,7": -0.04533229491825885, - "4,5": -0.012495265070660677, - "4,6": -0.011894059701410775, - "4,7": -0.0024724977015875282, - "5,6": 0.12263009261927937, - "5,7": -0.34867621709528596, - "6,7": 0.45031216215507264 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=SII_order=3.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=SII_order=3.json deleted file mode 100644 index 34c3732b6..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=SII_order=3.json +++ /dev/null @@ -1,112 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.217447+00:00Z", - "metadata": { - "n_players": 8, - "index": "SII", - "max_order": 3, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.0591675062728614 - }, - "data": { - "0": 0.10605863487361222, - "1": 0.4560849718043576, - "2": 0.09080992319832237, - "3": 0.09464537643356985, - "4": 0.05886735459376169, - "5": 1.0203178694168615, - "6": 0.3096035462765583, - "7": 0.7221682393544081, - "0,1": 0.19468289354989599, - "0,2": 0.06060139739057224, - "0,3": -0.009482998455274672, - "0,4": 0.02371228781494894, - "0,5": 0.2336212456514451, - "0,6": 0.13816526600962897, - "0,7": 0.07192431639910168, - "1,2": -0.035858249550746235, - "1,3": -0.0039985816517480455, - "1,4": -0.009249961872950907, - "1,5": 0.07141758038747215, - "1,6": 0.19811791692585534, - "1,7": 0.20293422264960825, - "2,3": -0.024589688316478564, - "2,4": -0.019437117846063612, - "2,5": 0.08989038615666356, - "2,6": -0.029072996459864275, - "2,7": 0.05536025333649608, - "3,4": -0.012925902164828473, - "3,5": 0.08895133192365945, - "3,6": -0.017981566299103635, - "3,7": -0.04533229491825885, - "4,5": -0.012495265070660677, - "4,6": -0.011894059701410775, - "4,7": -0.0024724977015875282, - "5,6": 0.12263009261927937, - "5,7": -0.34867621709528596, - "6,7": 0.45031216215507264, - "0,1,2": 0.00783390233879977, - "0,1,3": 0.04371851500092805, - "0,1,4": 0.048795678279971555, - "0,1,5": 0.07339055091052527, - "0,1,6": 0.20412403905934629, - "0,1,7": 0.2346361604472158, - "0,2,3": 0.03539508881378195, - "0,2,4": 0.031624653188292995, - "0,2,5": 0.04032049557368067, - "0,2,6": 0.087001738267933, - "0,2,7": -0.021654350977262538, - "0,3,4": 0.029054639876514243, - "0,3,5": 0.1871025800344367, - "0,3,6": 0.012529654631661002, - "0,3,7": -0.020777787564201566, - "0,4,5": 0.04381290031323337, - "0,4,6": 0.030187631567375917, - "0,4,7": 0.039025294376352715, - "0,5,6": 0.008444430139532777, - "0,5,7": -0.4573950143422987, - "0,6,7": 0.29643586325689675, - "1,2,3": 0.021789597234625924, - "1,2,4": 0.021904151200918154, - "1,2,5": 0.130988782768224, - "1,2,6": -0.01838965460308084, - "1,2,7": 0.07307403882529373, - "1,3,4": 0.026360938898721376, - "1,3,5": 0.07758725462150984, - "1,3,6": 0.012064454041517791, - "1,3,7": -0.004805087276442022, - "1,4,5": 0.017535674475531504, - "1,4,6": 0.027677905603267328, - "1,4,7": 0.030463776829051548, - "1,5,6": 0.07711716275236558, - "1,5,7": -0.2062558641683805, - "1,6,7": 0.36645575327069035, - "2,3,4": 0.020220861671153445, - "2,3,5": 0.004198307481738439, - "2,3,6": 0.026114420404838024, - "2,3,7": 0.03069844623664486, - "2,4,5": 0.0011350907645677477, - "2,4,6": 0.024974356630452554, - "2,4,7": 0.024491147912299116, - "2,5,6": 0.008372268567729435, - "2,5,7": 0.10852745697894706, - "2,6,7": 0.05609462100061813, - "3,4,5": 0.03773462780079595, - "3,4,6": 0.029917940170674173, - "3,4,7": 0.021425794709981183, - "3,5,6": 0.09402984152221294, - "3,5,7": 0.022577820638191914, - "3,6,7": 0.03360163368201419, - "4,5,6": 0.0003598284254417994, - "4,5,7": 0.0036292446079446705, - "4,6,7": 0.038784041377891265, - "5,6,7": -0.15799023114295474 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=SII_order=4.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=SII_order=4.json deleted file mode 100644 index 344649c0a..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=SII_order=4.json +++ /dev/null @@ -1,182 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.202482+00:00Z", - "metadata": { - "n_players": 8, - "index": "SII", - "max_order": 4, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.0591675062728614 - }, - "data": { - "0": 0.10605863487361222, - "1": 0.4560849718043576, - "2": 0.09080992319832237, - "3": 0.09464537643356985, - "4": 0.05886735459376169, - "5": 1.0203178694168615, - "6": 0.3096035462765583, - "7": 0.7221682393544081, - "0,1": 0.19468289354989599, - "0,2": 0.06060139739057224, - "0,3": -0.009482998455274672, - "0,4": 0.02371228781494894, - "0,5": 0.2336212456514451, - "0,6": 0.13816526600962897, - "0,7": 0.07192431639910168, - "1,2": -0.035858249550746235, - "1,3": -0.0039985816517480455, - "1,4": -0.009249961872950907, - "1,5": 0.07141758038747215, - "1,6": 0.19811791692585534, - "1,7": 0.20293422264960825, - "2,3": -0.024589688316478564, - "2,4": -0.019437117846063612, - "2,5": 0.08989038615666356, - "2,6": -0.029072996459864275, - "2,7": 0.05536025333649608, - "3,4": -0.012925902164828473, - "3,5": 0.08895133192365945, - "3,6": -0.017981566299103635, - "3,7": -0.04533229491825885, - "4,5": -0.012495265070660677, - "4,6": -0.011894059701410775, - "4,7": -0.0024724977015875282, - "5,6": 0.12263009261927937, - "5,7": -0.34867621709528596, - "6,7": 0.45031216215507264, - "0,1,2": 0.00783390233879977, - "0,1,3": 0.04371851500092805, - "0,1,4": 0.048795678279971555, - "0,1,5": 0.07339055091052527, - "0,1,6": 0.20412403905934629, - "0,1,7": 0.2346361604472158, - "0,2,3": 0.03539508881378195, - "0,2,4": 0.031624653188292995, - "0,2,5": 0.04032049557368067, - "0,2,6": 0.087001738267933, - "0,2,7": -0.021654350977262538, - "0,3,4": 0.029054639876514243, - "0,3,5": 0.1871025800344367, - "0,3,6": 0.012529654631661002, - "0,3,7": -0.020777787564201566, - "0,4,5": 0.04381290031323337, - "0,4,6": 0.030187631567375917, - "0,4,7": 0.039025294376352715, - "0,5,6": 0.008444430139532777, - "0,5,7": -0.4573950143422987, - "0,6,7": 0.29643586325689675, - "1,2,3": 0.021789597234625924, - "1,2,4": 0.021904151200918154, - "1,2,5": 0.130988782768224, - "1,2,6": -0.01838965460308084, - "1,2,7": 0.07307403882529373, - "1,3,4": 0.026360938898721376, - "1,3,5": 0.07758725462150984, - "1,3,6": 0.012064454041517791, - "1,3,7": -0.004805087276442022, - "1,4,5": 0.017535674475531504, - "1,4,6": 0.027677905603267328, - "1,4,7": 0.030463776829051548, - "1,5,6": 0.07711716275236558, - "1,5,7": -0.2062558641683805, - "1,6,7": 0.36645575327069035, - "2,3,4": 0.020220861671153445, - "2,3,5": 0.004198307481738439, - "2,3,6": 0.026114420404838024, - "2,3,7": 0.03069844623664486, - "2,4,5": 0.0011350907645677477, - "2,4,6": 0.024974356630452554, - "2,4,7": 0.024491147912299116, - "2,5,6": 0.008372268567729435, - "2,5,7": 0.10852745697894706, - "2,6,7": 0.05609462100061813, - "3,4,5": 0.03773462780079595, - "3,4,6": 0.029917940170674173, - "3,4,7": 0.021425794709981183, - "3,5,6": 0.09402984152221294, - "3,5,7": 0.022577820638191914, - "3,6,7": 0.03360163368201419, - "4,5,6": 0.0003598284254417994, - "4,5,7": 0.0036292446079446705, - "4,6,7": 0.038784041377891265, - "5,6,7": -0.15799023114295474, - "0,1,2,3": -0.015370897677890016, - "0,1,2,4": -0.012518551728565419, - "0,1,2,5": 0.060976395621356816, - "0,1,2,6": -0.042238648007230206, - "0,1,2,7": 0.022308089447305446, - "0,1,3,4": -0.018834727872373613, - "0,1,3,5": 0.09797019143284291, - "0,1,3,6": -0.05675696847925893, - "0,1,3,7": -0.08225740459378661, - "0,1,4,5": -0.05262874269777773, - "0,1,4,6": -0.023816583682475634, - "0,1,4,7": -0.00807787264164106, - "0,1,5,6": -0.05157490399011866, - "0,1,5,7": -0.31709330244817646, - "0,1,6,7": 0.3298103498552941, - "0,2,3,4": -0.01908741256680735, - "0,2,3,5": -0.006261951214443506, - "0,2,3,6": -0.027604312840334377, - "0,2,3,7": -0.0426571172020237, - "0,2,4,5": -0.0046268073870888715, - "0,2,4,6": -0.024900497931271803, - "0,2,4,7": -0.021044834542031876, - "0,2,5,6": -0.18359580150344212, - "0,2,5,7": -0.12310524832245606, - "0,2,6,7": -0.029420266046397248, - "0,3,4,5": -0.015023818331530325, - "0,3,4,6": -0.018400745747310432, - "0,3,4,7": -0.027598836857490316, - "0,3,5,6": 0.0014272709896008262, - "0,3,5,7": -0.011240002873929678, - "0,3,6,7": -0.03181909719277598, - "0,4,5,6": -0.058477211838471876, - "0,4,5,7": -0.05084368259123451, - "0,4,6,7": 0.0028269564148253323, - "0,5,6,7": -0.39296600806248627, - "1,2,3,4": -0.02873998006611933, - "1,2,3,5": -0.035204611214716075, - "1,2,3,6": -0.02803387007398428, - "1,2,3,7": -0.0143984739116495, - "1,2,4,5": -0.021186691225521526, - "1,2,4,6": -0.0312616839809533, - "1,2,4,7": -0.02716562529595634, - "1,2,5,6": 0.019157244682845076, - "1,2,5,7": 0.004506989196513822, - "1,2,6,7": -0.011415530784028793, - "1,3,4,5": -0.013485452101485884, - "1,3,4,6": -0.024225709980197796, - "1,3,4,7": -0.027202513810381856, - "1,3,5,6": 0.03362761704291983, - "1,3,5,7": 0.02173323340535116, - "1,3,6,7": -0.042134843805583855, - "1,4,5,6": -0.03411359072169995, - "1,4,5,7": -0.0433733909610895, - "1,4,6,7": -0.01713908664724617, - "1,5,6,7": -0.24100298392961605, - "2,3,4,5": -0.03158476477580152, - "2,3,4,6": -0.02713494194289867, - "2,3,4,7": -0.026527785689136274, - "2,3,5,6": -0.036974013669223704, - "2,3,5,7": -0.04581631438877343, - "2,3,6,7": -0.012239382670768184, - "2,4,5,6": -0.03031049165441735, - "2,4,5,7": -0.04128978204199607, - "2,4,6,7": -0.021811087161429765, - "2,5,6,7": -0.030042924868499576, - "3,4,5,6": -0.01752694475714167, - "3,4,5,7": -0.02927720559360003, - "3,4,6,7": -0.021766448691522, - "3,5,6,7": 0.07573781930544021, - "4,5,6,7": -0.06511932443049451 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=SII_order=5.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=SII_order=5.json deleted file mode 100644 index 6e36f0076..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=SII_order=5.json +++ /dev/null @@ -1,238 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.208481+00:00Z", - "metadata": { - "n_players": 8, - "index": "SII", - "max_order": 5, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.0591675062728614 - }, - "data": { - "0": 0.10605863487361222, - "1": 0.4560849718043576, - "2": 0.09080992319832237, - "3": 0.09464537643356985, - "4": 0.05886735459376169, - "5": 1.0203178694168615, - "6": 0.3096035462765583, - "7": 0.7221682393544081, - "0,1": 0.19468289354989599, - "0,2": 0.06060139739057224, - "0,3": -0.009482998455274672, - "0,4": 0.02371228781494894, - "0,5": 0.2336212456514451, - "0,6": 0.13816526600962897, - "0,7": 0.07192431639910168, - "1,2": -0.035858249550746235, - "1,3": -0.0039985816517480455, - "1,4": -0.009249961872950907, - "1,5": 0.07141758038747215, - "1,6": 0.19811791692585534, - "1,7": 0.20293422264960825, - "2,3": -0.024589688316478564, - "2,4": -0.019437117846063612, - "2,5": 0.08989038615666356, - "2,6": -0.029072996459864275, - "2,7": 0.05536025333649608, - "3,4": -0.012925902164828473, - "3,5": 0.08895133192365945, - "3,6": -0.017981566299103635, - "3,7": -0.04533229491825885, - "4,5": -0.012495265070660677, - "4,6": -0.011894059701410775, - "4,7": -0.0024724977015875282, - "5,6": 0.12263009261927937, - "5,7": -0.34867621709528596, - "6,7": 0.45031216215507264, - "0,1,2": 0.00783390233879977, - "0,1,3": 0.04371851500092805, - "0,1,4": 0.048795678279971555, - "0,1,5": 0.07339055091052527, - "0,1,6": 0.20412403905934629, - "0,1,7": 0.2346361604472158, - "0,2,3": 0.03539508881378195, - "0,2,4": 0.031624653188292995, - "0,2,5": 0.04032049557368067, - "0,2,6": 0.087001738267933, - "0,2,7": -0.021654350977262538, - "0,3,4": 0.029054639876514243, - "0,3,5": 0.1871025800344367, - "0,3,6": 0.012529654631661002, - "0,3,7": -0.020777787564201566, - "0,4,5": 0.04381290031323337, - "0,4,6": 0.030187631567375917, - "0,4,7": 0.039025294376352715, - "0,5,6": 0.008444430139532777, - "0,5,7": -0.4573950143422987, - "0,6,7": 0.29643586325689675, - "1,2,3": 0.021789597234625924, - "1,2,4": 0.021904151200918154, - "1,2,5": 0.130988782768224, - "1,2,6": -0.01838965460308084, - "1,2,7": 0.07307403882529373, - "1,3,4": 0.026360938898721376, - "1,3,5": 0.07758725462150984, - "1,3,6": 0.012064454041517791, - "1,3,7": -0.004805087276442022, - "1,4,5": 0.017535674475531504, - "1,4,6": 0.027677905603267328, - "1,4,7": 0.030463776829051548, - "1,5,6": 0.07711716275236558, - "1,5,7": -0.2062558641683805, - "1,6,7": 0.36645575327069035, - "2,3,4": 0.020220861671153445, - "2,3,5": 0.004198307481738439, - "2,3,6": 0.026114420404838024, - "2,3,7": 0.03069844623664486, - "2,4,5": 0.0011350907645677477, - "2,4,6": 0.024974356630452554, - "2,4,7": 0.024491147912299116, - "2,5,6": 0.008372268567729435, - "2,5,7": 0.10852745697894706, - "2,6,7": 0.05609462100061813, - "3,4,5": 0.03773462780079595, - "3,4,6": 0.029917940170674173, - "3,4,7": 0.021425794709981183, - "3,5,6": 0.09402984152221294, - "3,5,7": 0.022577820638191914, - "3,6,7": 0.03360163368201419, - "4,5,6": 0.0003598284254417994, - "4,5,7": 0.0036292446079446705, - "4,6,7": 0.038784041377891265, - "5,6,7": -0.15799023114295474, - "0,1,2,3": -0.015370897677890016, - "0,1,2,4": -0.012518551728565419, - "0,1,2,5": 0.060976395621356816, - "0,1,2,6": -0.042238648007230206, - "0,1,2,7": 0.022308089447305446, - "0,1,3,4": -0.018834727872373613, - "0,1,3,5": 0.09797019143284291, - "0,1,3,6": -0.05675696847925893, - "0,1,3,7": -0.08225740459378661, - "0,1,4,5": -0.05262874269777773, - "0,1,4,6": -0.023816583682475634, - "0,1,4,7": -0.00807787264164106, - "0,1,5,6": -0.05157490399011866, - "0,1,5,7": -0.31709330244817646, - "0,1,6,7": 0.3298103498552941, - "0,2,3,4": -0.01908741256680735, - "0,2,3,5": -0.006261951214443506, - "0,2,3,6": -0.027604312840334377, - "0,2,3,7": -0.0426571172020237, - "0,2,4,5": -0.0046268073870888715, - "0,2,4,6": -0.024900497931271803, - "0,2,4,7": -0.021044834542031876, - "0,2,5,6": -0.18359580150344212, - "0,2,5,7": -0.12310524832245606, - "0,2,6,7": -0.029420266046397248, - "0,3,4,5": -0.015023818331530325, - "0,3,4,6": -0.018400745747310432, - "0,3,4,7": -0.027598836857490316, - "0,3,5,6": 0.0014272709896008262, - "0,3,5,7": -0.011240002873929678, - "0,3,6,7": -0.03181909719277598, - "0,4,5,6": -0.058477211838471876, - "0,4,5,7": -0.05084368259123451, - "0,4,6,7": 0.0028269564148253323, - "0,5,6,7": -0.39296600806248627, - "1,2,3,4": -0.02873998006611933, - "1,2,3,5": -0.035204611214716075, - "1,2,3,6": -0.02803387007398428, - "1,2,3,7": -0.0143984739116495, - "1,2,4,5": -0.021186691225521526, - "1,2,4,6": -0.0312616839809533, - "1,2,4,7": -0.02716562529595634, - "1,2,5,6": 0.019157244682845076, - "1,2,5,7": 0.004506989196513822, - "1,2,6,7": -0.011415530784028793, - "1,3,4,5": -0.013485452101485884, - "1,3,4,6": -0.024225709980197796, - "1,3,4,7": -0.027202513810381856, - "1,3,5,6": 0.03362761704291983, - "1,3,5,7": 0.02173323340535116, - "1,3,6,7": -0.042134843805583855, - "1,4,5,6": -0.03411359072169995, - "1,4,5,7": -0.0433733909610895, - "1,4,6,7": -0.01713908664724617, - "1,5,6,7": -0.24100298392961605, - "2,3,4,5": -0.03158476477580152, - "2,3,4,6": -0.02713494194289867, - "2,3,4,7": -0.026527785689136274, - "2,3,5,6": -0.036974013669223704, - "2,3,5,7": -0.04581631438877343, - "2,3,6,7": -0.012239382670768184, - "2,4,5,6": -0.03031049165441735, - "2,4,5,7": -0.04128978204199607, - "2,4,6,7": -0.021811087161429765, - "2,5,6,7": -0.030042924868499576, - "3,4,5,6": -0.01752694475714167, - "3,4,5,7": -0.02927720559360003, - "3,4,6,7": -0.021766448691522, - "3,5,6,7": 0.07573781930544021, - "4,5,6,7": -0.06511932443049451, - "0,1,2,3,4": 0.03613598978722554, - "0,1,2,3,5": 0.014905859427644552, - "0,1,2,3,6": 0.043199375239835414, - "0,1,2,3,7": 0.018532081726269967, - "0,1,2,4,5": 0.04177986378463472, - "0,1,2,4,6": 0.027535896808872584, - "0,1,2,4,7": 0.039255866296110886, - "0,1,2,5,6": 0.07134133700538459, - "0,1,2,5,7": 0.030519155035031664, - "0,1,2,6,7": 0.08117110533915617, - "0,1,3,4,5": 0.038407316375976164, - "0,1,3,4,6": 0.035484926102501424, - "0,1,3,4,7": 0.030909706760935185, - "0,1,3,5,6": 0.09721253366005334, - "0,1,3,5,7": 0.03186251232035575, - "0,1,3,6,7": -0.015404144675851716, - "0,1,4,5,6": 0.009788158249699475, - "0,1,4,5,7": 0.01952034063545005, - "0,1,4,6,7": 0.04881414267765405, - "0,1,5,6,7": -0.3901770292616058, - "0,2,3,4,5": 0.04375868241568415, - "0,2,3,4,6": 0.0342613110744423, - "0,2,3,4,7": 0.0330882795411902, - "0,2,3,5,6": 0.024841442491174925, - "0,2,3,5,7": 0.031255597153092785, - "0,2,3,6,7": 0.019350334591623275, - "0,2,4,5,6": 0.039108078045873684, - "0,2,4,5,7": 0.03341648053387103, - "0,2,4,6,7": 0.03827965810646128, - "0,2,5,6,7": 0.016699612042094136, - "0,3,4,5,6": 0.047235865845346225, - "0,3,4,5,7": 0.02998256578151315, - "0,3,4,6,7": 0.03724861417539582, - "0,3,5,6,7": 0.09642613075936679, - "0,4,5,6,7": -0.013889311710381325, - "1,2,3,4,5": 0.03034735835864799, - "1,2,3,4,6": 0.03351959130602067, - "1,2,3,4,7": 0.033124013407105135, - "1,2,3,5,6": 0.011245959761518876, - "1,2,3,5,7": 0.03219908770623947, - "1,2,3,6,7": 0.04098524764362477, - "1,2,4,5,6": 0.028880447042112678, - "1,2,4,5,7": 0.03425904964301507, - "1,2,4,6,7": 0.02721872353326127, - "1,2,5,6,7": 0.059291883732363715, - "1,3,4,5,6": 0.03641870314739726, - "1,3,4,5,7": 0.03363674569296138, - "1,3,4,6,7": 0.03242194066534654, - "1,3,5,6,7": 0.13777371096685842, - "1,4,5,6,7": 0.019999418633177113, - "2,3,4,5,6": 0.03299996838925656, - "2,3,4,5,7": 0.033513705136428484, - "2,3,4,6,7": 0.03313947158379671, - "2,3,5,6,7": 0.025683518283285967, - "2,4,5,6,7": 0.02745283977188029, - "3,4,5,6,7": 0.04048724043384189 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=SII_order=6.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=SII_order=6.json deleted file mode 100644 index b96705982..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=SII_order=6.json +++ /dev/null @@ -1,266 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.199879+00:00Z", - "metadata": { - "n_players": 8, - "index": "SII", - "max_order": 6, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.0591675062728614 - }, - "data": { - "0": 0.10605863487361222, - "1": 0.4560849718043576, - "2": 0.09080992319832237, - "3": 0.09464537643356985, - "4": 0.05886735459376169, - "5": 1.0203178694168615, - "6": 0.3096035462765583, - "7": 0.7221682393544081, - "0,1": 0.19468289354989599, - "0,2": 0.06060139739057224, - "0,3": -0.009482998455274672, - "0,4": 0.02371228781494894, - "0,5": 0.2336212456514451, - "0,6": 0.13816526600962897, - "0,7": 0.07192431639910168, - "1,2": -0.035858249550746235, - "1,3": -0.0039985816517480455, - "1,4": -0.009249961872950907, - "1,5": 0.07141758038747215, - "1,6": 0.19811791692585534, - "1,7": 0.20293422264960825, - "2,3": -0.024589688316478564, - "2,4": -0.019437117846063612, - "2,5": 0.08989038615666356, - "2,6": -0.029072996459864275, - "2,7": 0.05536025333649608, - "3,4": -0.012925902164828473, - "3,5": 0.08895133192365945, - "3,6": -0.017981566299103635, - "3,7": -0.04533229491825885, - "4,5": -0.012495265070660677, - "4,6": -0.011894059701410775, - "4,7": -0.0024724977015875282, - "5,6": 0.12263009261927937, - "5,7": -0.34867621709528596, - "6,7": 0.45031216215507264, - "0,1,2": 0.00783390233879977, - "0,1,3": 0.04371851500092805, - "0,1,4": 0.048795678279971555, - "0,1,5": 0.07339055091052527, - "0,1,6": 0.20412403905934629, - "0,1,7": 0.2346361604472158, - "0,2,3": 0.03539508881378195, - "0,2,4": 0.031624653188292995, - "0,2,5": 0.04032049557368067, - "0,2,6": 0.087001738267933, - "0,2,7": -0.021654350977262538, - "0,3,4": 0.029054639876514243, - "0,3,5": 0.1871025800344367, - "0,3,6": 0.012529654631661002, - "0,3,7": -0.020777787564201566, - "0,4,5": 0.04381290031323337, - "0,4,6": 0.030187631567375917, - "0,4,7": 0.039025294376352715, - "0,5,6": 0.008444430139532777, - "0,5,7": -0.4573950143422987, - "0,6,7": 0.29643586325689675, - "1,2,3": 0.021789597234625924, - "1,2,4": 0.021904151200918154, - "1,2,5": 0.130988782768224, - "1,2,6": -0.01838965460308084, - "1,2,7": 0.07307403882529373, - "1,3,4": 0.026360938898721376, - "1,3,5": 0.07758725462150984, - "1,3,6": 0.012064454041517791, - "1,3,7": -0.004805087276442022, - "1,4,5": 0.017535674475531504, - "1,4,6": 0.027677905603267328, - "1,4,7": 0.030463776829051548, - "1,5,6": 0.07711716275236558, - "1,5,7": -0.2062558641683805, - "1,6,7": 0.36645575327069035, - "2,3,4": 0.020220861671153445, - "2,3,5": 0.004198307481738439, - "2,3,6": 0.026114420404838024, - "2,3,7": 0.03069844623664486, - "2,4,5": 0.0011350907645677477, - "2,4,6": 0.024974356630452554, - "2,4,7": 0.024491147912299116, - "2,5,6": 0.008372268567729435, - "2,5,7": 0.10852745697894706, - "2,6,7": 0.05609462100061813, - "3,4,5": 0.03773462780079595, - "3,4,6": 0.029917940170674173, - "3,4,7": 0.021425794709981183, - "3,5,6": 0.09402984152221294, - "3,5,7": 0.022577820638191914, - "3,6,7": 0.03360163368201419, - "4,5,6": 0.0003598284254417994, - "4,5,7": 0.0036292446079446705, - "4,6,7": 0.038784041377891265, - "5,6,7": -0.15799023114295474, - "0,1,2,3": -0.015370897677890016, - "0,1,2,4": -0.012518551728565419, - "0,1,2,5": 0.060976395621356816, - "0,1,2,6": -0.042238648007230206, - "0,1,2,7": 0.022308089447305446, - "0,1,3,4": -0.018834727872373613, - "0,1,3,5": 0.09797019143284291, - "0,1,3,6": -0.05675696847925893, - "0,1,3,7": -0.08225740459378661, - "0,1,4,5": -0.05262874269777773, - "0,1,4,6": -0.023816583682475634, - "0,1,4,7": -0.00807787264164106, - "0,1,5,6": -0.05157490399011866, - "0,1,5,7": -0.31709330244817646, - "0,1,6,7": 0.3298103498552941, - "0,2,3,4": -0.01908741256680735, - "0,2,3,5": -0.006261951214443506, - "0,2,3,6": -0.027604312840334377, - "0,2,3,7": -0.0426571172020237, - "0,2,4,5": -0.0046268073870888715, - "0,2,4,6": -0.024900497931271803, - "0,2,4,7": -0.021044834542031876, - "0,2,5,6": -0.18359580150344212, - "0,2,5,7": -0.12310524832245606, - "0,2,6,7": -0.029420266046397248, - "0,3,4,5": -0.015023818331530325, - "0,3,4,6": -0.018400745747310432, - "0,3,4,7": -0.027598836857490316, - "0,3,5,6": 0.0014272709896008262, - "0,3,5,7": -0.011240002873929678, - "0,3,6,7": -0.03181909719277598, - "0,4,5,6": -0.058477211838471876, - "0,4,5,7": -0.05084368259123451, - "0,4,6,7": 0.0028269564148253323, - "0,5,6,7": -0.39296600806248627, - "1,2,3,4": -0.02873998006611933, - "1,2,3,5": -0.035204611214716075, - "1,2,3,6": -0.02803387007398428, - "1,2,3,7": -0.0143984739116495, - "1,2,4,5": -0.021186691225521526, - "1,2,4,6": -0.0312616839809533, - "1,2,4,7": -0.02716562529595634, - "1,2,5,6": 0.019157244682845076, - "1,2,5,7": 0.004506989196513822, - "1,2,6,7": -0.011415530784028793, - "1,3,4,5": -0.013485452101485884, - "1,3,4,6": -0.024225709980197796, - "1,3,4,7": -0.027202513810381856, - "1,3,5,6": 0.03362761704291983, - "1,3,5,7": 0.02173323340535116, - "1,3,6,7": -0.042134843805583855, - "1,4,5,6": -0.03411359072169995, - "1,4,5,7": -0.0433733909610895, - "1,4,6,7": -0.01713908664724617, - "1,5,6,7": -0.24100298392961605, - "2,3,4,5": -0.03158476477580152, - "2,3,4,6": -0.02713494194289867, - "2,3,4,7": -0.026527785689136274, - "2,3,5,6": -0.036974013669223704, - "2,3,5,7": -0.04581631438877343, - "2,3,6,7": -0.012239382670768184, - "2,4,5,6": -0.03031049165441735, - "2,4,5,7": -0.04128978204199607, - "2,4,6,7": -0.021811087161429765, - "2,5,6,7": -0.030042924868499576, - "3,4,5,6": -0.01752694475714167, - "3,4,5,7": -0.02927720559360003, - "3,4,6,7": -0.021766448691522, - "3,5,6,7": 0.07573781930544021, - "4,5,6,7": -0.06511932443049451, - "0,1,2,3,4": 0.03613598978722554, - "0,1,2,3,5": 0.014905859427644552, - "0,1,2,3,6": 0.043199375239835414, - "0,1,2,3,7": 0.018532081726269967, - "0,1,2,4,5": 0.04177986378463472, - "0,1,2,4,6": 0.027535896808872584, - "0,1,2,4,7": 0.039255866296110886, - "0,1,2,5,6": 0.07134133700538459, - "0,1,2,5,7": 0.030519155035031664, - "0,1,2,6,7": 0.08117110533915617, - "0,1,3,4,5": 0.038407316375976164, - "0,1,3,4,6": 0.035484926102501424, - "0,1,3,4,7": 0.030909706760935185, - "0,1,3,5,6": 0.09721253366005334, - "0,1,3,5,7": 0.03186251232035575, - "0,1,3,6,7": -0.015404144675851716, - "0,1,4,5,6": 0.009788158249699475, - "0,1,4,5,7": 0.01952034063545005, - "0,1,4,6,7": 0.04881414267765405, - "0,1,5,6,7": -0.3901770292616058, - "0,2,3,4,5": 0.04375868241568415, - "0,2,3,4,6": 0.0342613110744423, - "0,2,3,4,7": 0.0330882795411902, - "0,2,3,5,6": 0.024841442491174925, - "0,2,3,5,7": 0.031255597153092785, - "0,2,3,6,7": 0.019350334591623275, - "0,2,4,5,6": 0.039108078045873684, - "0,2,4,5,7": 0.03341648053387103, - "0,2,4,6,7": 0.03827965810646128, - "0,2,5,6,7": 0.016699612042094136, - "0,3,4,5,6": 0.047235865845346225, - "0,3,4,5,7": 0.02998256578151315, - "0,3,4,6,7": 0.03724861417539582, - "0,3,5,6,7": 0.09642613075936679, - "0,4,5,6,7": -0.013889311710381325, - "1,2,3,4,5": 0.03034735835864799, - "1,2,3,4,6": 0.03351959130602067, - "1,2,3,4,7": 0.033124013407105135, - "1,2,3,5,6": 0.011245959761518876, - "1,2,3,5,7": 0.03219908770623947, - "1,2,3,6,7": 0.04098524764362477, - "1,2,4,5,6": 0.028880447042112678, - "1,2,4,5,7": 0.03425904964301507, - "1,2,4,6,7": 0.02721872353326127, - "1,2,5,6,7": 0.059291883732363715, - "1,3,4,5,6": 0.03641870314739726, - "1,3,4,5,7": 0.03363674569296138, - "1,3,4,6,7": 0.03242194066534654, - "1,3,5,6,7": 0.13777371096685842, - "1,4,5,6,7": 0.019999418633177113, - "2,3,4,5,6": 0.03299996838925656, - "2,3,4,5,7": 0.033513705136428484, - "2,3,4,6,7": 0.03313947158379671, - "2,3,5,6,7": 0.025683518283285967, - "2,4,5,6,7": 0.02745283977188029, - "3,4,5,6,7": 0.04048724043384189, - "0,1,2,3,4,5": -0.038135965398280236, - "0,1,2,3,4,6": -0.04519816155617584, - "0,1,2,3,4,7": -0.04432965185692361, - "0,1,2,3,5,6": -0.06443229972309905, - "0,1,2,3,5,7": -0.06856564616851668, - "0,1,2,3,6,7": -0.04471589504955742, - "0,1,2,4,5,6": -0.04273654677647376, - "0,1,2,4,5,7": -0.03543223079238467, - "0,1,2,4,6,7": -0.04977748737781229, - "0,1,2,5,6,7": -0.057772021859887834, - "0,1,3,4,5,6": -0.04343303310460023, - "0,1,3,4,5,7": -0.047832073049533186, - "0,1,3,4,6,7": -0.045529465000880176, - "0,1,3,5,6,7": 0.07033442570516746, - "0,1,4,5,6,7": -0.0728573215172883, - "0,2,3,4,5,6": -0.044082019889319035, - "0,2,3,4,5,7": -0.04408853923161615, - "0,2,3,4,6,7": -0.04405780238950774, - "0,2,3,5,6,7": -0.061926552567677096, - "0,2,4,5,6,7": -0.04408387227569044, - "0,3,4,5,6,7": -0.03520204003740246, - "1,2,3,4,5,6": -0.04337881822283984, - "1,2,3,4,5,7": -0.04471912804740752, - "1,2,3,4,6,7": -0.04428848988950662, - "1,2,3,5,6,7": -0.06808473090161371, - "1,2,4,5,6,7": -0.04989032062928933, - "1,3,4,5,6,7": -0.044014200625874356, - "2,3,4,5,6,7": -0.04451917738950373 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=SII_order=7.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=SII_order=7.json deleted file mode 100644 index 11a39fe2d..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=SII_order=7.json +++ /dev/null @@ -1,274 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.195078+00:00Z", - "metadata": { - "n_players": 8, - "index": "SII", - "max_order": 7, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.0591675062728614 - }, - "data": { - "0": 0.10605863487361222, - "1": 0.4560849718043576, - "2": 0.09080992319832237, - "3": 0.09464537643356985, - "4": 0.05886735459376169, - "5": 1.0203178694168615, - "6": 0.3096035462765583, - "7": 0.7221682393544081, - "0,1": 0.19468289354989599, - "0,2": 0.06060139739057224, - "0,3": -0.009482998455274672, - "0,4": 0.02371228781494894, - "0,5": 0.2336212456514451, - "0,6": 0.13816526600962897, - "0,7": 0.07192431639910168, - "1,2": -0.035858249550746235, - "1,3": -0.0039985816517480455, - "1,4": -0.009249961872950907, - "1,5": 0.07141758038747215, - "1,6": 0.19811791692585534, - "1,7": 0.20293422264960825, - "2,3": -0.024589688316478564, - "2,4": -0.019437117846063612, - "2,5": 0.08989038615666356, - "2,6": -0.029072996459864275, - "2,7": 0.05536025333649608, - "3,4": -0.012925902164828473, - "3,5": 0.08895133192365945, - "3,6": -0.017981566299103635, - "3,7": -0.04533229491825885, - "4,5": -0.012495265070660677, - "4,6": -0.011894059701410775, - "4,7": -0.0024724977015875282, - "5,6": 0.12263009261927937, - "5,7": -0.34867621709528596, - "6,7": 0.45031216215507264, - "0,1,2": 0.00783390233879977, - "0,1,3": 0.04371851500092805, - "0,1,4": 0.048795678279971555, - "0,1,5": 0.07339055091052527, - "0,1,6": 0.20412403905934629, - "0,1,7": 0.2346361604472158, - "0,2,3": 0.03539508881378195, - "0,2,4": 0.031624653188292995, - "0,2,5": 0.04032049557368067, - "0,2,6": 0.087001738267933, - "0,2,7": -0.021654350977262538, - "0,3,4": 0.029054639876514243, - "0,3,5": 0.1871025800344367, - "0,3,6": 0.012529654631661002, - "0,3,7": -0.020777787564201566, - "0,4,5": 0.04381290031323337, - "0,4,6": 0.030187631567375917, - "0,4,7": 0.039025294376352715, - "0,5,6": 0.008444430139532777, - "0,5,7": -0.4573950143422987, - "0,6,7": 0.29643586325689675, - "1,2,3": 0.021789597234625924, - "1,2,4": 0.021904151200918154, - "1,2,5": 0.130988782768224, - "1,2,6": -0.01838965460308084, - "1,2,7": 0.07307403882529373, - "1,3,4": 0.026360938898721376, - "1,3,5": 0.07758725462150984, - "1,3,6": 0.012064454041517791, - "1,3,7": -0.004805087276442022, - "1,4,5": 0.017535674475531504, - "1,4,6": 0.027677905603267328, - "1,4,7": 0.030463776829051548, - "1,5,6": 0.07711716275236558, - "1,5,7": -0.2062558641683805, - "1,6,7": 0.36645575327069035, - "2,3,4": 0.020220861671153445, - "2,3,5": 0.004198307481738439, - "2,3,6": 0.026114420404838024, - "2,3,7": 0.03069844623664486, - "2,4,5": 0.0011350907645677477, - "2,4,6": 0.024974356630452554, - "2,4,7": 0.024491147912299116, - "2,5,6": 0.008372268567729435, - "2,5,7": 0.10852745697894706, - "2,6,7": 0.05609462100061813, - "3,4,5": 0.03773462780079595, - "3,4,6": 0.029917940170674173, - "3,4,7": 0.021425794709981183, - "3,5,6": 0.09402984152221294, - "3,5,7": 0.022577820638191914, - "3,6,7": 0.03360163368201419, - "4,5,6": 0.0003598284254417994, - "4,5,7": 0.0036292446079446705, - "4,6,7": 0.038784041377891265, - "5,6,7": -0.15799023114295474, - "0,1,2,3": -0.015370897677890016, - "0,1,2,4": -0.012518551728565419, - "0,1,2,5": 0.060976395621356816, - "0,1,2,6": -0.042238648007230206, - "0,1,2,7": 0.022308089447305446, - "0,1,3,4": -0.018834727872373613, - "0,1,3,5": 0.09797019143284291, - "0,1,3,6": -0.05675696847925893, - "0,1,3,7": -0.08225740459378661, - "0,1,4,5": -0.05262874269777773, - "0,1,4,6": -0.023816583682475634, - "0,1,4,7": -0.00807787264164106, - "0,1,5,6": -0.05157490399011866, - "0,1,5,7": -0.31709330244817646, - "0,1,6,7": 0.3298103498552941, - "0,2,3,4": -0.01908741256680735, - "0,2,3,5": -0.006261951214443506, - "0,2,3,6": -0.027604312840334377, - "0,2,3,7": -0.0426571172020237, - "0,2,4,5": -0.0046268073870888715, - "0,2,4,6": -0.024900497931271803, - "0,2,4,7": -0.021044834542031876, - "0,2,5,6": -0.18359580150344212, - "0,2,5,7": -0.12310524832245606, - "0,2,6,7": -0.029420266046397248, - "0,3,4,5": -0.015023818331530325, - "0,3,4,6": -0.018400745747310432, - "0,3,4,7": -0.027598836857490316, - "0,3,5,6": 0.0014272709896008262, - "0,3,5,7": -0.011240002873929678, - "0,3,6,7": -0.03181909719277598, - "0,4,5,6": -0.058477211838471876, - "0,4,5,7": -0.05084368259123451, - "0,4,6,7": 0.0028269564148253323, - "0,5,6,7": -0.39296600806248627, - "1,2,3,4": -0.02873998006611933, - "1,2,3,5": -0.035204611214716075, - "1,2,3,6": -0.02803387007398428, - "1,2,3,7": -0.0143984739116495, - "1,2,4,5": -0.021186691225521526, - "1,2,4,6": -0.0312616839809533, - "1,2,4,7": -0.02716562529595634, - "1,2,5,6": 0.019157244682845076, - "1,2,5,7": 0.004506989196513822, - "1,2,6,7": -0.011415530784028793, - "1,3,4,5": -0.013485452101485884, - "1,3,4,6": -0.024225709980197796, - "1,3,4,7": -0.027202513810381856, - "1,3,5,6": 0.03362761704291983, - "1,3,5,7": 0.02173323340535116, - "1,3,6,7": -0.042134843805583855, - "1,4,5,6": -0.03411359072169995, - "1,4,5,7": -0.0433733909610895, - "1,4,6,7": -0.01713908664724617, - "1,5,6,7": -0.24100298392961605, - "2,3,4,5": -0.03158476477580152, - "2,3,4,6": -0.02713494194289867, - "2,3,4,7": -0.026527785689136274, - "2,3,5,6": -0.036974013669223704, - "2,3,5,7": -0.04581631438877343, - "2,3,6,7": -0.012239382670768184, - "2,4,5,6": -0.03031049165441735, - "2,4,5,7": -0.04128978204199607, - "2,4,6,7": -0.021811087161429765, - "2,5,6,7": -0.030042924868499576, - "3,4,5,6": -0.01752694475714167, - "3,4,5,7": -0.02927720559360003, - "3,4,6,7": -0.021766448691522, - "3,5,6,7": 0.07573781930544021, - "4,5,6,7": -0.06511932443049451, - "0,1,2,3,4": 0.03613598978722554, - "0,1,2,3,5": 0.014905859427644552, - "0,1,2,3,6": 0.043199375239835414, - "0,1,2,3,7": 0.018532081726269967, - "0,1,2,4,5": 0.04177986378463472, - "0,1,2,4,6": 0.027535896808872584, - "0,1,2,4,7": 0.039255866296110886, - "0,1,2,5,6": 0.07134133700538459, - "0,1,2,5,7": 0.030519155035031664, - "0,1,2,6,7": 0.08117110533915617, - "0,1,3,4,5": 0.038407316375976164, - "0,1,3,4,6": 0.035484926102501424, - "0,1,3,4,7": 0.030909706760935185, - "0,1,3,5,6": 0.09721253366005334, - "0,1,3,5,7": 0.03186251232035575, - "0,1,3,6,7": -0.015404144675851716, - "0,1,4,5,6": 0.009788158249699475, - "0,1,4,5,7": 0.01952034063545005, - "0,1,4,6,7": 0.04881414267765405, - "0,1,5,6,7": -0.3901770292616058, - "0,2,3,4,5": 0.04375868241568415, - "0,2,3,4,6": 0.0342613110744423, - "0,2,3,4,7": 0.0330882795411902, - "0,2,3,5,6": 0.024841442491174925, - "0,2,3,5,7": 0.031255597153092785, - "0,2,3,6,7": 0.019350334591623275, - "0,2,4,5,6": 0.039108078045873684, - "0,2,4,5,7": 0.03341648053387103, - "0,2,4,6,7": 0.03827965810646128, - "0,2,5,6,7": 0.016699612042094136, - "0,3,4,5,6": 0.047235865845346225, - "0,3,4,5,7": 0.02998256578151315, - "0,3,4,6,7": 0.03724861417539582, - "0,3,5,6,7": 0.09642613075936679, - "0,4,5,6,7": -0.013889311710381325, - "1,2,3,4,5": 0.03034735835864799, - "1,2,3,4,6": 0.03351959130602067, - "1,2,3,4,7": 0.033124013407105135, - "1,2,3,5,6": 0.011245959761518876, - "1,2,3,5,7": 0.03219908770623947, - "1,2,3,6,7": 0.04098524764362477, - "1,2,4,5,6": 0.028880447042112678, - "1,2,4,5,7": 0.03425904964301507, - "1,2,4,6,7": 0.02721872353326127, - "1,2,5,6,7": 0.059291883732363715, - "1,3,4,5,6": 0.03641870314739726, - "1,3,4,5,7": 0.03363674569296138, - "1,3,4,6,7": 0.03242194066534654, - "1,3,5,6,7": 0.13777371096685842, - "1,4,5,6,7": 0.019999418633177113, - "2,3,4,5,6": 0.03299996838925656, - "2,3,4,5,7": 0.033513705136428484, - "2,3,4,6,7": 0.03313947158379671, - "2,3,5,6,7": 0.025683518283285967, - "2,4,5,6,7": 0.02745283977188029, - "3,4,5,6,7": 0.04048724043384189, - "0,1,2,3,4,5": -0.038135965398280236, - "0,1,2,3,4,6": -0.04519816155617584, - "0,1,2,3,4,7": -0.04432965185692361, - "0,1,2,3,5,6": -0.06443229972309905, - "0,1,2,3,5,7": -0.06856564616851668, - "0,1,2,3,6,7": -0.04471589504955742, - "0,1,2,4,5,6": -0.04273654677647376, - "0,1,2,4,5,7": -0.03543223079238467, - "0,1,2,4,6,7": -0.04977748737781229, - "0,1,2,5,6,7": -0.057772021859887834, - "0,1,3,4,5,6": -0.04343303310460023, - "0,1,3,4,5,7": -0.047832073049533186, - "0,1,3,4,6,7": -0.045529465000880176, - "0,1,3,5,6,7": 0.07033442570516746, - "0,1,4,5,6,7": -0.0728573215172883, - "0,2,3,4,5,6": -0.044082019889319035, - "0,2,3,4,5,7": -0.04408853923161615, - "0,2,3,4,6,7": -0.04405780238950774, - "0,2,3,5,6,7": -0.061926552567677096, - "0,2,4,5,6,7": -0.04408387227569044, - "0,3,4,5,6,7": -0.03520204003740246, - "1,2,3,4,5,6": -0.04337881822283984, - "1,2,3,4,5,7": -0.04471912804740752, - "1,2,3,4,6,7": -0.04428848988950662, - "1,2,3,5,6,7": -0.06808473090161371, - "1,2,4,5,6,7": -0.04989032062928933, - "1,3,4,5,6,7": -0.044014200625874356, - "2,3,4,5,6,7": -0.04451917738950373, - "0,1,2,3,4,5,6": 0.06461339150092416, - "0,1,2,3,4,5,7": 0.0655714585184648, - "0,1,2,3,4,6,7": 0.06643273483426215, - "0,1,2,3,5,6,7": 0.03539292500611646, - "0,1,2,4,5,6,7": 0.06555711615509408, - "0,1,3,4,5,6,7": 0.06263499391382821, - "0,2,3,4,5,6,7": 0.06689410983424837, - "1,2,3,4,5,6,7": 0.06643273483423906 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=SII_order=8.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=SII_order=8.json deleted file mode 100644 index 38837f121..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=SII_order=8.json +++ /dev/null @@ -1,275 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.227668+00:00Z", - "metadata": { - "n_players": 8, - "index": "SII", - "max_order": 8, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.0591675062728614 - }, - "data": { - "0": 0.10605863487361222, - "1": 0.4560849718043576, - "2": 0.09080992319832237, - "3": 0.09464537643356985, - "4": 0.05886735459376169, - "5": 1.0203178694168615, - "6": 0.3096035462765583, - "7": 0.7221682393544081, - "0,1": 0.19468289354989599, - "0,2": 0.06060139739057224, - "0,3": -0.009482998455274672, - "0,4": 0.02371228781494894, - "0,5": 0.2336212456514451, - "0,6": 0.13816526600962897, - "0,7": 0.07192431639910168, - "1,2": -0.035858249550746235, - "1,3": -0.0039985816517480455, - "1,4": -0.009249961872950907, - "1,5": 0.07141758038747215, - "1,6": 0.19811791692585534, - "1,7": 0.20293422264960825, - "2,3": -0.024589688316478564, - "2,4": -0.019437117846063612, - "2,5": 0.08989038615666356, - "2,6": -0.029072996459864275, - "2,7": 0.05536025333649608, - "3,4": -0.012925902164828473, - "3,5": 0.08895133192365945, - "3,6": -0.017981566299103635, - "3,7": -0.04533229491825885, - "4,5": -0.012495265070660677, - "4,6": -0.011894059701410775, - "4,7": -0.0024724977015875282, - "5,6": 0.12263009261927937, - "5,7": -0.34867621709528596, - "6,7": 0.45031216215507264, - "0,1,2": 0.00783390233879977, - "0,1,3": 0.04371851500092805, - "0,1,4": 0.048795678279971555, - "0,1,5": 0.07339055091052527, - "0,1,6": 0.20412403905934629, - "0,1,7": 0.2346361604472158, - "0,2,3": 0.03539508881378195, - "0,2,4": 0.031624653188292995, - "0,2,5": 0.04032049557368067, - "0,2,6": 0.087001738267933, - "0,2,7": -0.021654350977262538, - "0,3,4": 0.029054639876514243, - "0,3,5": 0.1871025800344367, - "0,3,6": 0.012529654631661002, - "0,3,7": -0.020777787564201566, - "0,4,5": 0.04381290031323337, - "0,4,6": 0.030187631567375917, - "0,4,7": 0.039025294376352715, - "0,5,6": 0.008444430139532777, - "0,5,7": -0.4573950143422987, - "0,6,7": 0.29643586325689675, - "1,2,3": 0.021789597234625924, - "1,2,4": 0.021904151200918154, - "1,2,5": 0.130988782768224, - "1,2,6": -0.01838965460308084, - "1,2,7": 0.07307403882529373, - "1,3,4": 0.026360938898721376, - "1,3,5": 0.07758725462150984, - "1,3,6": 0.012064454041517791, - "1,3,7": -0.004805087276442022, - "1,4,5": 0.017535674475531504, - "1,4,6": 0.027677905603267328, - "1,4,7": 0.030463776829051548, - "1,5,6": 0.07711716275236558, - "1,5,7": -0.2062558641683805, - "1,6,7": 0.36645575327069035, - "2,3,4": 0.020220861671153445, - "2,3,5": 0.004198307481738439, - "2,3,6": 0.026114420404838024, - "2,3,7": 0.03069844623664486, - "2,4,5": 0.0011350907645677477, - "2,4,6": 0.024974356630452554, - "2,4,7": 0.024491147912299116, - "2,5,6": 0.008372268567729435, - "2,5,7": 0.10852745697894706, - "2,6,7": 0.05609462100061813, - "3,4,5": 0.03773462780079595, - "3,4,6": 0.029917940170674173, - "3,4,7": 0.021425794709981183, - "3,5,6": 0.09402984152221294, - "3,5,7": 0.022577820638191914, - "3,6,7": 0.03360163368201419, - "4,5,6": 0.0003598284254417994, - "4,5,7": 0.0036292446079446705, - "4,6,7": 0.038784041377891265, - "5,6,7": -0.15799023114295474, - "0,1,2,3": -0.015370897677890016, - "0,1,2,4": -0.012518551728565419, - "0,1,2,5": 0.060976395621356816, - "0,1,2,6": -0.042238648007230206, - "0,1,2,7": 0.022308089447305446, - "0,1,3,4": -0.018834727872373613, - "0,1,3,5": 0.09797019143284291, - "0,1,3,6": -0.05675696847925893, - "0,1,3,7": -0.08225740459378661, - "0,1,4,5": -0.05262874269777773, - "0,1,4,6": -0.023816583682475634, - "0,1,4,7": -0.00807787264164106, - "0,1,5,6": -0.05157490399011866, - "0,1,5,7": -0.31709330244817646, - "0,1,6,7": 0.3298103498552941, - "0,2,3,4": -0.01908741256680735, - "0,2,3,5": -0.006261951214443506, - "0,2,3,6": -0.027604312840334377, - "0,2,3,7": -0.0426571172020237, - "0,2,4,5": -0.0046268073870888715, - "0,2,4,6": -0.024900497931271803, - "0,2,4,7": -0.021044834542031876, - "0,2,5,6": -0.18359580150344212, - "0,2,5,7": -0.12310524832245606, - "0,2,6,7": -0.029420266046397248, - "0,3,4,5": -0.015023818331530325, - "0,3,4,6": -0.018400745747310432, - "0,3,4,7": -0.027598836857490316, - "0,3,5,6": 0.0014272709896008262, - "0,3,5,7": -0.011240002873929678, - "0,3,6,7": -0.03181909719277598, - "0,4,5,6": -0.058477211838471876, - "0,4,5,7": -0.05084368259123451, - "0,4,6,7": 0.0028269564148253323, - "0,5,6,7": -0.39296600806248627, - "1,2,3,4": -0.02873998006611933, - "1,2,3,5": -0.035204611214716075, - "1,2,3,6": -0.02803387007398428, - "1,2,3,7": -0.0143984739116495, - "1,2,4,5": -0.021186691225521526, - "1,2,4,6": -0.0312616839809533, - "1,2,4,7": -0.02716562529595634, - "1,2,5,6": 0.019157244682845076, - "1,2,5,7": 0.004506989196513822, - "1,2,6,7": -0.011415530784028793, - "1,3,4,5": -0.013485452101485884, - "1,3,4,6": -0.024225709980197796, - "1,3,4,7": -0.027202513810381856, - "1,3,5,6": 0.03362761704291983, - "1,3,5,7": 0.02173323340535116, - "1,3,6,7": -0.042134843805583855, - "1,4,5,6": -0.03411359072169995, - "1,4,5,7": -0.0433733909610895, - "1,4,6,7": -0.01713908664724617, - "1,5,6,7": -0.24100298392961605, - "2,3,4,5": -0.03158476477580152, - "2,3,4,6": -0.02713494194289867, - "2,3,4,7": -0.026527785689136274, - "2,3,5,6": -0.036974013669223704, - "2,3,5,7": -0.04581631438877343, - "2,3,6,7": -0.012239382670768184, - "2,4,5,6": -0.03031049165441735, - "2,4,5,7": -0.04128978204199607, - "2,4,6,7": -0.021811087161429765, - "2,5,6,7": -0.030042924868499576, - "3,4,5,6": -0.01752694475714167, - "3,4,5,7": -0.02927720559360003, - "3,4,6,7": -0.021766448691522, - "3,5,6,7": 0.07573781930544021, - "4,5,6,7": -0.06511932443049451, - "0,1,2,3,4": 0.03613598978722554, - "0,1,2,3,5": 0.014905859427644552, - "0,1,2,3,6": 0.043199375239835414, - "0,1,2,3,7": 0.018532081726269967, - "0,1,2,4,5": 0.04177986378463472, - "0,1,2,4,6": 0.027535896808872584, - "0,1,2,4,7": 0.039255866296110886, - "0,1,2,5,6": 0.07134133700538459, - "0,1,2,5,7": 0.030519155035031664, - "0,1,2,6,7": 0.08117110533915617, - "0,1,3,4,5": 0.038407316375976164, - "0,1,3,4,6": 0.035484926102501424, - "0,1,3,4,7": 0.030909706760935185, - "0,1,3,5,6": 0.09721253366005334, - "0,1,3,5,7": 0.03186251232035575, - "0,1,3,6,7": -0.015404144675851716, - "0,1,4,5,6": 0.009788158249699475, - "0,1,4,5,7": 0.01952034063545005, - "0,1,4,6,7": 0.04881414267765405, - "0,1,5,6,7": -0.3901770292616058, - "0,2,3,4,5": 0.04375868241568415, - "0,2,3,4,6": 0.0342613110744423, - "0,2,3,4,7": 0.0330882795411902, - "0,2,3,5,6": 0.024841442491174925, - "0,2,3,5,7": 0.031255597153092785, - "0,2,3,6,7": 0.019350334591623275, - "0,2,4,5,6": 0.039108078045873684, - "0,2,4,5,7": 0.03341648053387103, - "0,2,4,6,7": 0.03827965810646128, - "0,2,5,6,7": 0.016699612042094136, - "0,3,4,5,6": 0.047235865845346225, - "0,3,4,5,7": 0.02998256578151315, - "0,3,4,6,7": 0.03724861417539582, - "0,3,5,6,7": 0.09642613075936679, - "0,4,5,6,7": -0.013889311710381325, - "1,2,3,4,5": 0.03034735835864799, - "1,2,3,4,6": 0.03351959130602067, - "1,2,3,4,7": 0.033124013407105135, - "1,2,3,5,6": 0.011245959761518876, - "1,2,3,5,7": 0.03219908770623947, - "1,2,3,6,7": 0.04098524764362477, - "1,2,4,5,6": 0.028880447042112678, - "1,2,4,5,7": 0.03425904964301507, - "1,2,4,6,7": 0.02721872353326127, - "1,2,5,6,7": 0.059291883732363715, - "1,3,4,5,6": 0.03641870314739726, - "1,3,4,5,7": 0.03363674569296138, - "1,3,4,6,7": 0.03242194066534654, - "1,3,5,6,7": 0.13777371096685842, - "1,4,5,6,7": 0.019999418633177113, - "2,3,4,5,6": 0.03299996838925656, - "2,3,4,5,7": 0.033513705136428484, - "2,3,4,6,7": 0.03313947158379671, - "2,3,5,6,7": 0.025683518283285967, - "2,4,5,6,7": 0.02745283977188029, - "3,4,5,6,7": 0.04048724043384189, - "0,1,2,3,4,5": -0.038135965398280236, - "0,1,2,3,4,6": -0.04519816155617584, - "0,1,2,3,4,7": -0.04432965185692361, - "0,1,2,3,5,6": -0.06443229972309905, - "0,1,2,3,5,7": -0.06856564616851668, - "0,1,2,3,6,7": -0.04471589504955742, - "0,1,2,4,5,6": -0.04273654677647376, - "0,1,2,4,5,7": -0.03543223079238467, - "0,1,2,4,6,7": -0.04977748737781229, - "0,1,2,5,6,7": -0.057772021859887834, - "0,1,3,4,5,6": -0.04343303310460023, - "0,1,3,4,5,7": -0.047832073049533186, - "0,1,3,4,6,7": -0.045529465000880176, - "0,1,3,5,6,7": 0.07033442570516746, - "0,1,4,5,6,7": -0.0728573215172883, - "0,2,3,4,5,6": -0.044082019889319035, - "0,2,3,4,5,7": -0.04408853923161615, - "0,2,3,4,6,7": -0.04405780238950774, - "0,2,3,5,6,7": -0.061926552567677096, - "0,2,4,5,6,7": -0.04408387227569044, - "0,3,4,5,6,7": -0.03520204003740246, - "1,2,3,4,5,6": -0.04337881822283984, - "1,2,3,4,5,7": -0.04471912804740752, - "1,2,3,4,6,7": -0.04428848988950662, - "1,2,3,5,6,7": -0.06808473090161371, - "1,2,4,5,6,7": -0.04989032062928933, - "1,3,4,5,6,7": -0.044014200625874356, - "2,3,4,5,6,7": -0.04451917738950373, - "0,1,2,3,4,5,6": 0.06461339150092416, - "0,1,2,3,4,5,7": 0.0655714585184648, - "0,1,2,3,4,6,7": 0.06643273483426215, - "0,1,2,3,5,6,7": 0.03539292500611646, - "0,1,2,4,5,6,7": 0.06555711615509408, - "0,1,3,4,5,6,7": 0.06263499391382821, - "0,2,3,4,5,6,7": 0.06689410983424837, - "1,2,3,4,5,6,7": 0.06643273483423906, - "0,1,2,3,4,5,6,7": -0.13286546966846924 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=STII_order=1.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=STII_order=1.json deleted file mode 100644 index 02399b7dd..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=STII_order=1.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.225733+00:00Z", - "metadata": { - "n_players": 8, - "index": "SV", - "max_order": 1, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.0591675062728614 - }, - "data": { - "0": 0.10605863487361222, - "1": 0.4560849718043576, - "2": 0.09080992319832237, - "3": 0.09464537643356985, - "4": 0.05886735459376169, - "5": 1.0203178694168615, - "6": 0.3096035462765583, - "7": 0.7221682393544081 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=STII_order=2.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=STII_order=2.json deleted file mode 100644 index 09c62feac..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=STII_order=2.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.221652+00:00Z", - "metadata": { - "n_players": 8, - "index": "STII", - "max_order": 2, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.0591675062728614 - }, - "data": { - "0": -0.10884543348956854, - "1": 0.3381607721568125, - "2": 0.1316649973240529, - "3": 0.1970652598653171, - "4": 0.14609126722476073, - "5": 0.8970816357643576, - "6": 0.07310434137608102, - "7": 0.5979277376875611, - "0,1": 0.09492091814687142, - "0,2": 0.0395958561713424, - "0,3": -0.048044559257659464, - "0,4": -0.005644564952413694, - "0,5": 0.25337942906493327, - "0,6": 0.0346509256141431, - "0,7": 0.060950131939144725, - "1,2": -0.0660231460545797, - "1,3": -0.023768252121958988, - "1,4": -0.030520444754589926, - "1,5": 0.046651776074309426, - "1,6": 0.09102275255332948, - "1,7": 0.12356479545170782, - "2,3": -0.040457196853590394, - "2,4": -0.03194980798741476, - "2,5": 0.04913243110438273, - "2,6": -0.05073024712684793, - "2,7": 0.018721962495246297, - "3,4": -0.03172537912959472, - "3,5": 0.03004680629619444, - "3,6": -0.04149189222291971, - "3,7": -0.04939929357396611, - "4,5": -0.022853527887020136, - "4,6": -0.030053178147424142, - "4,7": -0.021700922403541073, - "5,6": 0.12168563617888917, - "5,7": -0.23157008352668296, - "6,7": 0.3479144129517845 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=STII_order=3.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=STII_order=3.json deleted file mode 100644 index bba624b9d..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=STII_order=3.json +++ /dev/null @@ -1,112 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.219319+00:00Z", - "metadata": { - "n_players": 8, - "index": "STII", - "max_order": 3, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.0591675062728614 - }, - "data": { - "0": -0.10884543348956854, - "1": 0.3381607721568125, - "2": 0.1316649973240529, - "3": 0.1970652598653171, - "4": 0.14609126722476073, - "5": 0.8970816357643576, - "6": 0.07310434137608102, - "7": 0.5979277376875611, - "0,1": -0.12206681015824206, - "0,2": -0.08670298366203322, - "0,3": -0.181703955276026, - "0,4": -0.12698459587453614, - "0,5": 0.11911739812668021, - "0,6": -0.2647619509115824, - "0,7": -0.07604273692330343, - "1,2": -0.15967118302478056, - "1,3": -0.1138615123304465, - "1,4": -0.13969242552095684, - "1,5": -0.09051133313695114, - "1,6": -0.1548977632322992, - "1,7": -0.10091488312971508, - "2,3": -0.13841672184278275, - "2,4": -0.12435026136768368, - "2,5": -0.11920914493947521, - "2,6": -0.18565989668305294, - "2,7": -0.12856372104796865, - "3,4": -0.13442269656660466, - "3,5": -0.10707451219166497, - "3,6": -0.1441604888198591, - "3,7": -0.12238226557331577, - "4,5": -0.13009355244659693, - "4,6": -0.1367696487218768, - "4,7": -0.13242663792493348, - "5,6": -0.042789777983376354, - "5,7": -0.201629960732439, - "6,7": 0.06692037980995513, - "0,1,2": -0.0008282403116269266, - "0,1,3": 0.05893444990150841, - "0,1,4": 0.0716288052650418, - "0,1,5": 0.128558735301448, - "0,1,6": 0.15569344708245003, - "0,1,7": 0.23697598767651812, - "0,2,3": 0.05579939068408478, - "0,2,4": 0.04749619483962354, - "0,2,5": 0.09789877093635072, - "0,2,6": 0.158226967289414, - "0,2,7": 0.020303436062281133, - "0,3,4": 0.04913101304244214, - "0,3,5": 0.16872516664814913, - "0,3,6": 0.044032012961261885, - "0,3,7": 0.02435615481765302, - "0,4,5": 0.08286716423056668, - "0,4,6": 0.05429888478089214, - "0,4,7": 0.05859803060780148, - "0,5,6": 0.16998928786915612, - "0,5,7": -0.24525303217091077, - "0,6,7": 0.3159980295940014, - "1,2,3": 0.044644152013471855, - "1,2,4": 0.04672632872920106, - "1,2,5": 0.11717533473484677, - "1,2,6": -0.0004646006343599629, - "1,2,7": 0.07369113637907193, - "1,3,4": 0.04916584771700766, - "1,3,5": 0.04953262765310343, - "1,3,6": 0.03984906852509407, - "1,3,7": 0.02815363481527844, - "1,4,5": 0.05209087608984814, - "1,4,6": 0.05332175667467376, - "1,4,7": 0.05458232782332961, - "1,5,6": 0.13672884025674786, - "1,5,7": -0.07259708640221085, - "1,6,7": 0.35263303545228225, - "2,3,4": 0.04831167976622652, - "2,3,5": 0.034947962127589105, - "2,3,6": 0.05163533082151575, - "2,3,7": 0.05854005955469019, - "2,4,5": 0.028381404899231938, - "2,4,6": 0.05291261744462289, - "2,4,7": 0.05337313446190231, - "2,5,6": 0.06657530250463917, - "2,5,7": 0.16004595292891632, - "2,6,7": 0.07590333124278437, - "3,4,5": 0.059865837487629886, - "3,4,6": 0.05241723595630374, - "3,4,7": 0.04920033834142154, - "3,5,6": 0.07983288730237331, - "3,5,7": 0.01845947424473529, - "3,6,7": 0.04023925422427102, - "4,5,6": 0.044645196254299274, - "4,5,7": 0.05386959471715516, - "4,6,7": 0.0625537206125675, - "5,6,7": -0.004345271700418402 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=STII_order=4.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=STII_order=4.json deleted file mode 100644 index 395664dfb..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=STII_order=4.json +++ /dev/null @@ -1,182 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.233037+00:00Z", - "metadata": { - "n_players": 8, - "index": "STII", - "max_order": 4, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.0591675062728614 - }, - "data": { - "0": -0.10884543348956854, - "1": 0.3381607721568125, - "2": 0.1316649973240529, - "3": 0.1970652598653171, - "4": 0.14609126722476073, - "5": 0.8970816357643576, - "6": 0.07310434137608102, - "7": 0.5979277376875611, - "0,1": -0.12206681015824206, - "0,2": -0.08670298366203322, - "0,3": -0.181703955276026, - "0,4": -0.12698459587453614, - "0,5": 0.11911739812668021, - "0,6": -0.2647619509115824, - "0,7": -0.07604273692330343, - "1,2": -0.15967118302478056, - "1,3": -0.1138615123304465, - "1,4": -0.13969242552095684, - "1,5": -0.09051133313695114, - "1,6": -0.1548977632322992, - "1,7": -0.10091488312971508, - "2,3": -0.13841672184278275, - "2,4": -0.12435026136768368, - "2,5": -0.11920914493947521, - "2,6": -0.18565989668305294, - "2,7": -0.12856372104796865, - "3,4": -0.13442269656660466, - "3,5": -0.10707451219166497, - "3,6": -0.1441604888198591, - "3,7": -0.12238226557331577, - "4,5": -0.13009355244659693, - "4,6": -0.1367696487218768, - "4,7": -0.13242663792493348, - "5,6": -0.042789777983376354, - "5,7": -0.201629960732439, - "6,7": 0.06692037980995513, - "0,1,2": 0.058732876052507876, - "0,1,3": 0.12672959459119637, - "0,1,4": 0.1505122956738103, - "0,1,5": 0.18896674365375032, - "0,1,6": 0.1180857610218482, - "0,1,7": 0.23493887916570877, - "0,2,3": 0.1308106061494252, - "0,2,4": 0.1228480959704692, - "0,2,5": 0.2166305865986362, - "0,2,6": 0.2968831839787336, - "0,2,7": 0.12223842093808202, - "0,3,4": 0.12874139725424505, - "0,3,5": 0.2198112567790802, - "0,3,6": 0.13921704097436693, - "0,3,7": 0.11931951408121799, - "0,4,5": 0.1719553360651429, - "0,4,6": 0.13134515131442503, - "0,4,7": 0.12992913950964136, - "0,5,6": 0.34096580898281736, - "0,5,7": -0.03870323675928544, - "0,6,7": 0.33374268512186545, - "1,2,3": 0.12174783294435887, - "1,2,4": 0.12672963614921118, - "1,2,5": 0.16607353195358998, - "1,2,6": 0.08929055396959695, - "1,2,7": 0.14226945119795698, - "1,3,4": 0.12848333562796022, - "1,3,5": 0.09278021311620943, - "1,3,6": 0.1364524229894739, - "1,3,7": 0.12011623621366008, - "1,4,5": 0.13794218542574477, - "1,4,6": 0.1321141920959472, - "1,4,7": 0.13424871155618145, - "1,5,6": 0.2178786196526854, - "1,5,7": 0.07298670143650998, - "1,6,7": 0.35453095064382456, - "2,3,4": 0.13307488504075993, - "2,3,5": 0.11894751097724443, - "2,3,6": 0.13198652119720933, - "2,3,7": 0.14163907386234964, - "2,4,5": 0.11225147779911504, - "2,4,6": 0.135418702670973, - "2,4,7": 0.13783911473054866, - "2,5,6": 0.18554976725723415, - "2,5,7": 0.27045464055282853, - "2,6,7": 0.16008096184863518, - "3,4,5": 0.1414435228900257, - "3,4,6": 0.1340813423535132, - "3,4,7": 0.1329387028296276, - "3,5,6": 0.14773920751978453, - "3,5,7": 0.08924831734637229, - "3,6,7": 0.11447170433340714, - "4,5,6": 0.13700943322664205, - "4,5,7": 0.15074110273391295, - "4,6,7": 0.1378856032951714, - "5,6,7": 0.1621007528002334, - "0,1,2,3": -0.05148788638823765, - "0,1,2,4": -0.05569508035503096, - "0,1,2,5": 0.011045946814074566, - "0,1,2,6": -0.11147352871608657, - "0,1,2,7": -0.03063391681125932, - "0,1,3,4": -0.06125878595094664, - "0,1,3,5": 0.044637322091926314, - "0,1,3,6": -0.10286023172120029, - "0,1,3,7": -0.1002109967902916, - "0,1,4,5": -0.08617743448104251, - "0,1,4,6": -0.061615729165382105, - "0,1,4,7": -0.05078693168267098, - "0,1,5,6": 0.012731043341725874, - "0,1,5,7": -0.2238689111758917, - "0,1,6,7": 0.41364919050335136, - "0,2,3,4": -0.0631294717685025, - "0,2,3,5": -0.04349068714812046, - "0,2,3,6": -0.06631509572534577, - "0,2,3,7": -0.07562172083115612, - "0,2,4,5": -0.051561771321853606, - "0,2,4,6": -0.06685996294468258, - "0,2,4,7": -0.06416131813331288, - "0,2,5,6": -0.231787023318464, - "0,2,5,7": -0.15913372767477582, - "0,2,6,7": -0.07818925605269914, - "0,3,4,5": -0.06257915237629119, - "0,3,4,6": -0.06454298630665456, - "0,3,4,7": -0.06693114044481535, - "0,3,5,6": -0.07642203120123117, - "0,3,5,7": -0.06648981189000722, - "0,3,6,7": -0.0705997670979879, - "0,4,5,6": -0.08387783576498348, - "0,4,5,7": -0.0721564933941336, - "0,4,6,7": -0.03128855195243016, - "0,5,6,7": -0.3045502375116934, - "1,2,3,4": -0.06856529757778654, - "1,2,3,5": -0.06483038660396226, - "1,2,3,6": -0.06913667040694713, - "1,2,3,7": -0.05439448274661471, - "1,2,4,5": -0.06148704936774649, - "1,2,4,6": -0.06680304333984424, - "1,2,4,7": -0.06746275903963125, - "1,2,5,6": -0.03505328749612566, - "1,2,5,7": -0.0452680122212086, - "1,2,6,7": -0.07655408845682612, - "1,3,4,5": -0.05517299449396931, - "1,3,4,6": -0.06574345410353968, - "1,3,4,7": -0.06652941951756766, - "1,3,5,6": -0.049790918966601844, - "1,3,5,7": -0.04783336387981843, - "1,3,6,7": -0.09888214265923548, - "1,4,5,6": -0.06384442469280852, - "1,4,5,7": -0.07672333430801939, - "1,4,6,7": -0.05716309038351722, - "1,5,6,7": -0.18864152976994286, - "2,3,4,5": -0.07360717635051281, - "2,3,4,6": -0.06734296141085064, - "2,3,4,7": -0.06640791399048687, - "2,3,5,6": -0.06835401979664182, - "2,3,5,7": -0.08571592549938481, - "2,3,6,7": -0.05025601416299605, - "2,4,5,6": -0.06900536892914147, - "2,4,5,7": -0.07981892563027662, - "2,4,6,7": -0.06001300428088044, - "2,5,6,7": -0.07169815947000671, - "3,4,5,6": -0.06444672907832286, - "3,4,5,7": -0.07050468931048773, - "3,4,6,7": -0.0645802946894716, - "3,5,6,7": -0.01261158182685121, - "4,5,6,7": -0.08828258942411296 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=STII_order=5.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=STII_order=5.json deleted file mode 100644 index f2e1c74e0..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=STII_order=5.json +++ /dev/null @@ -1,238 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.228688+00:00Z", - "metadata": { - "n_players": 8, - "index": "STII", - "max_order": 5, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.0591675062728614 - }, - "data": { - "0": -0.10884543348956854, - "1": 0.3381607721568125, - "2": 0.1316649973240529, - "3": 0.1970652598653171, - "4": 0.14609126722476073, - "5": 0.8970816357643576, - "6": 0.07310434137608102, - "7": 0.5979277376875611, - "0,1": -0.12206681015824206, - "0,2": -0.08670298366203322, - "0,3": -0.181703955276026, - "0,4": -0.12698459587453614, - "0,5": 0.11911739812668021, - "0,6": -0.2647619509115824, - "0,7": -0.07604273692330343, - "1,2": -0.15967118302478056, - "1,3": -0.1138615123304465, - "1,4": -0.13969242552095684, - "1,5": -0.09051133313695114, - "1,6": -0.1548977632322992, - "1,7": -0.10091488312971508, - "2,3": -0.13841672184278275, - "2,4": -0.12435026136768368, - "2,5": -0.11920914493947521, - "2,6": -0.18565989668305294, - "2,7": -0.12856372104796865, - "3,4": -0.13442269656660466, - "3,5": -0.10707451219166497, - "3,6": -0.1441604888198591, - "3,7": -0.12238226557331577, - "4,5": -0.13009355244659693, - "4,6": -0.1367696487218768, - "4,7": -0.13242663792493348, - "5,6": -0.042789777983376354, - "5,7": -0.201629960732439, - "6,7": 0.06692037980995513, - "0,1,2": 0.058732876052507876, - "0,1,3": 0.12672959459119637, - "0,1,4": 0.1505122956738103, - "0,1,5": 0.18896674365375032, - "0,1,6": 0.1180857610218482, - "0,1,7": 0.23493887916570877, - "0,2,3": 0.1308106061494252, - "0,2,4": 0.1228480959704692, - "0,2,5": 0.2166305865986362, - "0,2,6": 0.2968831839787336, - "0,2,7": 0.12223842093808202, - "0,3,4": 0.12874139725424505, - "0,3,5": 0.2198112567790802, - "0,3,6": 0.13921704097436693, - "0,3,7": 0.11931951408121799, - "0,4,5": 0.1719553360651429, - "0,4,6": 0.13134515131442503, - "0,4,7": 0.12992913950964136, - "0,5,6": 0.34096580898281736, - "0,5,7": -0.03870323675928544, - "0,6,7": 0.33374268512186545, - "1,2,3": 0.12174783294435887, - "1,2,4": 0.12672963614921118, - "1,2,5": 0.16607353195358998, - "1,2,6": 0.08929055396959695, - "1,2,7": 0.14226945119795698, - "1,3,4": 0.12848333562796022, - "1,3,5": 0.09278021311620943, - "1,3,6": 0.1364524229894739, - "1,3,7": 0.12011623621366008, - "1,4,5": 0.13794218542574477, - "1,4,6": 0.1321141920959472, - "1,4,7": 0.13424871155618145, - "1,5,6": 0.2178786196526854, - "1,5,7": 0.07298670143650998, - "1,6,7": 0.35453095064382456, - "2,3,4": 0.13307488504075993, - "2,3,5": 0.11894751097724443, - "2,3,6": 0.13198652119720933, - "2,3,7": 0.14163907386234964, - "2,4,5": 0.11225147779911504, - "2,4,6": 0.135418702670973, - "2,4,7": 0.13783911473054866, - "2,5,6": 0.18554976725723415, - "2,5,7": 0.27045464055282853, - "2,6,7": 0.16008096184863518, - "3,4,5": 0.1414435228900257, - "3,4,6": 0.1340813423535132, - "3,4,7": 0.1329387028296276, - "3,5,6": 0.14773920751978453, - "3,5,7": 0.08924831734637229, - "3,6,7": 0.11447170433340714, - "4,5,6": 0.13700943322664205, - "4,5,7": 0.15074110273391295, - "4,6,7": 0.1378856032951714, - "5,6,7": 0.1621007528002334, - "0,1,2,3": -0.11822497173818114, - "0,1,2,4": -0.12304518503771167, - "0,1,2,5": -0.06504698146914478, - "0,1,2,6": -0.20020572493873567, - "0,1,2,7": -0.10810098794620604, - "0,1,3,4": -0.12895124005780367, - "0,1,3,5": -0.020805835760028923, - "0,1,3,6": -0.1614035361084305, - "0,1,3,7": -0.14088501790739638, - "0,1,4,5": -0.14968559500479905, - "0,1,4,6": -0.1301212991684264, - "0,1,4,7": -0.12219209010356913, - "0,1,5,6": 0.02362197895937035, - "0,1,5,7": -0.19388108743757915, - "0,1,6,7": 0.43865086762119354, - "0,2,3,4": -0.1315960517074286, - "0,2,3,5": -0.11275239679903892, - "0,2,3,6": -0.13473715074580594, - "0,2,3,7": -0.14062209592979302, - "0,2,4,5": -0.12065603984879436, - "0,2,4,6": -0.13505343600430697, - "0,2,4,7": -0.1322643917792221, - "0,2,5,6": -0.30766773948877724, - "0,2,5,7": -0.22659996553150918, - "0,2,6,7": -0.15313071068380157, - "0,3,4,5": -0.1324161296702977, - "0,3,4,6": -0.134004342353514, - "0,3,4,7": -0.1322911662590358, - "0,3,5,6": -0.15679211966890572, - "0,3,5,7": -0.13278796111707036, - "0,3,6,7": -0.12305027051906725, - "0,4,5,6": -0.14223556366491774, - "0,4,5,7": -0.12751255070649625, - "0,4,6,7": -0.09655541098721976, - "0,5,6,7": -0.27665142374706786, - "1,2,3,4": -0.13421631000185563, - "1,2,3,5": -0.1296776595964162, - "1,2,3,6": -0.13976317395099525, - "1,2,3,7": -0.12484043048323779, - "1,2,4,5": -0.12677336996188782, - "1,2,4,6": -0.13128846841248398, - "1,2,4,7": -0.1344051541789737, - "1,2,5,6": -0.11617617645109357, - "1,2,5,7": -0.12327609627271086, - "1,2,6,7": -0.16374165287055664, - "1,3,4,5": -0.1220472013081153, - "1,3,4,6": -0.13302646966852594, - "1,3,4,7": -0.13293870282962805, - "1,3,5,6": -0.13543709721485309, - "1,3,5,7": -0.12538750479686955, - "1,3,6,7": -0.1649774314103336, - "1,4,5,6": -0.1266131454150048, - "1,4,5,7": -0.14177653171806925, - "1,4,6,7": -0.1279968979197914, - "1,5,6,7": -0.18706548861419137, - "2,3,4,5": -0.14061971430001874, - "2,3,4,6": -0.13392034235351158, - "2,3,4,7": -0.13286546966852208, - "2,3,5,6": -0.13433454225856378, - "2,3,5,7": -0.15803071525706525, - "2,3,6,7": -0.11865526109754088, - "2,4,5,6": -0.13488410182054622, - "2,4,5,7": -0.14497084865662346, - "2,4,6,7": -0.12653044299539618, - "2,5,6,7": -0.14455744873163523, - "3,4,5,6": -0.1341071995543679, - "3,4,5,7": -0.13705434485724233, - "3,4,6,7": -0.1319214290205415, - "3,5,6,7": -0.1005873445634351, - "4,5,6,7": -0.1461433910849781, - "0,1,2,3,4": 0.08409899540581901, - "0,1,2,3,5": 0.07588082302344897, - "0,1,2,3,6": 0.09861950033984386, - "0,1,2,3,7": 0.07508610798060274, - "0,1,2,4,5": 0.08591482799423279, - "0,1,2,4,6": 0.07884769175747704, - "0,1,2,4,7": 0.0878890082558665, - "0,1,2,5,6": 0.1302512699880261, - "0,1,2,5,7": 0.08841772041038128, - "0,1,2,6,7": 0.13594251902789245, - "0,1,3,4,5": 0.08676857476917803, - "0,1,3,4,6": 0.08547372702334687, - "0,1,3,4,7": 0.08212097333594105, - "0,1,3,5,6": 0.11351333088556324, - "0,1,3,5,7": 0.051053060581582974, - "0,1,3,6,7": -0.004890036312603041, - "0,1,4,5,6": 0.06802401028853648, - "0,1,4,5,7": 0.07683338956683182, - "0,1,4,6,7": 0.1101824209458573, - "0,1,5,6,7": -0.36624328925036004, - "0,2,3,4,5": 0.09129124017498177, - "0,2,3,4,6": 0.08417870176356378, - "0,2,3,4,7": 0.0827639623502636, - "0,2,3,5,6": 0.08564837644637066, - "0,2,3,5,7": 0.09348810860979462, - "0,2,3,6,7": 0.07366369655252891, - "0,2,4,5,6": 0.08817192430957786, - "0,2,4,5,7": 0.08009335015591258, - "0,2,4,6,7": 0.08976904746750575, - "0,2,5,6,7": 0.07533201010759062, - "0,3,4,5,6": 0.09343211479417915, - "0,3,4,5,7": 0.0776929567316886, - "0,3,4,6,7": 0.08422223665320791, - "0,3,5,6,7": 0.1092566202122651, - "0,4,5,6,7": 0.04216059010738957, - "1,2,3,4,5": 0.07783374159629822, - "1,2,3,4,6": 0.08325750703489068, - "1,2,3,4,7": 0.08306481808334773, - "1,2,3,5,6": 0.07384924903444356, - "1,2,3,5,7": 0.09667255130809026, - "1,2,3,6,7": 0.0974062613110831, - "1,2,4,5,6": 0.07962340529676559, - "1,2,4,5,7": 0.08305962808342596, - "1,2,4,6,7": 0.08069852127407423, - "1,2,5,6,7": 0.12189052045561428, - "1,3,4,5,6": 0.08529596816547172, - "1,3,4,5,7": 0.0844727495397983, - "1,3,4,6,7": 0.08238787560122698, - "1,3,5,6,7": 0.1555723431558004, - "1,4,5,6,7": 0.0809002198602056, - "2,3,4,5,6": 0.08246470296726607, - "2,3,4,5,7": 0.08347300500899327, - "2,3,4,6,7": 0.08298599294758882, - "2,3,5,6,7": 0.08794028386153893, - "2,4,5,6,7": 0.0791336318834168, - "3,4,5,6,7": 0.08710956645331616 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=STII_order=6.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=STII_order=6.json deleted file mode 100644 index f311df289..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=STII_order=6.json +++ /dev/null @@ -1,266 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.235624+00:00Z", - "metadata": { - "n_players": 8, - "index": "STII", - "max_order": 6, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.0591675062728614 - }, - "data": { - "0": -0.10884543348956854, - "1": 0.3381607721568125, - "2": 0.1316649973240529, - "3": 0.1970652598653171, - "4": 0.14609126722476073, - "5": 0.8970816357643576, - "6": 0.07310434137608102, - "7": 0.5979277376875611, - "0,1": -0.12206681015824206, - "0,2": -0.08670298366203322, - "0,3": -0.181703955276026, - "0,4": -0.12698459587453614, - "0,5": 0.11911739812668021, - "0,6": -0.2647619509115824, - "0,7": -0.07604273692330343, - "1,2": -0.15967118302478056, - "1,3": -0.1138615123304465, - "1,4": -0.13969242552095684, - "1,5": -0.09051133313695114, - "1,6": -0.1548977632322992, - "1,7": -0.10091488312971508, - "2,3": -0.13841672184278275, - "2,4": -0.12435026136768368, - "2,5": -0.11920914493947521, - "2,6": -0.18565989668305294, - "2,7": -0.12856372104796865, - "3,4": -0.13442269656660466, - "3,5": -0.10707451219166497, - "3,6": -0.1441604888198591, - "3,7": -0.12238226557331577, - "4,5": -0.13009355244659693, - "4,6": -0.1367696487218768, - "4,7": -0.13242663792493348, - "5,6": -0.042789777983376354, - "5,7": -0.201629960732439, - "6,7": 0.06692037980995513, - "0,1,2": 0.058732876052507876, - "0,1,3": 0.12672959459119637, - "0,1,4": 0.1505122956738103, - "0,1,5": 0.18896674365375032, - "0,1,6": 0.1180857610218482, - "0,1,7": 0.23493887916570877, - "0,2,3": 0.1308106061494252, - "0,2,4": 0.1228480959704692, - "0,2,5": 0.2166305865986362, - "0,2,6": 0.2968831839787336, - "0,2,7": 0.12223842093808202, - "0,3,4": 0.12874139725424505, - "0,3,5": 0.2198112567790802, - "0,3,6": 0.13921704097436693, - "0,3,7": 0.11931951408121799, - "0,4,5": 0.1719553360651429, - "0,4,6": 0.13134515131442503, - "0,4,7": 0.12992913950964136, - "0,5,6": 0.34096580898281736, - "0,5,7": -0.03870323675928544, - "0,6,7": 0.33374268512186545, - "1,2,3": 0.12174783294435887, - "1,2,4": 0.12672963614921118, - "1,2,5": 0.16607353195358998, - "1,2,6": 0.08929055396959695, - "1,2,7": 0.14226945119795698, - "1,3,4": 0.12848333562796022, - "1,3,5": 0.09278021311620943, - "1,3,6": 0.1364524229894739, - "1,3,7": 0.12011623621366008, - "1,4,5": 0.13794218542574477, - "1,4,6": 0.1321141920959472, - "1,4,7": 0.13424871155618145, - "1,5,6": 0.2178786196526854, - "1,5,7": 0.07298670143650998, - "1,6,7": 0.35453095064382456, - "2,3,4": 0.13307488504075993, - "2,3,5": 0.11894751097724443, - "2,3,6": 0.13198652119720933, - "2,3,7": 0.14163907386234964, - "2,4,5": 0.11225147779911504, - "2,4,6": 0.135418702670973, - "2,4,7": 0.13783911473054866, - "2,5,6": 0.18554976725723415, - "2,5,7": 0.27045464055282853, - "2,6,7": 0.16008096184863518, - "3,4,5": 0.1414435228900257, - "3,4,6": 0.1340813423535132, - "3,4,7": 0.1329387028296276, - "3,5,6": 0.14773920751978453, - "3,5,7": 0.08924831734637229, - "3,6,7": 0.11447170433340714, - "4,5,6": 0.13700943322664205, - "4,5,7": 0.15074110273391295, - "4,6,7": 0.1378856032951714, - "5,6,7": 0.1621007528002334, - "0,1,2,3": -0.11822497173818114, - "0,1,2,4": -0.12304518503771167, - "0,1,2,5": -0.06504698146914478, - "0,1,2,6": -0.20020572493873567, - "0,1,2,7": -0.10810098794620604, - "0,1,3,4": -0.12895124005780367, - "0,1,3,5": -0.020805835760028923, - "0,1,3,6": -0.1614035361084305, - "0,1,3,7": -0.14088501790739638, - "0,1,4,5": -0.14968559500479905, - "0,1,4,6": -0.1301212991684264, - "0,1,4,7": -0.12219209010356913, - "0,1,5,6": 0.02362197895937035, - "0,1,5,7": -0.19388108743757915, - "0,1,6,7": 0.43865086762119354, - "0,2,3,4": -0.1315960517074286, - "0,2,3,5": -0.11275239679903892, - "0,2,3,6": -0.13473715074580594, - "0,2,3,7": -0.14062209592979302, - "0,2,4,5": -0.12065603984879436, - "0,2,4,6": -0.13505343600430697, - "0,2,4,7": -0.1322643917792221, - "0,2,5,6": -0.30766773948877724, - "0,2,5,7": -0.22659996553150918, - "0,2,6,7": -0.15313071068380157, - "0,3,4,5": -0.1324161296702977, - "0,3,4,6": -0.134004342353514, - "0,3,4,7": -0.1322911662590358, - "0,3,5,6": -0.15679211966890572, - "0,3,5,7": -0.13278796111707036, - "0,3,6,7": -0.12305027051906725, - "0,4,5,6": -0.14223556366491774, - "0,4,5,7": -0.12751255070649625, - "0,4,6,7": -0.09655541098721976, - "0,5,6,7": -0.27665142374706786, - "1,2,3,4": -0.13421631000185563, - "1,2,3,5": -0.1296776595964162, - "1,2,3,6": -0.13976317395099525, - "1,2,3,7": -0.12484043048323779, - "1,2,4,5": -0.12677336996188782, - "1,2,4,6": -0.13128846841248398, - "1,2,4,7": -0.1344051541789737, - "1,2,5,6": -0.11617617645109357, - "1,2,5,7": -0.12327609627271086, - "1,2,6,7": -0.16374165287055664, - "1,3,4,5": -0.1220472013081153, - "1,3,4,6": -0.13302646966852594, - "1,3,4,7": -0.13293870282962805, - "1,3,5,6": -0.13543709721485309, - "1,3,5,7": -0.12538750479686955, - "1,3,6,7": -0.1649774314103336, - "1,4,5,6": -0.1266131454150048, - "1,4,5,7": -0.14177653171806925, - "1,4,6,7": -0.1279968979197914, - "1,5,6,7": -0.18706548861419137, - "2,3,4,5": -0.14061971430001874, - "2,3,4,6": -0.13392034235351158, - "2,3,4,7": -0.13286546966852208, - "2,3,5,6": -0.13433454225856378, - "2,3,5,7": -0.15803071525706525, - "2,3,6,7": -0.11865526109754088, - "2,4,5,6": -0.13488410182054622, - "2,4,5,7": -0.14497084865662346, - "2,4,6,7": -0.12653044299539618, - "2,5,6,7": -0.14455744873163523, - "3,4,5,6": -0.1341071995543679, - "3,4,5,7": -0.13705434485724233, - "3,4,6,7": -0.1319214290205415, - "3,5,6,7": -0.1005873445634351, - "4,5,6,7": -0.1461433910849781, - "0,1,2,3,4": 0.13273747666852342, - "0,1,2,3,5": 0.1280691109101726, - "0,1,2,3,6": 0.14811239529446674, - "0,1,2,3,7": 0.1252371979902387, - "0,1,2,4,5": 0.13255589629728348, - "0,1,2,4,6": 0.12915920174581852, - "0,1,2,4,7": 0.1369524362276433, - "0,1,2,5,6": 0.18140567662880347, - "0,1,2,5,7": 0.13915768772536863, - "0,1,2,6,7": 0.18520093681536487, - "0,1,3,4,5": 0.13524449280772188, - "0,1,3,4,6": 0.134845442641496, - "0,1,3,4,7": 0.13219516625903216, - "0,1,3,5,6": 0.14308487229146172, - "0,1,3,5,7": 0.0821607219831968, - "0,1,3,6,7": 0.021961431455816083, - "0,1,4,5,6": 0.12143585921052491, - "0,1,4,5,7": 0.129875081412953, - "0,1,4,6,7": 0.1653337537761792, - "0,1,5,6,7": -0.3327653979130947, - "0,2,3,4,5": 0.13975843798423204, - "0,2,3,4,6": 0.13392034235351424, - "0,2,3,4,7": 0.13247599347804773, - "0,2,3,5,6": 0.1378786163047665, - "0,2,3,5,7": 0.14652238169680132, - "0,2,3,6,7": 0.12282042120743242, - "0,2,4,5,6": 0.13740340043165622, - "0,2,4,5,7": 0.12822258243502338, - "0,2,4,6,7": 0.14038656593190524, - "0,2,5,6,7": 0.12656486055963656, - "0,3,4,5,6": 0.14095149490250858, - "0,3,4,5,7": 0.12606065231855146, - "0,3,4,6,7": 0.13230357431968542, - "0,3,5,6,7": 0.13731021900169438, - "0,4,5,6,7": 0.09469667518867819, - "1,2,3,4,5": 0.12623391166852205, - "1,2,3,4,6": 0.13286546966852253, - "1,2,3,4,7": 0.13286546966851853, - "1,2,3,5,6": 0.12693372607551145, - "1,2,3,5,7": 0.15078335999147674, - "1,2,3,6,7": 0.1475728713430695, - "1,2,4,5,6": 0.12965049693812958, - "1,2,4,5,7": 0.13220677429552463, - "1,2,4,6,7": 0.13226730345216442, - "1,2,5,6,7": 0.17506254976033464, - "1,3,4,5,6": 0.13411191583223037, - "1,3,4,5,7": 0.13435931109879817, - "1,3,4,6,7": 0.1319214290205406, - "1,3,5,6,7": 0.18606607283705223, - "1,4,5,6,7": 0.13581781416993843, - "2,3,4,5,6": 0.1319800155016586, - "2,3,4,5,7": 0.13332684466851852, - "2,3,4,6,7": 0.1328654696685203, - "2,3,5,6,7": 0.14106871032511714, - "2,4,5,6,7": 0.12984685172306065, - "3,4,5,6,7": 0.13501525589063545, - "0,1,2,3,4,5": -0.09253921359976525, - "0,1,2,3,4,6": -0.09990900844187589, - "0,1,2,3,4,7": -0.09938266553460784, - "0,1,2,3,5,6": -0.10805750024159444, - "0,1,2,3,5,7": -0.1125330134789978, - "0,1,2,3,6,7": -0.08899086104425769, - "0,1,2,4,5,6": -0.09713467270532022, - "0,1,2,4,5,7": -0.09017252351321359, - "0,1,2,4,6,7": -0.1048253787828648, - "0,1,2,5,6,7": -0.10173426689774545, - "0,1,3,4,5,6": -0.09678754394728684, - "0,1,3,4,5,7": -0.10152875068420053, - "0,1,3,4,6,7": -0.09953374131976178, - "0,1,3,5,6,7": 0.02741579575348088, - "0,1,4,5,6,7": -0.1265488768793267, - "0,2,3,4,5,6": -0.0989576435607219, - "0,2,3,4,5,7": -0.09930632969501496, - "0,2,3,4,6,7": -0.0995831915371106, - "0,2,3,5,6,7": -0.10636629534808628, - "0,2,4,5,6,7": -0.0992965404664441, - "0,3,4,5,6,7": -0.08937109314199887, - "1,2,3,4,5,6": -0.09808966510852152, - "1,2,3,4,5,7": -0.09977214172508259, - "1,2,3,4,6,7": -0.09964910225139328, - "1,2,3,5,6,7": -0.11235969689629904, - "1,2,4,5,6,7": -0.10493821203432169, - "1,3,4,5,6,7": -0.09801847694474503, - "2,3,4,5,6,7": -0.10004456653709154 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=STII_order=7.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=STII_order=7.json deleted file mode 100644 index ec2a9ae92..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=STII_order=7.json +++ /dev/null @@ -1,274 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.240739+00:00Z", - "metadata": { - "n_players": 8, - "index": "STII", - "max_order": 7, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.0591675062728614 - }, - "data": { - "0": -0.10884543348956854, - "1": 0.3381607721568125, - "2": 0.1316649973240529, - "3": 0.1970652598653171, - "4": 0.14609126722476073, - "5": 0.8970816357643576, - "6": 0.07310434137608102, - "7": 0.5979277376875611, - "0,1": -0.12206681015824206, - "0,2": -0.08670298366203322, - "0,3": -0.181703955276026, - "0,4": -0.12698459587453614, - "0,5": 0.11911739812668021, - "0,6": -0.2647619509115824, - "0,7": -0.07604273692330343, - "1,2": -0.15967118302478056, - "1,3": -0.1138615123304465, - "1,4": -0.13969242552095684, - "1,5": -0.09051133313695114, - "1,6": -0.1548977632322992, - "1,7": -0.10091488312971508, - "2,3": -0.13841672184278275, - "2,4": -0.12435026136768368, - "2,5": -0.11920914493947521, - "2,6": -0.18565989668305294, - "2,7": -0.12856372104796865, - "3,4": -0.13442269656660466, - "3,5": -0.10707451219166497, - "3,6": -0.1441604888198591, - "3,7": -0.12238226557331577, - "4,5": -0.13009355244659693, - "4,6": -0.1367696487218768, - "4,7": -0.13242663792493348, - "5,6": -0.042789777983376354, - "5,7": -0.201629960732439, - "6,7": 0.06692037980995513, - "0,1,2": 0.058732876052507876, - "0,1,3": 0.12672959459119637, - "0,1,4": 0.1505122956738103, - "0,1,5": 0.18896674365375032, - "0,1,6": 0.1180857610218482, - "0,1,7": 0.23493887916570877, - "0,2,3": 0.1308106061494252, - "0,2,4": 0.1228480959704692, - "0,2,5": 0.2166305865986362, - "0,2,6": 0.2968831839787336, - "0,2,7": 0.12223842093808202, - "0,3,4": 0.12874139725424505, - "0,3,5": 0.2198112567790802, - "0,3,6": 0.13921704097436693, - "0,3,7": 0.11931951408121799, - "0,4,5": 0.1719553360651429, - "0,4,6": 0.13134515131442503, - "0,4,7": 0.12992913950964136, - "0,5,6": 0.34096580898281736, - "0,5,7": -0.03870323675928544, - "0,6,7": 0.33374268512186545, - "1,2,3": 0.12174783294435887, - "1,2,4": 0.12672963614921118, - "1,2,5": 0.16607353195358998, - "1,2,6": 0.08929055396959695, - "1,2,7": 0.14226945119795698, - "1,3,4": 0.12848333562796022, - "1,3,5": 0.09278021311620943, - "1,3,6": 0.1364524229894739, - "1,3,7": 0.12011623621366008, - "1,4,5": 0.13794218542574477, - "1,4,6": 0.1321141920959472, - "1,4,7": 0.13424871155618145, - "1,5,6": 0.2178786196526854, - "1,5,7": 0.07298670143650998, - "1,6,7": 0.35453095064382456, - "2,3,4": 0.13307488504075993, - "2,3,5": 0.11894751097724443, - "2,3,6": 0.13198652119720933, - "2,3,7": 0.14163907386234964, - "2,4,5": 0.11225147779911504, - "2,4,6": 0.135418702670973, - "2,4,7": 0.13783911473054866, - "2,5,6": 0.18554976725723415, - "2,5,7": 0.27045464055282853, - "2,6,7": 0.16008096184863518, - "3,4,5": 0.1414435228900257, - "3,4,6": 0.1340813423535132, - "3,4,7": 0.1329387028296276, - "3,5,6": 0.14773920751978453, - "3,5,7": 0.08924831734637229, - "3,6,7": 0.11447170433340714, - "4,5,6": 0.13700943322664205, - "4,5,7": 0.15074110273391295, - "4,6,7": 0.1378856032951714, - "5,6,7": 0.1621007528002334, - "0,1,2,3": -0.11822497173818114, - "0,1,2,4": -0.12304518503771167, - "0,1,2,5": -0.06504698146914478, - "0,1,2,6": -0.20020572493873567, - "0,1,2,7": -0.10810098794620604, - "0,1,3,4": -0.12895124005780367, - "0,1,3,5": -0.020805835760028923, - "0,1,3,6": -0.1614035361084305, - "0,1,3,7": -0.14088501790739638, - "0,1,4,5": -0.14968559500479905, - "0,1,4,6": -0.1301212991684264, - "0,1,4,7": -0.12219209010356913, - "0,1,5,6": 0.02362197895937035, - "0,1,5,7": -0.19388108743757915, - "0,1,6,7": 0.43865086762119354, - "0,2,3,4": -0.1315960517074286, - "0,2,3,5": -0.11275239679903892, - "0,2,3,6": -0.13473715074580594, - "0,2,3,7": -0.14062209592979302, - "0,2,4,5": -0.12065603984879436, - "0,2,4,6": -0.13505343600430697, - "0,2,4,7": -0.1322643917792221, - "0,2,5,6": -0.30766773948877724, - "0,2,5,7": -0.22659996553150918, - "0,2,6,7": -0.15313071068380157, - "0,3,4,5": -0.1324161296702977, - "0,3,4,6": -0.134004342353514, - "0,3,4,7": -0.1322911662590358, - "0,3,5,6": -0.15679211966890572, - "0,3,5,7": -0.13278796111707036, - "0,3,6,7": -0.12305027051906725, - "0,4,5,6": -0.14223556366491774, - "0,4,5,7": -0.12751255070649625, - "0,4,6,7": -0.09655541098721976, - "0,5,6,7": -0.27665142374706786, - "1,2,3,4": -0.13421631000185563, - "1,2,3,5": -0.1296776595964162, - "1,2,3,6": -0.13976317395099525, - "1,2,3,7": -0.12484043048323779, - "1,2,4,5": -0.12677336996188782, - "1,2,4,6": -0.13128846841248398, - "1,2,4,7": -0.1344051541789737, - "1,2,5,6": -0.11617617645109357, - "1,2,5,7": -0.12327609627271086, - "1,2,6,7": -0.16374165287055664, - "1,3,4,5": -0.1220472013081153, - "1,3,4,6": -0.13302646966852594, - "1,3,4,7": -0.13293870282962805, - "1,3,5,6": -0.13543709721485309, - "1,3,5,7": -0.12538750479686955, - "1,3,6,7": -0.1649774314103336, - "1,4,5,6": -0.1266131454150048, - "1,4,5,7": -0.14177653171806925, - "1,4,6,7": -0.1279968979197914, - "1,5,6,7": -0.18706548861419137, - "2,3,4,5": -0.14061971430001874, - "2,3,4,6": -0.13392034235351158, - "2,3,4,7": -0.13286546966852208, - "2,3,5,6": -0.13433454225856378, - "2,3,5,7": -0.15803071525706525, - "2,3,6,7": -0.11865526109754088, - "2,4,5,6": -0.13488410182054622, - "2,4,5,7": -0.14497084865662346, - "2,4,6,7": -0.12653044299539618, - "2,5,6,7": -0.14455744873163523, - "3,4,5,6": -0.1341071995543679, - "3,4,5,7": -0.13705434485724233, - "3,4,6,7": -0.1319214290205415, - "3,5,6,7": -0.1005873445634351, - "4,5,6,7": -0.1461433910849781, - "0,1,2,3,4": 0.13273747666852342, - "0,1,2,3,5": 0.1280691109101726, - "0,1,2,3,6": 0.14811239529446674, - "0,1,2,3,7": 0.1252371979902387, - "0,1,2,4,5": 0.13255589629728348, - "0,1,2,4,6": 0.12915920174581852, - "0,1,2,4,7": 0.1369524362276433, - "0,1,2,5,6": 0.18140567662880347, - "0,1,2,5,7": 0.13915768772536863, - "0,1,2,6,7": 0.18520093681536487, - "0,1,3,4,5": 0.13524449280772188, - "0,1,3,4,6": 0.134845442641496, - "0,1,3,4,7": 0.13219516625903216, - "0,1,3,5,6": 0.14308487229146172, - "0,1,3,5,7": 0.0821607219831968, - "0,1,3,6,7": 0.021961431455816083, - "0,1,4,5,6": 0.12143585921052491, - "0,1,4,5,7": 0.129875081412953, - "0,1,4,6,7": 0.1653337537761792, - "0,1,5,6,7": -0.3327653979130947, - "0,2,3,4,5": 0.13975843798423204, - "0,2,3,4,6": 0.13392034235351424, - "0,2,3,4,7": 0.13247599347804773, - "0,2,3,5,6": 0.1378786163047665, - "0,2,3,5,7": 0.14652238169680132, - "0,2,3,6,7": 0.12282042120743242, - "0,2,4,5,6": 0.13740340043165622, - "0,2,4,5,7": 0.12822258243502338, - "0,2,4,6,7": 0.14038656593190524, - "0,2,5,6,7": 0.12656486055963656, - "0,3,4,5,6": 0.14095149490250858, - "0,3,4,5,7": 0.12606065231855146, - "0,3,4,6,7": 0.13230357431968542, - "0,3,5,6,7": 0.13731021900169438, - "0,4,5,6,7": 0.09469667518867819, - "1,2,3,4,5": 0.12623391166852205, - "1,2,3,4,6": 0.13286546966852253, - "1,2,3,4,7": 0.13286546966851853, - "1,2,3,5,6": 0.12693372607551145, - "1,2,3,5,7": 0.15078335999147674, - "1,2,3,6,7": 0.1475728713430695, - "1,2,4,5,6": 0.12965049693812958, - "1,2,4,5,7": 0.13220677429552463, - "1,2,4,6,7": 0.13226730345216442, - "1,2,5,6,7": 0.17506254976033464, - "1,3,4,5,6": 0.13411191583223037, - "1,3,4,5,7": 0.13435931109879817, - "1,3,4,6,7": 0.1319214290205406, - "1,3,5,6,7": 0.18606607283705223, - "1,4,5,6,7": 0.13581781416993843, - "2,3,4,5,6": 0.1319800155016586, - "2,3,4,5,7": 0.13332684466851852, - "2,3,4,6,7": 0.1328654696685203, - "2,3,5,6,7": 0.14106871032511714, - "2,4,5,6,7": 0.12984685172306065, - "3,4,5,6,7": 0.13501525589063545, - "0,1,2,3,4,5": -0.1253726353527318, - "0,1,2,3,4,6": -0.13286546966853185, - "0,1,2,3,4,7": -0.13247599347804728, - "0,1,2,3,5,6": -0.13657970292137644, - "0,1,2,3,5,7": -0.14119208287555596, - "0,1,2,3,6,7": -0.11777296991450248, - "0,1,2,4,5,6": -0.12996604554924218, - "0,1,2,4,5,7": -0.12314076307392519, - "0,1,2,4,6,7": -0.13791665781725504, - "0,1,2,5,6,7": -0.13039128738525196, - "0,1,3,4,5,6": -0.12920147075674127, - "0,1,3,4,5,7": -0.13407954421043744, - "0,1,3,4,6,7": -0.13220757431968178, - "0,1,3,5,6,7": -0.0008237786995666241, - "0,1,4,5,6,7": -0.1590976214965103, - "0,2,3,4,5,6": -0.13198001550166838, - "0,2,3,4,5,7": -0.13246556835274026, - "0,2,3,4,6,7": -0.13286546966852475, - "0,2,3,5,6,7": -0.13521431493263592, - "0,2,4,5,6,7": -0.13245373021512652, - "0,3,4,5,6,7": -0.12211083685621693, - "1,2,3,4,5,6": -0.1310461263351992, - "1,2,3,4,5,7": -0.13286546966853008, - "1,2,3,4,6,7": -0.13286546966853052, - "1,2,3,5,6,7": -0.1411418057665612, - "1,2,4,5,6,7": -0.13802949106871587, - "1,3,4,5,6,7": -0.1306923099446884, - "2,3,4,5,6,7": -0.13332684466852296, - "0,1,2,3,4,5,6": 0.11443794262660278, - "0,1,2,3,4,5,7": 0.11539600964415858, - "0,1,2,3,4,6,7": 0.11625728595997636, - "0,1,2,3,5,6,7": 0.08521747613179642, - "0,1,2,4,5,6,7": 0.11538166728080673, - "0,1,3,4,5,6,7": 0.11245954503953348, - "0,2,3,4,5,6,7": 0.11671866095997785, - "1,2,3,4,5,6,7": 0.11625728595996987 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=STII_order=8.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=STII_order=8.json deleted file mode 100644 index 8bcefc3fb..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=STII_order=8.json +++ /dev/null @@ -1,275 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.206863+00:00Z", - "metadata": { - "n_players": 8, - "index": "STII", - "max_order": 8, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.0591675062728614 - }, - "data": { - "0": -0.10884543348956854, - "1": 0.3381607721568125, - "2": 0.1316649973240529, - "3": 0.1970652598653171, - "4": 0.14609126722476073, - "5": 0.8970816357643576, - "6": 0.07310434137608102, - "7": 0.5979277376875611, - "0,1": -0.12206681015824206, - "0,2": -0.08670298366203322, - "0,3": -0.181703955276026, - "0,4": -0.12698459587453614, - "0,5": 0.11911739812668021, - "0,6": -0.2647619509115824, - "0,7": -0.07604273692330343, - "1,2": -0.15967118302478056, - "1,3": -0.1138615123304465, - "1,4": -0.13969242552095684, - "1,5": -0.09051133313695114, - "1,6": -0.1548977632322992, - "1,7": -0.10091488312971508, - "2,3": -0.13841672184278275, - "2,4": -0.12435026136768368, - "2,5": -0.11920914493947521, - "2,6": -0.18565989668305294, - "2,7": -0.12856372104796865, - "3,4": -0.13442269656660466, - "3,5": -0.10707451219166497, - "3,6": -0.1441604888198591, - "3,7": -0.12238226557331577, - "4,5": -0.13009355244659693, - "4,6": -0.1367696487218768, - "4,7": -0.13242663792493348, - "5,6": -0.042789777983376354, - "5,7": -0.201629960732439, - "6,7": 0.06692037980995513, - "0,1,2": 0.058732876052507876, - "0,1,3": 0.12672959459119637, - "0,1,4": 0.1505122956738103, - "0,1,5": 0.18896674365375032, - "0,1,6": 0.1180857610218482, - "0,1,7": 0.23493887916570877, - "0,2,3": 0.1308106061494252, - "0,2,4": 0.1228480959704692, - "0,2,5": 0.2166305865986362, - "0,2,6": 0.2968831839787336, - "0,2,7": 0.12223842093808202, - "0,3,4": 0.12874139725424505, - "0,3,5": 0.2198112567790802, - "0,3,6": 0.13921704097436693, - "0,3,7": 0.11931951408121799, - "0,4,5": 0.1719553360651429, - "0,4,6": 0.13134515131442503, - "0,4,7": 0.12992913950964136, - "0,5,6": 0.34096580898281736, - "0,5,7": -0.03870323675928544, - "0,6,7": 0.33374268512186545, - "1,2,3": 0.12174783294435887, - "1,2,4": 0.12672963614921118, - "1,2,5": 0.16607353195358998, - "1,2,6": 0.08929055396959695, - "1,2,7": 0.14226945119795698, - "1,3,4": 0.12848333562796022, - "1,3,5": 0.09278021311620943, - "1,3,6": 0.1364524229894739, - "1,3,7": 0.12011623621366008, - "1,4,5": 0.13794218542574477, - "1,4,6": 0.1321141920959472, - "1,4,7": 0.13424871155618145, - "1,5,6": 0.2178786196526854, - "1,5,7": 0.07298670143650998, - "1,6,7": 0.35453095064382456, - "2,3,4": 0.13307488504075993, - "2,3,5": 0.11894751097724443, - "2,3,6": 0.13198652119720933, - "2,3,7": 0.14163907386234964, - "2,4,5": 0.11225147779911504, - "2,4,6": 0.135418702670973, - "2,4,7": 0.13783911473054866, - "2,5,6": 0.18554976725723415, - "2,5,7": 0.27045464055282853, - "2,6,7": 0.16008096184863518, - "3,4,5": 0.1414435228900257, - "3,4,6": 0.1340813423535132, - "3,4,7": 0.1329387028296276, - "3,5,6": 0.14773920751978453, - "3,5,7": 0.08924831734637229, - "3,6,7": 0.11447170433340714, - "4,5,6": 0.13700943322664205, - "4,5,7": 0.15074110273391295, - "4,6,7": 0.1378856032951714, - "5,6,7": 0.1621007528002334, - "0,1,2,3": -0.11822497173818114, - "0,1,2,4": -0.12304518503771167, - "0,1,2,5": -0.06504698146914478, - "0,1,2,6": -0.20020572493873567, - "0,1,2,7": -0.10810098794620604, - "0,1,3,4": -0.12895124005780367, - "0,1,3,5": -0.020805835760028923, - "0,1,3,6": -0.1614035361084305, - "0,1,3,7": -0.14088501790739638, - "0,1,4,5": -0.14968559500479905, - "0,1,4,6": -0.1301212991684264, - "0,1,4,7": -0.12219209010356913, - "0,1,5,6": 0.02362197895937035, - "0,1,5,7": -0.19388108743757915, - "0,1,6,7": 0.43865086762119354, - "0,2,3,4": -0.1315960517074286, - "0,2,3,5": -0.11275239679903892, - "0,2,3,6": -0.13473715074580594, - "0,2,3,7": -0.14062209592979302, - "0,2,4,5": -0.12065603984879436, - "0,2,4,6": -0.13505343600430697, - "0,2,4,7": -0.1322643917792221, - "0,2,5,6": -0.30766773948877724, - "0,2,5,7": -0.22659996553150918, - "0,2,6,7": -0.15313071068380157, - "0,3,4,5": -0.1324161296702977, - "0,3,4,6": -0.134004342353514, - "0,3,4,7": -0.1322911662590358, - "0,3,5,6": -0.15679211966890572, - "0,3,5,7": -0.13278796111707036, - "0,3,6,7": -0.12305027051906725, - "0,4,5,6": -0.14223556366491774, - "0,4,5,7": -0.12751255070649625, - "0,4,6,7": -0.09655541098721976, - "0,5,6,7": -0.27665142374706786, - "1,2,3,4": -0.13421631000185563, - "1,2,3,5": -0.1296776595964162, - "1,2,3,6": -0.13976317395099525, - "1,2,3,7": -0.12484043048323779, - "1,2,4,5": -0.12677336996188782, - "1,2,4,6": -0.13128846841248398, - "1,2,4,7": -0.1344051541789737, - "1,2,5,6": -0.11617617645109357, - "1,2,5,7": -0.12327609627271086, - "1,2,6,7": -0.16374165287055664, - "1,3,4,5": -0.1220472013081153, - "1,3,4,6": -0.13302646966852594, - "1,3,4,7": -0.13293870282962805, - "1,3,5,6": -0.13543709721485309, - "1,3,5,7": -0.12538750479686955, - "1,3,6,7": -0.1649774314103336, - "1,4,5,6": -0.1266131454150048, - "1,4,5,7": -0.14177653171806925, - "1,4,6,7": -0.1279968979197914, - "1,5,6,7": -0.18706548861419137, - "2,3,4,5": -0.14061971430001874, - "2,3,4,6": -0.13392034235351158, - "2,3,4,7": -0.13286546966852208, - "2,3,5,6": -0.13433454225856378, - "2,3,5,7": -0.15803071525706525, - "2,3,6,7": -0.11865526109754088, - "2,4,5,6": -0.13488410182054622, - "2,4,5,7": -0.14497084865662346, - "2,4,6,7": -0.12653044299539618, - "2,5,6,7": -0.14455744873163523, - "3,4,5,6": -0.1341071995543679, - "3,4,5,7": -0.13705434485724233, - "3,4,6,7": -0.1319214290205415, - "3,5,6,7": -0.1005873445634351, - "4,5,6,7": -0.1461433910849781, - "0,1,2,3,4": 0.13273747666852342, - "0,1,2,3,5": 0.1280691109101726, - "0,1,2,3,6": 0.14811239529446674, - "0,1,2,3,7": 0.1252371979902387, - "0,1,2,4,5": 0.13255589629728348, - "0,1,2,4,6": 0.12915920174581852, - "0,1,2,4,7": 0.1369524362276433, - "0,1,2,5,6": 0.18140567662880347, - "0,1,2,5,7": 0.13915768772536863, - "0,1,2,6,7": 0.18520093681536487, - "0,1,3,4,5": 0.13524449280772188, - "0,1,3,4,6": 0.134845442641496, - "0,1,3,4,7": 0.13219516625903216, - "0,1,3,5,6": 0.14308487229146172, - "0,1,3,5,7": 0.0821607219831968, - "0,1,3,6,7": 0.021961431455816083, - "0,1,4,5,6": 0.12143585921052491, - "0,1,4,5,7": 0.129875081412953, - "0,1,4,6,7": 0.1653337537761792, - "0,1,5,6,7": -0.3327653979130947, - "0,2,3,4,5": 0.13975843798423204, - "0,2,3,4,6": 0.13392034235351424, - "0,2,3,4,7": 0.13247599347804773, - "0,2,3,5,6": 0.1378786163047665, - "0,2,3,5,7": 0.14652238169680132, - "0,2,3,6,7": 0.12282042120743242, - "0,2,4,5,6": 0.13740340043165622, - "0,2,4,5,7": 0.12822258243502338, - "0,2,4,6,7": 0.14038656593190524, - "0,2,5,6,7": 0.12656486055963656, - "0,3,4,5,6": 0.14095149490250858, - "0,3,4,5,7": 0.12606065231855146, - "0,3,4,6,7": 0.13230357431968542, - "0,3,5,6,7": 0.13731021900169438, - "0,4,5,6,7": 0.09469667518867819, - "1,2,3,4,5": 0.12623391166852205, - "1,2,3,4,6": 0.13286546966852253, - "1,2,3,4,7": 0.13286546966851853, - "1,2,3,5,6": 0.12693372607551145, - "1,2,3,5,7": 0.15078335999147674, - "1,2,3,6,7": 0.1475728713430695, - "1,2,4,5,6": 0.12965049693812958, - "1,2,4,5,7": 0.13220677429552463, - "1,2,4,6,7": 0.13226730345216442, - "1,2,5,6,7": 0.17506254976033464, - "1,3,4,5,6": 0.13411191583223037, - "1,3,4,5,7": 0.13435931109879817, - "1,3,4,6,7": 0.1319214290205406, - "1,3,5,6,7": 0.18606607283705223, - "1,4,5,6,7": 0.13581781416993843, - "2,3,4,5,6": 0.1319800155016586, - "2,3,4,5,7": 0.13332684466851852, - "2,3,4,6,7": 0.1328654696685203, - "2,3,5,6,7": 0.14106871032511714, - "2,4,5,6,7": 0.12984685172306065, - "3,4,5,6,7": 0.13501525589063545, - "0,1,2,3,4,5": -0.1253726353527318, - "0,1,2,3,4,6": -0.13286546966853185, - "0,1,2,3,4,7": -0.13247599347804728, - "0,1,2,3,5,6": -0.13657970292137644, - "0,1,2,3,5,7": -0.14119208287555596, - "0,1,2,3,6,7": -0.11777296991450248, - "0,1,2,4,5,6": -0.12996604554924218, - "0,1,2,4,5,7": -0.12314076307392519, - "0,1,2,4,6,7": -0.13791665781725504, - "0,1,2,5,6,7": -0.13039128738525196, - "0,1,3,4,5,6": -0.12920147075674127, - "0,1,3,4,5,7": -0.13407954421043744, - "0,1,3,4,6,7": -0.13220757431968178, - "0,1,3,5,6,7": -0.0008237786995666241, - "0,1,4,5,6,7": -0.1590976214965103, - "0,2,3,4,5,6": -0.13198001550166838, - "0,2,3,4,5,7": -0.13246556835274026, - "0,2,3,4,6,7": -0.13286546966852475, - "0,2,3,5,6,7": -0.13521431493263592, - "0,2,4,5,6,7": -0.13245373021512652, - "0,3,4,5,6,7": -0.12211083685621693, - "1,2,3,4,5,6": -0.1310461263351992, - "1,2,3,4,5,7": -0.13286546966853008, - "1,2,3,4,6,7": -0.13286546966853052, - "1,2,3,5,6,7": -0.1411418057665612, - "1,2,4,5,6,7": -0.13802949106871587, - "1,3,4,5,6,7": -0.1306923099446884, - "2,3,4,5,6,7": -0.13332684466852296, - "0,1,2,3,4,5,6": 0.13104612633518453, - "0,1,2,3,4,5,7": 0.13200419335275004, - "0,1,2,3,4,6,7": 0.13286546966853185, - "0,1,2,3,5,6,7": 0.10182565984038305, - "0,1,2,4,5,6,7": 0.13198985098938376, - "0,1,3,4,5,6,7": 0.12906772874812766, - "0,2,3,4,5,6,7": 0.1333268446685385, - "1,2,3,4,5,6,7": 0.1328654696685332, - "0,1,2,3,4,5,6,7": -0.13286546966846924 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=SV_order=1.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=SV_order=1.json deleted file mode 100644 index 4dcfc634b..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=SV_order=1.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.182510+00:00Z", - "metadata": { - "n_players": 8, - "index": "SV", - "max_order": 1, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.0591675062728614 - }, - "data": { - "0": 0.10605863487361222, - "1": 0.4560849718043576, - "2": 0.09080992319832237, - "3": 0.09464537643356985, - "4": 0.05886735459376169, - "5": 1.0203178694168615, - "6": 0.3096035462765583, - "7": 0.7221682393544081 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=k-SII_order=1.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=k-SII_order=1.json deleted file mode 100644 index 31918f6c6..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=k-SII_order=1.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.181869+00:00Z", - "metadata": { - "n_players": 8, - "index": "SV", - "max_order": 1, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.0591675062728614 - }, - "data": { - "0": 0.10605863487361222, - "1": 0.4560849718043576, - "2": 0.09080992319832237, - "3": 0.09464537643356985, - "4": 0.05886735459376169, - "5": 1.0203178694168615, - "6": 0.3096035462765583, - "7": 0.7221682393544081 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=k-SII_order=2.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=k-SII_order=2.json deleted file mode 100644 index 6238a60c7..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=k-SII_order=2.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.175263+00:00Z", - "metadata": { - "n_players": 8, - "index": "k-SII", - "max_order": 2, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.0591675062728614 - }, - "data": { - "0": -0.25055356930654693, - "1": 0.14706206158566432, - "2": 0.042362930843032776, - "3": 0.10732522637458625, - "4": 0.0812486128650382, - "5": 0.8976482921305751, - "6": -0.11553486134817054, - "7": 0.5301432669418349, - "0,1": 0.19468289354989599, - "0,2": 0.06060139739057224, - "0,3": -0.009482998455274672, - "0,4": 0.02371228781494894, - "0,5": 0.2336212456514451, - "0,6": 0.13816526600962897, - "0,7": 0.07192431639910168, - "1,2": -0.035858249550746235, - "1,3": -0.0039985816517480455, - "1,4": -0.009249961872950907, - "1,5": 0.07141758038747215, - "1,6": 0.19811791692585534, - "1,7": 0.20293422264960825, - "2,3": -0.024589688316478564, - "2,4": -0.019437117846063612, - "2,5": 0.08989038615666356, - "2,6": -0.029072996459864275, - "2,7": 0.05536025333649608, - "3,4": -0.012925902164828473, - "3,5": 0.08895133192365945, - "3,6": -0.017981566299103635, - "3,7": -0.04533229491825885, - "4,5": -0.012495265070660677, - "4,6": -0.011894059701410775, - "4,7": -0.0024724977015875282, - "5,6": 0.12263009261927937, - "5,7": -0.34867621709528596, - "6,7": 0.45031216215507264 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=k-SII_order=3.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=k-SII_order=3.json deleted file mode 100644 index d40100761..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=k-SII_order=3.json +++ /dev/null @@ -1,112 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.176110+00:00Z", - "metadata": { - "n_players": 8, - "index": "k-SII", - "max_order": 3, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.0591675062728614 - }, - "data": { - "0": -0.09161912544109427, - "1": 0.35807335000409773, - "2": 0.16148216755639866, - "3": 0.23074848347980267, - "4": 0.17276797597844368, - "5": 0.916852160251071, - "6": 0.09411642175623341, - "7": 0.6153170600549169, - "0,1": -0.11156652946849738, - "0,2": -0.029659366212040683, - "0,3": -0.15299434385183486, - "0,4": -0.08753811098592146, - "0,5": 0.28578327433689005, - "0,6": -0.1811964124517439, - "0,7": 0.03678923380075044, - "1,2": -0.1544586584331366, - "1,3": -0.09235641791217852, - "1,4": -0.09561902451668164, - "1,5": -0.013764200292415707, - "1,6": -0.1364069131361979, - "1,7": -0.04385016631410621, - "2,3": -0.09379804923786988, - "2,4": -0.08161224852990562, - "2,5": -0.05688081491078012, - "2,6": -0.12115687159410943, - "2,7": -0.0802554266517741, - "3,4": -0.09528330372874866, - "3,5": -0.12266388412578344, - "3,6": -0.1221105385255627, - "3,7": -0.08669270513135313, - "4,5": -0.0645989482644182, - "4,6": -0.0878449115889623, - "4,7": -0.08138214760834778, - "5,6": 0.10746344248711548, - "5,7": -0.005222923381010824, - "6,7": 0.13362132143249467, - "0,1,2": 0.00783390233879977, - "0,1,3": 0.04371851500092805, - "0,1,4": 0.048795678279971555, - "0,1,5": 0.07339055091052527, - "0,1,6": 0.20412403905934629, - "0,1,7": 0.2346361604472158, - "0,2,3": 0.03539508881378195, - "0,2,4": 0.031624653188292995, - "0,2,5": 0.04032049557368067, - "0,2,6": 0.087001738267933, - "0,2,7": -0.021654350977262538, - "0,3,4": 0.029054639876514243, - "0,3,5": 0.1871025800344367, - "0,3,6": 0.012529654631661002, - "0,3,7": -0.020777787564201566, - "0,4,5": 0.04381290031323337, - "0,4,6": 0.030187631567375917, - "0,4,7": 0.039025294376352715, - "0,5,6": 0.008444430139532777, - "0,5,7": -0.4573950143422987, - "0,6,7": 0.29643586325689675, - "1,2,3": 0.021789597234625924, - "1,2,4": 0.021904151200918154, - "1,2,5": 0.130988782768224, - "1,2,6": -0.01838965460308084, - "1,2,7": 0.07307403882529373, - "1,3,4": 0.026360938898721376, - "1,3,5": 0.07758725462150984, - "1,3,6": 0.012064454041517791, - "1,3,7": -0.004805087276442022, - "1,4,5": 0.017535674475531504, - "1,4,6": 0.027677905603267328, - "1,4,7": 0.030463776829051548, - "1,5,6": 0.07711716275236558, - "1,5,7": -0.2062558641683805, - "1,6,7": 0.36645575327069035, - "2,3,4": 0.020220861671153445, - "2,3,5": 0.004198307481738439, - "2,3,6": 0.026114420404838024, - "2,3,7": 0.03069844623664486, - "2,4,5": 0.0011350907645677477, - "2,4,6": 0.024974356630452554, - "2,4,7": 0.024491147912299116, - "2,5,6": 0.008372268567729435, - "2,5,7": 0.10852745697894706, - "2,6,7": 0.05609462100061813, - "3,4,5": 0.03773462780079595, - "3,4,6": 0.029917940170674173, - "3,4,7": 0.021425794709981183, - "3,5,6": 0.09402984152221294, - "3,5,7": 0.022577820638191914, - "3,6,7": 0.03360163368201419, - "4,5,6": 0.0003598284254417994, - "4,5,7": 0.0036292446079446705, - "4,6,7": 0.038784041377891265, - "5,6,7": -0.15799023114295474 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=k-SII_order=4.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=k-SII_order=4.json deleted file mode 100644 index c176b0bc4..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=k-SII_order=4.json +++ /dev/null @@ -1,182 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.186942+00:00Z", - "metadata": { - "n_players": 8, - "index": "k-SII", - "max_order": 4, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.0591675062728614 - }, - "data": { - "0": -0.09161912544109427, - "1": 0.35807335000409773, - "2": 0.16148216755639866, - "3": 0.23074848347980267, - "4": 0.17276797597844368, - "5": 0.916852160251071, - "6": 0.09411642175623341, - "7": 0.6153170600549169, - "0,1": -0.13991712571224654, - "0,2": -0.1078506765289274, - "0,3": -0.1985803156897533, - "0,4": -0.1463803393194624, - "0,5": 0.10127267046733082, - "0,6": -0.28244749046205275, - "0,7": -0.0937404791420837, - "1,2": -0.18122296593623555, - "1,3": -0.13124215319656418, - "1,4": -0.1595807250855958, - "1,5": -0.10904619994381107, - "1,6": -0.17326011188642032, - "1,7": -0.11933389413488815, - "2,3": -0.16007068755529819, - "2,4": -0.14314407152823821, - "2,5": -0.14110727703839082, - "2,6": -0.20746123966944846, - "2,7": -0.15027530903199535, - "3,4": -0.15301951852604817, - "3,5": -0.12464704191653193, - "3,6": -0.16108130061106915, - "3,7": -0.13960343422645813, - "4,5": -0.14941026511597677, - "4,6": -0.15670781038107987, - "4,7": -0.15228390103175193, - "5,6": -0.06116226541368548, - "5,7": -0.2200882781485186, - "6,7": 0.0488710116466132, - "0,1,2": 0.0012557085113114597, - "0,1,3": 0.08134341859616118, - "0,1,4": 0.10673391759138828, - "0,1,5": 0.20456573195146183, - "0,1,6": 0.12641241621124094, - "0,1,7": 0.2622912306377181, - "0,2,3": 0.09088593456453142, - "0,2,4": 0.07271370526617565, - "0,2,5": 0.16862720197671754, - "0,2,6": 0.24088150143227088, - "0,2,7": 0.07530533735553918, - "0,3,4": 0.07852741056427026, - "0,3,5": 0.15366673503316658, - "0,3,6": 0.07910658126670045, - "0,3,7": 0.07700844179580157, - "0,4,5": 0.13461303173628503, - "0,4,6": 0.09157167295972812, - "0,4,7": 0.09139442948513893, - "0,5,6": 0.35103775734199183, - "0,5,7": -0.009770892193157188, - "0,6,7": 0.3572198957726668, - "1,2,3": 0.08266351370680552, - "1,2,4": 0.08234041734947611, - "1,2,5": 0.11686411923798495, - "1,2,6": 0.028506589478594913, - "1,2,7": 0.08615631449920141, - "1,3,4": 0.08260513081400062, - "1,3,5": 0.025266765339053865, - "1,3,6": 0.0708263416895703, - "1,3,7": 0.06732491408158331, - "1,4,5": 0.0999296083293188, - "1,4,6": 0.09295623310955375, - "1,4,7": 0.09194302150720901, - "1,5,6": 0.21407047121020045, - "1,5,7": 0.08135886320012803, - "1,6,7": 0.35739680092628073, - "2,3,4": 0.08675830419153502, - "2,3,5": 0.08211913511321756, - "2,3,6": 0.09210768100344263, - "2,3,7": 0.1015179831678204, - "2,4,5": 0.06563435930698042, - "2,4,6": 0.092683707965938, - "2,4,7": 0.09341070527757428, - "2,5,6": 0.13925526207409827, - "2,5,7": 0.2264010971915527, - "2,6,7": 0.10855921676617991, - "3,4,5": 0.09118372058057567, - "3,4,6": 0.08444533573020946, - "3,4,7": 0.08761219003104642, - "3,5,6": 0.0658839670664152, - "3,5,7": 0.017009055710947796, - "3,6,7": 0.04971261020961909, - "4,5,6": 0.10313361012655448, - "4,5,7": 0.11858093741715198, - "4,6,7": 0.10028853663582482, - "5,6,7": 0.16870647984987336, - "0,1,2,3": -0.015370897677890016, - "0,1,2,4": -0.012518551728565419, - "0,1,2,5": 0.060976395621356816, - "0,1,2,6": -0.042238648007230206, - "0,1,2,7": 0.022308089447305446, - "0,1,3,4": -0.018834727872373613, - "0,1,3,5": 0.09797019143284291, - "0,1,3,6": -0.05675696847925893, - "0,1,3,7": -0.08225740459378661, - "0,1,4,5": -0.05262874269777773, - "0,1,4,6": -0.023816583682475634, - "0,1,4,7": -0.00807787264164106, - "0,1,5,6": -0.05157490399011866, - "0,1,5,7": -0.31709330244817646, - "0,1,6,7": 0.3298103498552941, - "0,2,3,4": -0.01908741256680735, - "0,2,3,5": -0.006261951214443506, - "0,2,3,6": -0.027604312840334377, - "0,2,3,7": -0.0426571172020237, - "0,2,4,5": -0.0046268073870888715, - "0,2,4,6": -0.024900497931271803, - "0,2,4,7": -0.021044834542031876, - "0,2,5,6": -0.18359580150344212, - "0,2,5,7": -0.12310524832245606, - "0,2,6,7": -0.029420266046397248, - "0,3,4,5": -0.015023818331530325, - "0,3,4,6": -0.018400745747310432, - "0,3,4,7": -0.027598836857490316, - "0,3,5,6": 0.0014272709896008262, - "0,3,5,7": -0.011240002873929678, - "0,3,6,7": -0.03181909719277598, - "0,4,5,6": -0.058477211838471876, - "0,4,5,7": -0.05084368259123451, - "0,4,6,7": 0.0028269564148253323, - "0,5,6,7": -0.39296600806248627, - "1,2,3,4": -0.02873998006611933, - "1,2,3,5": -0.035204611214716075, - "1,2,3,6": -0.02803387007398428, - "1,2,3,7": -0.0143984739116495, - "1,2,4,5": -0.021186691225521526, - "1,2,4,6": -0.0312616839809533, - "1,2,4,7": -0.02716562529595634, - "1,2,5,6": 0.019157244682845076, - "1,2,5,7": 0.004506989196513822, - "1,2,6,7": -0.011415530784028793, - "1,3,4,5": -0.013485452101485884, - "1,3,4,6": -0.024225709980197796, - "1,3,4,7": -0.027202513810381856, - "1,3,5,6": 0.03362761704291983, - "1,3,5,7": 0.02173323340535116, - "1,3,6,7": -0.042134843805583855, - "1,4,5,6": -0.03411359072169995, - "1,4,5,7": -0.0433733909610895, - "1,4,6,7": -0.01713908664724617, - "1,5,6,7": -0.24100298392961605, - "2,3,4,5": -0.03158476477580152, - "2,3,4,6": -0.02713494194289867, - "2,3,4,7": -0.026527785689136274, - "2,3,5,6": -0.036974013669223704, - "2,3,5,7": -0.04581631438877343, - "2,3,6,7": -0.012239382670768184, - "2,4,5,6": -0.03031049165441735, - "2,4,5,7": -0.04128978204199607, - "2,4,6,7": -0.021811087161429765, - "2,5,6,7": -0.030042924868499576, - "3,4,5,6": -0.01752694475714167, - "3,4,5,7": -0.02927720559360003, - "3,4,6,7": -0.021766448691522, - "3,5,6,7": 0.07573781930544021, - "4,5,6,7": -0.06511932443049451 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=k-SII_order=5.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=k-SII_order=5.json deleted file mode 100644 index 464007516..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=k-SII_order=5.json +++ /dev/null @@ -1,238 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.188686+00:00Z", - "metadata": { - "n_players": 8, - "index": "k-SII", - "max_order": 5, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.0591675062728614 - }, - "data": { - "0": -0.11901440324578315, - "1": 0.32800278751964995, - "2": 0.1214056051649933, - "3": 0.1868754420453414, - "4": 0.1351832543774183, - "5": 0.8869126660081477, - "6": 0.06291486504092582, - "7": 0.5877154502329339, - "0,1": -0.13991712571224654, - "0,2": -0.1078506765289274, - "0,3": -0.1985803156897533, - "0,4": -0.1463803393194624, - "0,5": 0.10127267046733082, - "0,6": -0.28244749046205275, - "0,7": -0.0937404791420837, - "1,2": -0.18122296593623555, - "1,3": -0.13124215319656418, - "1,4": -0.1595807250855958, - "1,5": -0.10904619994381107, - "1,6": -0.17326011188642032, - "1,7": -0.11933389413488815, - "2,3": -0.16007068755529819, - "2,4": -0.14314407152823821, - "2,5": -0.14110727703839082, - "2,6": -0.20746123966944846, - "2,7": -0.15027530903199535, - "3,4": -0.15301951852604817, - "3,5": -0.12464704191653193, - "3,6": -0.16108130061106915, - "3,7": -0.13960343422645813, - "4,5": -0.14941026511597677, - "4,6": -0.15670781038107987, - "4,7": -0.15228390103175193, - "5,6": -0.06116226541368548, - "5,7": -0.2200882781485186, - "6,7": 0.0488710116466132, - "0,1,2": 0.06865179691967246, - "0,1,3": 0.1365511113836521, - "0,1,4": 0.16133928550456492, - "0,1,5": 0.1987590731568993, - "0,1,6": 0.1279067997355242, - "0,1,7": 0.24479185344663576, - "0,2,3": 0.14077409347256192, - "0,2,4": 0.13381705633190338, - "0,2,5": 0.22656488663246527, - "0,2,6": 0.30684619322309054, - "0,2,7": 0.1322333657496894, - "0,3,4": 0.13961295354097197, - "0,3,5": 0.22964815273820122, - "0,3,6": 0.1490826461440151, - "0,3,7": 0.12921705481811677, - "0,4,5": 0.18279770506256293, - "0,4,6": 0.1422162295223724, - "0,4,7": 0.140832153284839, - "0,5,6": 0.3508022268631594, - "0,5,7": -0.028834883311692476, - "0,6,7": 0.3436397477799854, - "1,2,3": 0.13169594110082758, - "1,2,4": 0.1376832173439772, - "1,2,5": 0.17599245282075046, - "1,2,6": 0.0992381840472867, - "1,2,7": 0.15224901684289777, - "1,3,4": 0.13933951274802017, - "1,3,5": 0.10260172990866273, - "1,3,6": 0.14630264899245446, - "1,3,7": 0.12999839778389077, - "1,4,5": 0.14876917525649747, - "1,4,6": 0.1429698911372276, - "1,4,7": 0.1451363461647118, - "1,5,6": 0.22769965836636039, - "1,5,7": 0.08283967571743583, - "1,6,7": 0.36441263413527814, - "2,3,4": 0.14407303269150132, - "2,3,5": 0.12891099830037986, - "2,3,6": 0.14197871773087253, - "2,3,7": 0.1516632059632632, - "2,4,5": 0.12322043816054785, - "2,4,6": 0.14641637224293433, - "2,4,7": 0.148868719869761, - "2,5,6": 0.19551277650158916, - "2,5,7": 0.28044958536443654, - "2,6,7": 0.17010461587077116, - "3,4,5": 0.15231507917675122, - "3,4,6": 0.144981607850767, - "3,4,7": 0.14387090389413218, - "3,5,6": 0.15760481268943188, - "3,5,7": 0.09914585808327181, - "3,6,7": 0.12439795428083385, - "4,5,6": 0.14788051143458844, - "4,5,7": 0.1616441165091115, - "4,6,7": 0.14881732628089706, - "5,6,7": 0.17199781545835355, - "0,1,2,3": -0.07175755076837775, - "0,1,2,4": -0.08487236006698728, - "0,1,2,5": -0.018296712004990945, - "0,1,2,6": -0.15386250520385458, - "0,1,2,7": -0.0624310147509789, - "0,1,3,4": -0.08930369738569277, - "0,1,3,5": 0.006776080540828011, - "0,1,3,6": -0.13700331364252816, - "0,1,3,7": -0.1152074826596412, - "0,1,4,5": -0.10737658222065793, - "0,1,4,6": -0.0846281456018394, - "0,1,4,7": -0.07732790082671614, - "0,1,5,6": 0.054342596183115544, - "0,1,5,7": -0.1629557918127923, - "0,1,6,7": 0.46760831281561777, - "0,2,3,4": -0.09270954397607845, - "0,2,3,5": -0.06364274195824171, - "0,2,3,6": -0.08843054453887234, - "0,2,3,7": -0.09377026370811181, - "0,2,4,5": -0.08365835977712066, - "0,2,4,6": -0.09449296994909673, - "0,2,4,7": -0.09306497678084857, - "0,2,5,6": -0.2595910362957058, - "0,2,5,7": -0.17905067070450087, - "0,2,6,7": -0.10717062108606468, - "0,3,4,5": -0.09471603354079017, - "0,3,4,6": -0.09551610434615332, - "0,3,4,7": -0.0932134199870075, - "0,3,5,6": -0.1314307153883698, - "0,3,5,7": -0.10600340588109392, - "0,3,6,7": -0.10062956461804307, - "0,4,5,6": -0.0995986070537409, - "0,4,5,7": -0.08535872021146096, - "0,4,6,7": -0.05239959520973958, - "0,5,6,7": -0.24749570897722317, - "1,2,3,4": -0.095303456495619, - "1,2,3,5": -0.07955374384174152, - "1,2,3,6": -0.09250895704948414, - "1,2,3,7": -0.07681868915326917, - "1,2,4,5": -0.08882005063972676, - "1,2,4,6": -0.0898390133260869, - "1,2,4,7": -0.09409445173570252, - "1,2,5,6": -0.06622256908784485, - "1,2,5,7": -0.07362759886181114, - "1,2,6,7": -0.11574901090823175, - "1,3,4,5": -0.08289051388897728, - "1,3,4,6": -0.09314829059083074, - "1,3,4,7": -0.09224871707355597, - "1,3,5,6": -0.10769783672499411, - "1,3,5,7": -0.09600279493785635, - "1,3,6,7": -0.14002322110557286, - "1,4,5,6": -0.08165695425789321, - "1,4,5,7": -0.0970811682633913, - "1,4,6,7": -0.08136619940196566, - "1,5,6,7": -0.15444697596501278, - "2,3,4,5": -0.10189462192581011, - "2,3,4,6": -0.09409511311965679, - "2,3,4,7": -0.09296052052339654, - "2,3,5,6": -0.08435945813184187, - "2,3,5,7": -0.10714226852829678, - "2,3,6,7": -0.07181866872193354, - "2,4,5,6": -0.09453115827897896, - "2,4,5,7": -0.10561081958459351, - "2,4,6,7": -0.08485643365912954, - "2,5,6,7": -0.09460685178331163, - "3,4,5,6": -0.09609783366506264, - "3,4,5,7": -0.09808733411597248, - "3,4,6,7": -0.09341508212071248, - "3,5,6,7": -0.07444748091623632, - "4,5,6,7": -0.10214441799475349, - "0,1,2,3,4": 0.03613598978722554, - "0,1,2,3,5": 0.014905859427644552, - "0,1,2,3,6": 0.043199375239835414, - "0,1,2,3,7": 0.018532081726269967, - "0,1,2,4,5": 0.04177986378463472, - "0,1,2,4,6": 0.027535896808872584, - "0,1,2,4,7": 0.039255866296110886, - "0,1,2,5,6": 0.07134133700538459, - "0,1,2,5,7": 0.030519155035031664, - "0,1,2,6,7": 0.08117110533915617, - "0,1,3,4,5": 0.038407316375976164, - "0,1,3,4,6": 0.035484926102501424, - "0,1,3,4,7": 0.030909706760935185, - "0,1,3,5,6": 0.09721253366005334, - "0,1,3,5,7": 0.03186251232035575, - "0,1,3,6,7": -0.015404144675851716, - "0,1,4,5,6": 0.009788158249699475, - "0,1,4,5,7": 0.01952034063545005, - "0,1,4,6,7": 0.04881414267765405, - "0,1,5,6,7": -0.3901770292616058, - "0,2,3,4,5": 0.04375868241568415, - "0,2,3,4,6": 0.0342613110744423, - "0,2,3,4,7": 0.0330882795411902, - "0,2,3,5,6": 0.024841442491174925, - "0,2,3,5,7": 0.031255597153092785, - "0,2,3,6,7": 0.019350334591623275, - "0,2,4,5,6": 0.039108078045873684, - "0,2,4,5,7": 0.03341648053387103, - "0,2,4,6,7": 0.03827965810646128, - "0,2,5,6,7": 0.016699612042094136, - "0,3,4,5,6": 0.047235865845346225, - "0,3,4,5,7": 0.02998256578151315, - "0,3,4,6,7": 0.03724861417539582, - "0,3,5,6,7": 0.09642613075936679, - "0,4,5,6,7": -0.013889311710381325, - "1,2,3,4,5": 0.03034735835864799, - "1,2,3,4,6": 0.03351959130602067, - "1,2,3,4,7": 0.033124013407105135, - "1,2,3,5,6": 0.011245959761518876, - "1,2,3,5,7": 0.03219908770623947, - "1,2,3,6,7": 0.04098524764362477, - "1,2,4,5,6": 0.028880447042112678, - "1,2,4,5,7": 0.03425904964301507, - "1,2,4,6,7": 0.02721872353326127, - "1,2,5,6,7": 0.059291883732363715, - "1,3,4,5,6": 0.03641870314739726, - "1,3,4,5,7": 0.03363674569296138, - "1,3,4,6,7": 0.03242194066534654, - "1,3,5,6,7": 0.13777371096685842, - "1,4,5,6,7": 0.019999418633177113, - "2,3,4,5,6": 0.03299996838925656, - "2,3,4,5,7": 0.033513705136428484, - "2,3,4,6,7": 0.03313947158379671, - "2,3,5,6,7": 0.025683518283285967, - "2,4,5,6,7": 0.02745283977188029, - "3,4,5,6,7": 0.04048724043384189 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=k-SII_order=6.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=k-SII_order=6.json deleted file mode 100644 index f600d142d..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=k-SII_order=6.json +++ /dev/null @@ -1,266 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.192582+00:00Z", - "metadata": { - "n_players": 8, - "index": "k-SII", - "max_order": 6, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.0591675062728614 - }, - "data": { - "0": -0.11901440324578315, - "1": 0.32800278751964995, - "2": 0.1214056051649933, - "3": 0.1868754420453414, - "4": 0.1351832543774183, - "5": 0.8869126660081477, - "6": 0.06291486504092582, - "7": 0.5877154502329339, - "0,1": -0.11890334659474122, - "0,2": -0.08353952009853854, - "0,3": -0.1785404917125238, - "0,4": -0.12382113231103836, - "0,5": 0.12228086169018136, - "0,6": -0.26159848734808183, - "0,7": -0.07287927335980258, - "1,2": -0.15650771946128583, - "1,3": -0.11069804876694489, - "1,4": -0.13652896195745987, - "1,5": -0.08734786957345107, - "1,6": -0.15173429966879967, - "1,7": -0.09775141956621504, - "2,3": -0.13525325827928947, - "2,4": -0.12118679780418502, - "2,5": -0.11604568137598067, - "2,6": -0.18249643311955965, - "2,7": -0.125400257484475, - "3,4": -0.13125923300310668, - "3,5": -0.10391104862816379, - "3,6": -0.14099702525635746, - "3,7": -0.11921880200981483, - "4,5": -0.12693008888309873, - "4,6": -0.13360618515838088, - "4,7": -0.12926317436143758, - "5,6": -0.03962631441987619, - "5,7": -0.19846649716893855, - "6,7": 0.07008384337345412, - "0,1,2": 0.06865179691967246, - "0,1,3": 0.1365511113836521, - "0,1,4": 0.16133928550456492, - "0,1,5": 0.1987590731568993, - "0,1,6": 0.1279067997355242, - "0,1,7": 0.24479185344663576, - "0,2,3": 0.14077409347256192, - "0,2,4": 0.13381705633190338, - "0,2,5": 0.22656488663246527, - "0,2,6": 0.30684619322309054, - "0,2,7": 0.1322333657496894, - "0,3,4": 0.13961295354097197, - "0,3,5": 0.22964815273820122, - "0,3,6": 0.1490826461440151, - "0,3,7": 0.12921705481811677, - "0,4,5": 0.18279770506256293, - "0,4,6": 0.1422162295223724, - "0,4,7": 0.140832153284839, - "0,5,6": 0.3508022268631594, - "0,5,7": -0.028834883311692476, - "0,6,7": 0.3436397477799854, - "1,2,3": 0.13169594110082758, - "1,2,4": 0.1376832173439772, - "1,2,5": 0.17599245282075046, - "1,2,6": 0.0992381840472867, - "1,2,7": 0.15224901684289777, - "1,3,4": 0.13933951274802017, - "1,3,5": 0.10260172990866273, - "1,3,6": 0.14630264899245446, - "1,3,7": 0.12999839778389077, - "1,4,5": 0.14876917525649747, - "1,4,6": 0.1429698911372276, - "1,4,7": 0.1451363461647118, - "1,5,6": 0.22769965836636039, - "1,5,7": 0.08283967571743583, - "1,6,7": 0.36441263413527814, - "2,3,4": 0.14407303269150132, - "2,3,5": 0.12891099830037986, - "2,3,6": 0.14197871773087253, - "2,3,7": 0.1516632059632632, - "2,4,5": 0.12322043816054785, - "2,4,6": 0.14641637224293433, - "2,4,7": 0.148868719869761, - "2,5,6": 0.19551277650158916, - "2,5,7": 0.28044958536443654, - "2,6,7": 0.17010461587077116, - "3,4,5": 0.15231507917675122, - "3,4,6": 0.144981607850767, - "3,4,7": 0.14387090389413218, - "3,5,6": 0.15760481268943188, - "3,5,7": 0.09914585808327181, - "3,6,7": 0.12439795428083385, - "4,5,6": 0.14788051143458844, - "4,5,7": 0.1616441165091115, - "4,6,7": 0.14881732628089706, - "5,6,7": 0.17199781545835355, - "0,1,2,3": -0.12265382072713656, - "0,1,2,4": -0.12747403402666235, - "0,1,2,5": -0.06947583045809798, - "0,1,2,6": -0.20463457392768894, - "0,1,2,7": -0.11252983693515932, - "0,1,3,4": -0.13338008904675833, - "0,1,3,5": -0.025234684748982307, - "0,1,3,6": -0.1658323850973857, - "0,1,3,7": -0.14531386689634848, - "0,1,4,5": -0.15411444399375132, - "0,1,4,6": -0.13455014815737784, - "0,1,4,7": -0.12662093909251987, - "0,1,5,6": 0.019193129970418596, - "0,1,5,7": -0.1983099364265328, - "0,1,6,7": 0.4342220186322413, - "0,2,3,4": -0.13602490069638223, - "0,2,3,5": -0.11718124578799309, - "0,2,3,6": -0.1391659997347617, - "0,2,3,7": -0.14505094491874493, - "0,2,4,5": -0.12508488883774804, - "0,2,4,6": -0.13948228499325993, - "0,2,4,7": -0.13669324076817108, - "0,2,5,6": -0.31209658847773036, - "0,2,5,7": -0.231028814520463, - "0,2,6,7": -0.15755955967275348, - "0,3,4,5": -0.13684497865924872, - "0,3,4,6": -0.13843319134246757, - "0,3,4,7": -0.13672001524798472, - "0,3,5,6": -0.1612209686578582, - "0,3,5,7": -0.1372168101060236, - "0,3,6,7": -0.1274791195080193, - "0,4,5,6": -0.14666441265386992, - "0,4,5,7": -0.13194139969544683, - "0,4,6,7": -0.1009842599761698, - "0,5,6,7": -0.28108027273601965, - "1,2,3,4": -0.13864515899080795, - "1,2,3,5": -0.13410650858536768, - "1,2,3,6": -0.14419202293994954, - "1,2,3,7": -0.12926927947219008, - "1,2,4,5": -0.13120221895083933, - "1,2,4,6": -0.13571731740143653, - "1,2,4,7": -0.13883400316792321, - "1,2,5,6": -0.12060502544004545, - "1,2,5,7": -0.1277049452616611, - "1,2,6,7": -0.1681705018595096, - "1,3,4,5": -0.12647605029706652, - "1,3,4,6": -0.13745531865747693, - "1,3,4,7": -0.13736755181857688, - "1,3,5,6": -0.13986594620380408, - "1,3,5,7": -0.12981635378581935, - "1,3,6,7": -0.16940628039928365, - "1,4,5,6": -0.1310419944039542, - "1,4,5,7": -0.14620538070702088, - "1,4,6,7": -0.13242574690874084, - "1,5,6,7": -0.19149433760314377, - "2,3,4,5": -0.1450485632889712, - "2,3,4,6": -0.1383491913424656, - "2,3,4,7": -0.13729431865747407, - "2,3,5,6": -0.13876339124751727, - "2,3,5,7": -0.16245956424601923, - "2,3,6,7": -0.1230841100864946, - "2,4,5,6": -0.13931295080949832, - "2,4,5,7": -0.1493996976455755, - "2,4,6,7": -0.1309592919843479, - "2,5,6,7": -0.14898629772058866, - "3,4,5,6": -0.13853604854331925, - "3,4,5,7": -0.14148319384619537, - "3,4,6,7": -0.13635027800949165, - "3,5,6,7": -0.10501619355238698, - "4,5,6,7": -0.15057224007392828, - "0,1,2,3,4": 0.09996787919291539, - "0,1,2,3,5": 0.10047281507259254, - "0,1,2,3,6": 0.12037255340425157, - "0,1,2,3,7": 0.09733767826376882, - "0,1,2,4,5": 0.09993223526820405, - "0,1,2,4,6": 0.09639199466410353, - "0,1,2,4,7": 0.10402555130967117, - "0,1,2,5,6": 0.1538117711851149, - "0,1,2,5,7": 0.11140410444542626, - "0,1,2,6,7": 0.15730380748278494, - "0,1,3,4,5": 0.10310785215218299, - "0,1,3,4,6": 0.10256525593332955, - "0,1,3,4,7": 0.09975530171460367, - "0,1,3,5,6": 0.11597798722131925, - "0,1,3,5,7": 0.054894159076796956, - "0,1,3,6,7": -0.005448677503216648, - "0,1,4,5,6": 0.08930160894888062, - "0,1,4,5,7": 0.09758115331505313, - "0,1,4,6,7": 0.13289627962564443, - "0,1,5,6,7": -0.36002957042560146, - "0,2,3,4,5": 0.10691194467529186, - "0,2,3,4,6": 0.10093030299194361, - "0,2,3,4,7": 0.09932627628021395, - "0,2,3,5,6": 0.11006187858122252, - "0,2,3,5,7": 0.11854596613699775, - "0,2,3,6,7": 0.0947004595949944, - "0,2,4,5,6": 0.1045592975166153, - "0,2,4,5,7": 0.09521880168371666, - "0,2,4,6,7": 0.10723923912796651, - "0,2,5,6,7": 0.09859083539372182, - "0,3,4,5,6": 0.10859441236100709, - "0,3,4,5,7": 0.09354389194078905, - "0,3,4,6,7": 0.09964326788929101, - "0,3,5,6,7": 0.10982321420932284, - "0,4,5,6,7": 0.062182305204809274, - "1,2,3,4,5": 0.09346431419291179, - "1,2,3,4,6": 0.09995232614028182, - "1,2,3,4,7": 0.09979264830402401, - "1,2,3,5,6": 0.09919388418529518, - "1,2,3,5,7": 0.12288384026500843, - "1,2,3,6,7": 0.11952980556396364, - "1,2,4,5,6": 0.09688328985641415, - "1,2,4,5,7": 0.09927988937755583, - "1,2,4,6,7": 0.09919687248156539, - "1,2,5,6,7": 0.14716542042775915, - "1,3,4,5,6": 0.10183172912405447, - "1,3,4,5,7": 0.10191944655436891, - "1,3,4,6,7": 0.09933801842347711, - "1,3,5,6,7": 0.15865596387801872, - "1,4,5,6,7": 0.1033803400194031, - "2,3,4,5,6": 0.09898997614008787, - "2,3,4,5,7": 0.10017712747069218, - "2,3,4,6,7": 0.09957220641805575, - "2,3,5,6,7": 0.11294874871268323, - "2,4,5,6,7": 0.09669952491912204, - "3,4,5,6,7": 0.10235494946023216, - "0,1,2,3,4,5": -0.038135965398280236, - "0,1,2,3,4,6": -0.04519816155617584, - "0,1,2,3,4,7": -0.04432965185692361, - "0,1,2,3,5,6": -0.06443229972309905, - "0,1,2,3,5,7": -0.06856564616851668, - "0,1,2,3,6,7": -0.04471589504955742, - "0,1,2,4,5,6": -0.04273654677647376, - "0,1,2,4,5,7": -0.03543223079238467, - "0,1,2,4,6,7": -0.04977748737781229, - "0,1,2,5,6,7": -0.057772021859887834, - "0,1,3,4,5,6": -0.04343303310460023, - "0,1,3,4,5,7": -0.047832073049533186, - "0,1,3,4,6,7": -0.045529465000880176, - "0,1,3,5,6,7": 0.07033442570516746, - "0,1,4,5,6,7": -0.0728573215172883, - "0,2,3,4,5,6": -0.044082019889319035, - "0,2,3,4,5,7": -0.04408853923161615, - "0,2,3,4,6,7": -0.04405780238950774, - "0,2,3,5,6,7": -0.061926552567677096, - "0,2,4,5,6,7": -0.04408387227569044, - "0,3,4,5,6,7": -0.03520204003740246, - "1,2,3,4,5,6": -0.04337881822283984, - "1,2,3,4,5,7": -0.04471912804740752, - "1,2,3,4,6,7": -0.04428848988950662, - "1,2,3,5,6,7": -0.06808473090161371, - "1,2,4,5,6,7": -0.04989032062928933, - "1,3,4,5,6,7": -0.044014200625874356, - "2,3,4,5,6,7": -0.04451917738950373 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=k-SII_order=7.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=k-SII_order=7.json deleted file mode 100644 index e9f1e63c6..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=k-SII_order=7.json +++ /dev/null @@ -1,274 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.191499+00:00Z", - "metadata": { - "n_players": 8, - "index": "k-SII", - "max_order": 7, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.0591675062728614 - }, - "data": { - "0": -0.10884543348952333, - "1": 0.33816077215686197, - "2": 0.13166499732412, - "3": 0.19706525986539034, - "4": 0.1460912672248238, - "5": 0.8970816357644069, - "6": 0.07310434137613266, - "7": 0.597927737687606, - "0,1": -0.11890334659474122, - "0,2": -0.08353952009853854, - "0,3": -0.1785404917125238, - "0,4": -0.12382113231103836, - "0,5": 0.12228086169018136, - "0,6": -0.26159848734808183, - "0,7": -0.07287927335980258, - "1,2": -0.15650771946128583, - "1,3": -0.11069804876694489, - "1,4": -0.13652896195745987, - "1,5": -0.08734786957345107, - "1,6": -0.15173429966879967, - "1,7": -0.09775141956621504, - "2,3": -0.13525325827928947, - "2,4": -0.12118679780418502, - "2,5": -0.11604568137598067, - "2,6": -0.18249643311955965, - "2,7": -0.125400257484475, - "3,4": -0.13125923300310668, - "3,5": -0.10391104862816379, - "3,6": -0.14099702525635746, - "3,7": -0.11921880200981483, - "4,5": -0.12693008888309873, - "4,6": -0.13360618515838088, - "4,7": -0.12926317436143758, - "5,6": -0.03962631441987619, - "5,7": -0.19846649716893855, - "6,7": 0.07008384337345412, - "0,1,2": 0.058732876052527486, - "0,1,3": 0.12672959459121583, - "0,1,4": 0.15051229567383112, - "0,1,5": 0.1889667436537686, - "0,1,6": 0.11808576102186696, - "0,1,7": 0.2349388791657272, - "0,2,3": 0.13081060614944523, - "0,2,4": 0.12284809597048917, - "0,2,5": 0.21663058659865414, - "0,2,6": 0.29688318397875285, - "0,2,7": 0.12223842093810042, - "0,3,4": 0.12874139725426645, - "0,3,5": 0.21981125677909877, - "0,3,6": 0.1392170409743861, - "0,3,7": 0.11931951408123646, - "0,4,5": 0.17195533606516297, - "0,4,6": 0.1313451513144459, - "0,4,7": 0.1299291395096612, - "0,5,6": 0.34096580898283596, - "0,5,7": -0.03870323675926721, - "0,6,7": 0.33374268512188415, - "1,2,3": 0.12174783294437783, - "1,2,4": 0.12672963614922994, - "1,2,5": 0.16607353195360627, - "1,2,6": 0.08929055396961595, - "1,2,7": 0.14226945119797574, - "1,3,4": 0.1284833356279816, - "1,3,5": 0.09278021311622722, - "1,3,6": 0.13645242298949242, - "1,3,7": 0.12011623621367742, - "1,4,5": 0.13794218542576445, - "1,4,6": 0.13211419209596806, - "1,4,7": 0.13424871155620094, - "1,5,6": 0.21787861965270391, - "1,5,7": 0.07298670143652805, - "1,6,7": 0.3545309506438438, - "2,3,4": 0.13307488504078233, - "2,3,5": 0.11894751097726393, - "2,3,6": 0.1319865211972301, - "2,3,7": 0.14163907386236943, - "2,4,5": 0.11225147779913439, - "2,4,6": 0.13541870267099437, - "2,4,7": 0.13783911473056973, - "2,5,6": 0.18554976725725228, - "2,5,7": 0.2704546405528483, - "2,6,7": 0.16008096184865644, - "3,4,5": 0.14144352289004647, - "3,4,6": 0.13408134235353572, - "3,4,7": 0.1329387028296496, - "3,5,6": 0.14773920751980368, - "3,5,7": 0.08924831734639228, - "3,6,7": 0.1144717043334278, - "4,5,6": 0.13700943322666273, - "4,5,7": 0.15074110273393448, - "4,6,7": 0.1378856032951935, - "5,6,7": 0.16210075280025307, - "0,1,2,3": -0.12265382072713656, - "0,1,2,4": -0.12747403402666235, - "0,1,2,5": -0.06947583045809798, - "0,1,2,6": -0.20463457392768894, - "0,1,2,7": -0.11252983693515932, - "0,1,3,4": -0.13338008904675833, - "0,1,3,5": -0.025234684748982307, - "0,1,3,6": -0.1658323850973857, - "0,1,3,7": -0.14531386689634848, - "0,1,4,5": -0.15411444399375132, - "0,1,4,6": -0.13455014815737784, - "0,1,4,7": -0.12662093909251987, - "0,1,5,6": 0.019193129970418596, - "0,1,5,7": -0.1983099364265328, - "0,1,6,7": 0.4342220186322413, - "0,2,3,4": -0.13602490069638223, - "0,2,3,5": -0.11718124578799309, - "0,2,3,6": -0.1391659997347617, - "0,2,3,7": -0.14505094491874493, - "0,2,4,5": -0.12508488883774804, - "0,2,4,6": -0.13948228499325993, - "0,2,4,7": -0.13669324076817108, - "0,2,5,6": -0.31209658847773036, - "0,2,5,7": -0.231028814520463, - "0,2,6,7": -0.15755955967275348, - "0,3,4,5": -0.13684497865924872, - "0,3,4,6": -0.13843319134246757, - "0,3,4,7": -0.13672001524798472, - "0,3,5,6": -0.1612209686578582, - "0,3,5,7": -0.1372168101060236, - "0,3,6,7": -0.1274791195080193, - "0,4,5,6": -0.14666441265386992, - "0,4,5,7": -0.13194139969544683, - "0,4,6,7": -0.1009842599761698, - "0,5,6,7": -0.28108027273601965, - "1,2,3,4": -0.13864515899080795, - "1,2,3,5": -0.13410650858536768, - "1,2,3,6": -0.14419202293994954, - "1,2,3,7": -0.12926927947219008, - "1,2,4,5": -0.13120221895083933, - "1,2,4,6": -0.13571731740143653, - "1,2,4,7": -0.13883400316792321, - "1,2,5,6": -0.12060502544004545, - "1,2,5,7": -0.1277049452616611, - "1,2,6,7": -0.1681705018595096, - "1,3,4,5": -0.12647605029706652, - "1,3,4,6": -0.13745531865747693, - "1,3,4,7": -0.13736755181857688, - "1,3,5,6": -0.13986594620380408, - "1,3,5,7": -0.12981635378581935, - "1,3,6,7": -0.16940628039928365, - "1,4,5,6": -0.1310419944039542, - "1,4,5,7": -0.14620538070702088, - "1,4,6,7": -0.13242574690874084, - "1,5,6,7": -0.19149433760314377, - "2,3,4,5": -0.1450485632889712, - "2,3,4,6": -0.1383491913424656, - "2,3,4,7": -0.13729431865747407, - "2,3,5,6": -0.13876339124751727, - "2,3,5,7": -0.16245956424601923, - "2,3,6,7": -0.1230841100864946, - "2,4,5,6": -0.13931295080949832, - "2,4,5,7": -0.1493996976455755, - "2,4,6,7": -0.1309592919843479, - "2,5,6,7": -0.14898629772058866, - "3,4,5,6": -0.13853604854331925, - "3,4,5,7": -0.14148319384619537, - "3,4,6,7": -0.13635027800949165, - "3,5,6,7": -0.10501619355238698, - "4,5,6,7": -0.15057224007392828, - "0,1,2,3,4": 0.1327374766685239, - "0,1,2,3,5": 0.12806911091017678, - "0,1,2,3,6": 0.1481123952944687, - "0,1,2,3,7": 0.12523719799024274, - "0,1,2,4,5": 0.13255589629728456, - "0,1,2,4,6": 0.12915920174581694, - "0,1,2,4,7": 0.13695243622764136, - "0,1,2,5,6": 0.18140567662880405, - "0,1,2,5,7": 0.13915768772537215, - "0,1,2,6,7": 0.18520093681536373, - "0,1,3,4,5": 0.1352444928077192, - "0,1,3,4,6": 0.13484544264149864, - "0,1,3,4,7": 0.13219516625902955, - "0,1,3,5,6": 0.14308487229146408, - "0,1,3,5,7": 0.08216072198319853, - "0,1,3,6,7": 0.02196143145581782, - "0,1,4,5,6": 0.12143585921052168, - "0,1,4,5,7": 0.12987508141295098, - "0,1,4,6,7": 0.16533375377617518, - "0,1,5,6,7": -0.33276539791309506, - "0,2,3,4,5": 0.1397584379842314, - "0,2,3,4,6": 0.13392034235351605, - "0,2,3,4,7": 0.13247599347804317, - "0,2,3,5,6": 0.13787861630477066, - "0,2,3,5,7": 0.14652238169680268, - "0,2,3,6,7": 0.12282042120743224, - "0,2,4,5,6": 0.13740340043165972, - "0,2,4,5,7": 0.12822258243501786, - "0,2,4,6,7": 0.1403865659319006, - "0,2,5,6,7": 0.12656486055963162, - "0,3,4,5,6": 0.1409514949025072, - "0,3,4,5,7": 0.12606065231854593, - "0,3,4,6,7": 0.1323035743196808, - "0,3,5,6,7": 0.13731021900168833, - "0,4,5,6,7": 0.09469667518867105, - "1,2,3,4,5": 0.12623391166851647, - "1,2,3,4,6": 0.1328654696685194, - "1,2,3,4,7": 0.13286546966851837, - "1,2,3,5,6": 0.12693372607550846, - "1,2,3,5,7": 0.1507833599914785, - "1,2,3,6,7": 0.1475728713430666, - "1,2,4,5,6": 0.1296504969381237, - "1,2,4,5,7": 0.13220677429552216, - "1,2,4,6,7": 0.13226730345216461, - "1,2,5,6,7": 0.1750625497603341, - "1,3,4,5,6": 0.1341119158322197, - "1,3,4,5,7": 0.13435931109879093, - "1,3,4,6,7": 0.13192142902053203, - "1,3,5,6,7": 0.18606607283704937, - "1,4,5,6,7": 0.13581781416993, - "2,3,4,5,6": 0.13198001550165647, - "2,3,4,5,7": 0.13332684466851757, - "2,3,4,6,7": 0.13286546966851404, - "2,3,5,6,7": 0.14106871032511722, - "2,4,5,6,7": 0.1298468517230523, - "3,4,5,6,7": 0.1350152558906181, - "0,1,2,3,4,5": -0.10322839040797471, - "0,1,2,3,4,6": -0.110721224723769, - "0,1,2,3,4,7": -0.11033174853328709, - "0,1,2,3,5,6": -0.11443545797661936, - "0,1,2,3,5,7": -0.11904783793080731, - "0,1,2,3,6,7": -0.09562872496974673, - "0,1,2,4,5,6": -0.10782180060448288, - "0,1,2,4,5,7": -0.1009965181291641, - "0,1,2,4,6,7": -0.1157724128724904, - "0,1,2,5,6,7": -0.1082470424404931, - "0,1,3,4,5,6": -0.10705722581197641, - "0,1,3,4,5,7": -0.11193529926567969, - "0,1,3,4,6,7": -0.11006332937492536, - "0,1,3,5,6,7": 0.021320466245195124, - "0,1,4,5,6,7": -0.13695337655174944, - "0,2,3,4,5,6": -0.1098357705569053, - "0,2,3,4,5,7": -0.11032132340797274, - "0,2,3,4,6,7": -0.110721224723763, - "0,2,3,5,6,7": -0.11307006998785951, - "0,2,4,5,6,7": -0.11030948527036166, - "0,3,4,5,6,7": -0.09996659191144075, - "1,2,3,4,5,6": -0.10890188139042145, - "1,2,3,4,5,7": -0.11072122472375945, - "1,2,3,4,6,7": -0.11072122472375723, - "1,2,3,5,6,7": -0.11899756082179147, - "1,2,4,5,6,7": -0.1158852461239559, - "1,3,4,5,6,7": -0.10854806499990799, - "2,3,4,5,6,7": -0.11118259972374744, - "0,1,2,3,4,5,6": 0.06461339150092416, - "0,1,2,3,4,5,7": 0.0655714585184648, - "0,1,2,3,4,6,7": 0.06643273483426215, - "0,1,2,3,5,6,7": 0.03539292500611646, - "0,1,2,4,5,6,7": 0.06555711615509408, - "0,1,3,4,5,6,7": 0.06263499391382821, - "0,2,3,4,5,6,7": 0.06689410983424837, - "1,2,3,4,5,6,7": 0.06643273483423906 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=k-SII_order=8.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=k-SII_order=8.json deleted file mode 100644 index 5aea5fd8f..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_imputer_9070456741283270540_index=k-SII_order=8.json +++ /dev/null @@ -1,275 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.245191+00:00Z", - "metadata": { - "n_players": 8, - "index": "k-SII", - "max_order": 8, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.0591675062728614 - }, - "data": { - "0": -0.10884543348952333, - "1": 0.33816077215686197, - "2": 0.13166499732412, - "3": 0.19706525986539034, - "4": 0.1460912672248238, - "5": 0.8970816357644069, - "6": 0.07310434137613266, - "7": 0.597927737687606, - "0,1": -0.12206681015827602, - "0,2": -0.08670298366207334, - "0,3": -0.1817039552760586, - "0,4": -0.12698459587457314, - "0,5": 0.11911739812664657, - "0,6": -0.26476195091161664, - "0,7": -0.07604273692333738, - "1,2": -0.1596711830248206, - "1,3": -0.11386151233047968, - "1,4": -0.13969242552099465, - "1,5": -0.09051133313698587, - "1,6": -0.15489776323233445, - "1,7": -0.10091488312974983, - "2,3": -0.13841672184282425, - "2,4": -0.12435026136771982, - "2,5": -0.11920914493951547, - "2,6": -0.18565989668309443, - "2,7": -0.12856372104800978, - "3,4": -0.13442269656664146, - "3,5": -0.10707451219169858, - "3,6": -0.14416048881989224, - "3,7": -0.12238226557334962, - "4,5": -0.1300935524466335, - "4,6": -0.13676964872191566, - "4,7": -0.13242663792497236, - "5,6": -0.04278977798341098, - "5,7": -0.20162996073247333, - "6,7": 0.06692037980991933, - "0,1,2": 0.058732876052527486, - "0,1,3": 0.12672959459121583, - "0,1,4": 0.15051229567383112, - "0,1,5": 0.1889667436537686, - "0,1,6": 0.11808576102186696, - "0,1,7": 0.2349388791657272, - "0,2,3": 0.13081060614944523, - "0,2,4": 0.12284809597048917, - "0,2,5": 0.21663058659865414, - "0,2,6": 0.29688318397875285, - "0,2,7": 0.12223842093810042, - "0,3,4": 0.12874139725426645, - "0,3,5": 0.21981125677909877, - "0,3,6": 0.1392170409743861, - "0,3,7": 0.11931951408123646, - "0,4,5": 0.17195533606516297, - "0,4,6": 0.1313451513144459, - "0,4,7": 0.1299291395096612, - "0,5,6": 0.34096580898283596, - "0,5,7": -0.03870323675926721, - "0,6,7": 0.33374268512188415, - "1,2,3": 0.12174783294437783, - "1,2,4": 0.12672963614922994, - "1,2,5": 0.16607353195360627, - "1,2,6": 0.08929055396961595, - "1,2,7": 0.14226945119797574, - "1,3,4": 0.1284833356279816, - "1,3,5": 0.09278021311622722, - "1,3,6": 0.13645242298949242, - "1,3,7": 0.12011623621367742, - "1,4,5": 0.13794218542576445, - "1,4,6": 0.13211419209596806, - "1,4,7": 0.13424871155620094, - "1,5,6": 0.21787861965270391, - "1,5,7": 0.07298670143652805, - "1,6,7": 0.3545309506438438, - "2,3,4": 0.13307488504078233, - "2,3,5": 0.11894751097726393, - "2,3,6": 0.1319865211972301, - "2,3,7": 0.14163907386236943, - "2,4,5": 0.11225147779913439, - "2,4,6": 0.13541870267099437, - "2,4,7": 0.13783911473056973, - "2,5,6": 0.18554976725725228, - "2,5,7": 0.2704546405528483, - "2,6,7": 0.16008096184865644, - "3,4,5": 0.14144352289004647, - "3,4,6": 0.13408134235353572, - "3,4,7": 0.1329387028296496, - "3,5,6": 0.14773920751980368, - "3,5,7": 0.08924831734639228, - "3,6,7": 0.1144717043334278, - "4,5,6": 0.13700943322666273, - "4,5,7": 0.15074110273393448, - "4,6,7": 0.1378856032951935, - "5,6,7": 0.16210075280025307, - "0,1,2,3": -0.11822497173819521, - "0,1,2,4": -0.12304518503772101, - "0,1,2,5": -0.06504698146915663, - "0,1,2,6": -0.20020572493874758, - "0,1,2,7": -0.10810098794621797, - "0,1,3,4": -0.12895124005781697, - "0,1,3,5": -0.020805835760040962, - "0,1,3,6": -0.16140353610844435, - "0,1,3,7": -0.14088501790740712, - "0,1,4,5": -0.14968559500480996, - "0,1,4,6": -0.13012129916843648, - "0,1,4,7": -0.12219209010357852, - "0,1,5,6": 0.02362197895935994, - "0,1,5,7": -0.19388108743759144, - "0,1,6,7": 0.43865086762118266, - "0,2,3,4": -0.13159605170744088, - "0,2,3,5": -0.11275239679905175, - "0,2,3,6": -0.13473715074582035, - "0,2,3,7": -0.14062209592980357, - "0,2,4,5": -0.1206560398488067, - "0,2,4,6": -0.13505343600431857, - "0,2,4,7": -0.13226439177922972, - "0,2,5,6": -0.307667739488789, - "0,2,5,7": -0.22659996553152165, - "0,2,6,7": -0.15313071068381212, - "0,3,4,5": -0.13241612967030736, - "0,3,4,6": -0.1340043423535262, - "0,3,4,7": -0.13229116625904336, - "0,3,5,6": -0.15679211966891685, - "0,3,5,7": -0.13278796111708224, - "0,3,6,7": -0.12305027051907795, - "0,4,5,6": -0.14223556366492857, - "0,4,5,7": -0.12751255070650547, - "0,4,6,7": -0.09655541098722846, - "0,5,6,7": -0.2766514237470783, - "1,2,3,4": -0.1342163100018666, - "1,2,3,5": -0.12967765959642633, - "1,2,3,6": -0.13976317395100818, - "1,2,3,7": -0.12484043048324873, - "1,2,4,5": -0.12677336996189797, - "1,2,4,6": -0.13128846841249517, - "1,2,4,7": -0.13440515417898186, - "1,2,5,6": -0.1161761764511041, - "1,2,5,7": -0.12327609627271975, - "1,2,6,7": -0.16374165287056824, - "1,3,4,5": -0.12204720130812517, - "1,3,4,6": -0.13302646966853557, - "1,3,4,7": -0.13293870282963552, - "1,3,5,6": -0.13543709721486272, - "1,3,5,7": -0.125387504796878, - "1,3,6,7": -0.1649774314103423, - "1,4,5,6": -0.12661314541501284, - "1,4,5,7": -0.14177653171807952, - "1,4,6,7": -0.12799689791979948, - "1,5,6,7": -0.1870654886142024, - "2,3,4,5": -0.14061971430002984, - "2,3,4,6": -0.13392034235352424, - "2,3,4,7": -0.13286546966853272, - "2,3,5,6": -0.1343345422585759, - "2,3,5,7": -0.15803071525707788, - "2,3,6,7": -0.11865526109755326, - "2,4,5,6": -0.13488410182055696, - "2,4,5,7": -0.14497084865663415, - "2,4,6,7": -0.12653044299540653, - "2,5,6,7": -0.1445574487316473, - "3,4,5,6": -0.1341071995543779, - "3,4,5,7": -0.137054344857254, - "3,4,6,7": -0.1319214290205503, - "3,5,6,7": -0.10058734456344563, - "4,5,6,7": -0.14614339108498692, - "0,1,2,3,4": 0.1327374766685239, - "0,1,2,3,5": 0.12806911091017678, - "0,1,2,3,6": 0.1481123952944687, - "0,1,2,3,7": 0.12523719799024274, - "0,1,2,4,5": 0.13255589629728456, - "0,1,2,4,6": 0.12915920174581694, - "0,1,2,4,7": 0.13695243622764136, - "0,1,2,5,6": 0.18140567662880405, - "0,1,2,5,7": 0.13915768772537215, - "0,1,2,6,7": 0.18520093681536373, - "0,1,3,4,5": 0.1352444928077192, - "0,1,3,4,6": 0.13484544264149864, - "0,1,3,4,7": 0.13219516625902955, - "0,1,3,5,6": 0.14308487229146408, - "0,1,3,5,7": 0.08216072198319853, - "0,1,3,6,7": 0.02196143145581782, - "0,1,4,5,6": 0.12143585921052168, - "0,1,4,5,7": 0.12987508141295098, - "0,1,4,6,7": 0.16533375377617518, - "0,1,5,6,7": -0.33276539791309506, - "0,2,3,4,5": 0.1397584379842314, - "0,2,3,4,6": 0.13392034235351605, - "0,2,3,4,7": 0.13247599347804317, - "0,2,3,5,6": 0.13787861630477066, - "0,2,3,5,7": 0.14652238169680268, - "0,2,3,6,7": 0.12282042120743224, - "0,2,4,5,6": 0.13740340043165972, - "0,2,4,5,7": 0.12822258243501786, - "0,2,4,6,7": 0.1403865659319006, - "0,2,5,6,7": 0.12656486055963162, - "0,3,4,5,6": 0.1409514949025072, - "0,3,4,5,7": 0.12606065231854593, - "0,3,4,6,7": 0.1323035743196808, - "0,3,5,6,7": 0.13731021900168833, - "0,4,5,6,7": 0.09469667518867105, - "1,2,3,4,5": 0.12623391166851647, - "1,2,3,4,6": 0.1328654696685194, - "1,2,3,4,7": 0.13286546966851837, - "1,2,3,5,6": 0.12693372607550846, - "1,2,3,5,7": 0.1507833599914785, - "1,2,3,6,7": 0.1475728713430666, - "1,2,4,5,6": 0.1296504969381237, - "1,2,4,5,7": 0.13220677429552216, - "1,2,4,6,7": 0.13226730345216461, - "1,2,5,6,7": 0.1750625497603341, - "1,3,4,5,6": 0.1341119158322197, - "1,3,4,5,7": 0.13435931109879093, - "1,3,4,6,7": 0.13192142902053203, - "1,3,5,6,7": 0.18606607283704937, - "1,4,5,6,7": 0.13581781416993, - "2,3,4,5,6": 0.13198001550165647, - "2,3,4,5,7": 0.13332684466851757, - "2,3,4,6,7": 0.13286546966851404, - "2,3,5,6,7": 0.14106871032511722, - "2,4,5,6,7": 0.1298468517230523, - "3,4,5,6,7": 0.1350152558906181, - "0,1,2,3,4,5": -0.12537263535271959, - "0,1,2,3,4,6": -0.13286546966851387, - "0,1,2,3,4,7": -0.13247599347803196, - "0,1,2,3,5,6": -0.13657970292136423, - "0,1,2,3,5,7": -0.14119208287555218, - "0,1,2,3,6,7": -0.1177729699144916, - "0,1,2,4,5,6": -0.12996604554922775, - "0,1,2,4,5,7": -0.12314076307390898, - "0,1,2,4,6,7": -0.13791665781723528, - "0,1,2,5,6,7": -0.13039128738523798, - "0,1,3,4,5,6": -0.12920147075672128, - "0,1,3,4,5,7": -0.13407954421042456, - "0,1,3,4,6,7": -0.13220757431967023, - "0,1,3,5,6,7": -0.0008237786995497487, - "0,1,4,5,6,7": -0.1590976214964943, - "0,2,3,4,5,6": -0.13198001550165017, - "0,2,3,4,5,7": -0.1324655683527176, - "0,2,3,4,6,7": -0.13286546966850787, - "0,2,3,5,6,7": -0.13521431493260438, - "0,2,4,5,6,7": -0.13245373021510654, - "0,3,4,5,6,7": -0.12211083685618562, - "1,2,3,4,5,6": -0.13104612633516632, - "1,2,3,4,5,7": -0.13286546966850432, - "1,2,3,4,6,7": -0.1328654696685021, - "1,2,3,5,6,7": -0.14114180576653634, - "1,2,4,5,6,7": -0.13802949106870077, - "1,3,4,5,6,7": -0.13069230994465286, - "2,3,4,5,6,7": -0.13332684466849232, - "0,1,2,3,4,5,6": 0.13104612633515877, - "0,1,2,3,4,5,7": 0.13200419335269942, - "0,1,2,3,4,6,7": 0.13286546966849677, - "0,1,2,3,5,6,7": 0.10182565984035108, - "0,1,2,4,5,6,7": 0.1319898509893287, - "0,1,3,4,5,6,7": 0.12906772874806283, - "0,2,3,4,5,6,7": 0.133326844668483, - "1,2,3,4,5,6,7": 0.13286546966847368, - "0,1,2,3,4,5,6,7": -0.13286546966846924 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_product_kernel_index=SV_order=1.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_product_kernel_index=SV_order=1.json deleted file mode 100644 index 58150a67e..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_product_kernel_index=SV_order=1.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.1", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-08-28T14:50:39.773932+00:00Z", - "metadata": { - "n_players": 8, - "index": "SV", - "max_order": 1, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 1.6320558236975087 - }, - "data": { - "0": -0.01137975938109087, - "1": 0.06639291459438709, - "2": -0.006749633269077515, - "3": 9.334265149646415e-05, - "4": -0.004101862696053893, - "5": 0.2101012734496271, - "6": -0.0016114443482180274, - "7": 0.002910295793628892 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=BII_order=1.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=BII_order=1.json deleted file mode 100644 index c4c4f3f01..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=BII_order=1.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.221180+00:00Z", - "metadata": { - "n_players": 8, - "index": "BV", - "max_order": 1, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 1.045849735980281 - }, - "data": { - "0": 0.24731994667792678, - "1": 0.4485331318341233, - "2": 0.0658381165967853, - "3": 0.05010673965797067, - "4": 0.02743096467346769, - "5": 1.1886230659155308, - "6": 0.2001904106667597, - "7": 0.6381783304423816 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=BII_order=2.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=BII_order=2.json deleted file mode 100644 index 3e387eab3..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=BII_order=2.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.225206+00:00Z", - "metadata": { - "n_players": 8, - "index": "BII", - "max_order": 2, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 1.045849735980281 - }, - "data": { - "0": 0.24731994667792678, - "1": 0.4485331318341233, - "2": 0.0658381165967853, - "3": 0.05010673965797067, - "4": 0.02743096467346769, - "5": 1.1886230659155308, - "6": 0.2001904106667597, - "7": 0.6381783304423816, - "0,1": 0.30620406246694787, - "0,2": -0.00555511773629682, - "0,3": -0.0106795395035136, - "0,4": 0.035596354485710587, - "0,5": 0.3738658667243975, - "0,6": 0.1725060088637346, - "0,7": 0.07096886660431162, - "1,2": -0.058507243837554776, - "1,3": 0.006936103861311146, - "1,4": -0.007479337064901517, - "1,5": 0.1202230094253404, - "1,6": 0.14548333075127196, - "1,7": 0.15767014066865515, - "2,3": -0.008180076368850722, - "2,4": -0.007532983704680377, - "2,5": 0.08900992344658656, - "2,6": 0.0030683018650347477, - "2,7": 0.06131660257288261, - "3,4": -0.00850762006839488, - "3,5": 0.07021704331418388, - "3,6": -0.014568487429507074, - "3,7": -0.02896052875161996, - "4,5": 0.0055197078234471425, - "4,6": 0.0028835078801960484, - "4,7": 0.011114380468612198, - "5,6": 0.08079650023397794, - "5,7": -0.2685033297179996, - "6,7": 0.34998269095975243 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=BII_order=3.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=BII_order=3.json deleted file mode 100644 index af0ad6007..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=BII_order=3.json +++ /dev/null @@ -1,112 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.223998+00:00Z", - "metadata": { - "n_players": 8, - "index": "BII", - "max_order": 3, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 1.045849735980281 - }, - "data": { - "0": 0.24731994667792678, - "1": 0.4485331318341233, - "2": 0.0658381165967853, - "3": 0.05010673965797067, - "4": 0.02743096467346769, - "5": 1.1886230659155308, - "6": 0.2001904106667597, - "7": 0.6381783304423816, - "0,1": 0.30620406246694787, - "0,2": -0.00555511773629682, - "0,3": -0.0106795395035136, - "0,4": 0.035596354485710587, - "0,5": 0.3738658667243975, - "0,6": 0.1725060088637346, - "0,7": 0.07096886660431162, - "1,2": -0.058507243837554776, - "1,3": 0.006936103861311146, - "1,4": -0.007479337064901517, - "1,5": 0.1202230094253404, - "1,6": 0.14548333075127196, - "1,7": 0.15767014066865515, - "2,3": -0.008180076368850722, - "2,4": -0.007532983704680377, - "2,5": 0.08900992344658656, - "2,6": 0.0030683018650347477, - "2,7": 0.06131660257288261, - "3,4": -0.00850762006839488, - "3,5": 0.07021704331418388, - "3,6": -0.014568487429507074, - "3,7": -0.02896052875161996, - "4,5": 0.0055197078234471425, - "4,6": 0.0028835078801960484, - "4,7": 0.011114380468612198, - "5,6": 0.08079650023397794, - "5,7": -0.2685033297179996, - "6,7": 0.34998269095975243, - "0,1,2": -0.018851082429538202, - "0,1,3": 0.009907248081297948, - "0,1,4": 0.011733118794916064, - "0,1,5": 0.1268898275045992, - "0,1,6": 0.16314696275772636, - "0,1,7": 0.21390584710738167, - "0,2,3": 0.01062344165167442, - "0,2,4": 0.013730341515966776, - "0,2,5": -0.1268283605889948, - "0,2,6": 0.027118578573103805, - "0,2,7": -0.07552374354792973, - "0,3,4": -0.00637499348576491, - "0,3,5": 0.11966216487898834, - "0,3,6": -0.02189516363620929, - "0,3,7": -0.035914905426846264, - "0,4,5": 0.01640137003653054, - "0,4,6": -0.003587712980782462, - "0,4,7": 0.027891828976522107, - "0,5,6": -0.05235532788757019, - "0,5,7": -0.4432205522645835, - "0,6,7": 0.13886561480317183, - "1,2,3": -0.011036417896347905, - "1,2,4": 0.0025961583183446435, - "1,2,5": 0.08655901901935456, - "1,2,6": -0.008891591840425123, - "1,2,7": 0.009372205818700657, - "1,3,4": -0.0054890836823537625, - "1,3,5": 0.028483638990503574, - "1,3,6": -0.011299836373559441, - "1,3,7": -0.02137948884295024, - "1,4,5": -0.04667715497652539, - "1,4,6": 0.00567886509609164, - "1,4,7": 0.006142846339641711, - "1,5,6": 0.0327117631968523, - "1,5,7": -0.12431323478742287, - "1,6,7": 0.17100364982197064, - "2,3,4": -0.0025441953172685994, - "2,3,5": -0.0029780190873005263, - "2,3,6": 0.004043220062864589, - "2,3,7": 0.002386045994975633, - "2,4,5": -0.022951170988019604, - "2,4,6": -0.00011783414302304895, - "2,4,7": -0.000841063168020656, - "2,5,6": 0.01921794483798564, - "2,5,7": 0.06155986364993145, - "2,6,7": 0.036878356805788506, - "3,4,5": -0.015413163199801433, - "3,4,6": 0.0044948690698755345, - "3,4,7": -0.0003348015949957983, - "3,5,6": 0.02925574944122991, - "3,5,7": 0.013362147981973133, - "3,6,7": -0.013143439106036742, - "4,5,6": -0.02807947806552699, - "4,5,7": -0.028202008953004593, - "4,6,7": 0.012115259945239126, - "5,6,7": -0.2974524754443136 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=BII_order=4.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=BII_order=4.json deleted file mode 100644 index e9c0bd79a..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=BII_order=4.json +++ /dev/null @@ -1,182 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.240024+00:00Z", - "metadata": { - "n_players": 8, - "index": "BII", - "max_order": 4, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 1.045849735980281 - }, - "data": { - "0": 0.24731994667792678, - "1": 0.4485331318341233, - "2": 0.0658381165967853, - "3": 0.05010673965797067, - "4": 0.02743096467346769, - "5": 1.1886230659155308, - "6": 0.2001904106667597, - "7": 0.6381783304423816, - "0,1": 0.30620406246694787, - "0,2": -0.00555511773629682, - "0,3": -0.0106795395035136, - "0,4": 0.035596354485710587, - "0,5": 0.3738658667243975, - "0,6": 0.1725060088637346, - "0,7": 0.07096886660431162, - "1,2": -0.058507243837554776, - "1,3": 0.006936103861311146, - "1,4": -0.007479337064901517, - "1,5": 0.1202230094253404, - "1,6": 0.14548333075127196, - "1,7": 0.15767014066865515, - "2,3": -0.008180076368850722, - "2,4": -0.007532983704680377, - "2,5": 0.08900992344658656, - "2,6": 0.0030683018650347477, - "2,7": 0.06131660257288261, - "3,4": -0.00850762006839488, - "3,5": 0.07021704331418388, - "3,6": -0.014568487429507074, - "3,7": -0.02896052875161996, - "4,5": 0.0055197078234471425, - "4,6": 0.0028835078801960484, - "4,7": 0.011114380468612198, - "5,6": 0.08079650023397794, - "5,7": -0.2685033297179996, - "6,7": 0.34998269095975243, - "0,1,2": -0.018851082429538202, - "0,1,3": 0.009907248081297948, - "0,1,4": 0.011733118794916064, - "0,1,5": 0.1268898275045992, - "0,1,6": 0.16314696275772636, - "0,1,7": 0.21390584710738167, - "0,2,3": 0.01062344165167442, - "0,2,4": 0.013730341515966776, - "0,2,5": -0.1268283605889948, - "0,2,6": 0.027118578573103805, - "0,2,7": -0.07552374354792973, - "0,3,4": -0.00637499348576491, - "0,3,5": 0.11966216487898834, - "0,3,6": -0.02189516363620929, - "0,3,7": -0.035914905426846264, - "0,4,5": 0.01640137003653054, - "0,4,6": -0.003587712980782462, - "0,4,7": 0.027891828976522107, - "0,5,6": -0.05235532788757019, - "0,5,7": -0.4432205522645835, - "0,6,7": 0.13886561480317183, - "1,2,3": -0.011036417896347905, - "1,2,4": 0.0025961583183446435, - "1,2,5": 0.08655901901935456, - "1,2,6": -0.008891591840425123, - "1,2,7": 0.009372205818700657, - "1,3,4": -0.0054890836823537625, - "1,3,5": 0.028483638990503574, - "1,3,6": -0.011299836373559441, - "1,3,7": -0.02137948884295024, - "1,4,5": -0.04667715497652539, - "1,4,6": 0.00567886509609164, - "1,4,7": 0.006142846339641711, - "1,5,6": 0.0327117631968523, - "1,5,7": -0.12431323478742287, - "1,6,7": 0.17100364982197064, - "2,3,4": -0.0025441953172685994, - "2,3,5": -0.0029780190873005263, - "2,3,6": 0.004043220062864589, - "2,3,7": 0.002386045994975633, - "2,4,5": -0.022951170988019604, - "2,4,6": -0.00011783414302304895, - "2,4,7": -0.000841063168020656, - "2,5,6": 0.01921794483798564, - "2,5,7": 0.06155986364993145, - "2,6,7": 0.036878356805788506, - "3,4,5": -0.015413163199801433, - "3,4,6": 0.0044948690698755345, - "3,4,7": -0.0003348015949957983, - "3,5,6": 0.02925574944122991, - "3,5,7": 0.013362147981973133, - "3,6,7": -0.013143439106036742, - "4,5,6": -0.02807947806552699, - "4,5,7": -0.028202008953004593, - "4,6,7": 0.012115259945239126, - "5,6,7": -0.2974524754443136, - "0,1,2,3": 0.02117940547929828, - "0,1,2,4": 0.008624041540626654, - "0,1,2,5": 0.07450750450992757, - "0,1,2,6": 0.012928456740665312, - "0,1,2,7": 0.009199262630120913, - "0,1,3,4": -0.004663453812038032, - "0,1,3,5": 0.06945652751387249, - "0,1,3,6": -0.01955369583079669, - "0,1,3,7": -0.03597948333813883, - "0,1,4,5": -0.018323124675839214, - "0,1,4,6": -0.001226098308179241, - "0,1,4,7": 0.011810744711610005, - "0,1,5,6": -0.015884537380773917, - "0,1,5,7": -0.17306895148238188, - "0,1,6,7": 0.19806558010890554, - "0,2,3,4": 0.004863157184574557, - "0,2,3,5": 0.016683058658604866, - "0,2,3,6": -0.004420775626289647, - "0,2,3,7": -0.0013055606115461305, - "0,2,4,5": 0.02841710923894583, - "0,2,4,6": 0.008040929422024862, - "0,2,4,7": 0.008522847440545683, - "0,2,5,6": -0.06763324206312923, - "0,2,5,7": -0.15174886909874785, - "0,2,6,7": -0.031176172295916155, - "0,3,4,5": -0.007042078275475067, - "0,3,4,6": 0.007681252981804915, - "0,3,4,7": -0.0011394340912243839, - "0,3,5,6": 0.02120464273370201, - "0,3,5,7": 0.05553004069407344, - "0,3,6,7": -0.016380445768365698, - "0,4,5,6": -0.037616735322958034, - "0,4,5,7": -0.01783281032886294, - "0,4,6,7": 0.008353183230199429, - "0,5,6,7": -0.4092786282466937, - "1,2,3,4": -0.0022216120949375973, - "1,2,3,5": 0.0034652797442408234, - "1,2,3,6": 0.0007831410605176337, - "1,2,3,7": 0.009913100072918457, - "1,2,4,5": 0.0007366053439661902, - "1,2,4,6": -0.001092192662150937, - "1,2,4,7": -0.00020564135314027343, - "1,2,5,6": 0.0006375014126192569, - "1,2,5,7": 0.0032188356169682852, - "1,2,6,7": 0.004620555462787446, - "1,3,4,5": -0.009486442964395658, - "1,3,4,6": 0.0002359871764195387, - "1,3,4,7": -0.0003743846823663355, - "1,3,5,6": 0.024874680058353527, - "1,3,5,7": 0.045996479295270454, - "1,3,6,7": -0.013621779880429952, - "1,4,5,6": -0.011668223317974957, - "1,4,5,7": -0.0066916218599300525, - "1,4,6,7": 0.0007905636059000742, - "1,5,6,7": -0.18583280699396548, - "2,3,4,5": -0.004178109362148852, - "2,3,4,6": -0.0001800535477189391, - "2,3,4,7": 0.0001980011854798014, - "2,3,5,6": 0.00056253780551202, - "2,3,5,7": -0.010319692617996645, - "2,3,6,7": 0.006561048697898697, - "2,4,5,6": -0.008095890584772059, - "2,4,5,7": -0.014322602405838769, - "2,4,6,7": 0.001962981159366939, - "2,5,6,7": 0.0039008628851723848, - "3,4,5,6": 0.00648982632045797, - "3,4,5,7": -0.0011283349001680043, - "3,4,6,7": 0.002582712995615133, - "3,5,6,7": 0.06957935295033993, - "4,5,6,7": -0.02283279421422918 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=BII_order=5.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=BII_order=5.json deleted file mode 100644 index 4db6f8d04..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=BII_order=5.json +++ /dev/null @@ -1,238 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.237457+00:00Z", - "metadata": { - "n_players": 8, - "index": "BII", - "max_order": 5, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 1.045849735980281 - }, - "data": { - "0": 0.24731994667792678, - "1": 0.4485331318341233, - "2": 0.0658381165967853, - "3": 0.05010673965797067, - "4": 0.02743096467346769, - "5": 1.1886230659155308, - "6": 0.2001904106667597, - "7": 0.6381783304423816, - "0,1": 0.30620406246694787, - "0,2": -0.00555511773629682, - "0,3": -0.0106795395035136, - "0,4": 0.035596354485710587, - "0,5": 0.3738658667243975, - "0,6": 0.1725060088637346, - "0,7": 0.07096886660431162, - "1,2": -0.058507243837554776, - "1,3": 0.006936103861311146, - "1,4": -0.007479337064901517, - "1,5": 0.1202230094253404, - "1,6": 0.14548333075127196, - "1,7": 0.15767014066865515, - "2,3": -0.008180076368850722, - "2,4": -0.007532983704680377, - "2,5": 0.08900992344658656, - "2,6": 0.0030683018650347477, - "2,7": 0.06131660257288261, - "3,4": -0.00850762006839488, - "3,5": 0.07021704331418388, - "3,6": -0.014568487429507074, - "3,7": -0.02896052875161996, - "4,5": 0.0055197078234471425, - "4,6": 0.0028835078801960484, - "4,7": 0.011114380468612198, - "5,6": 0.08079650023397794, - "5,7": -0.2685033297179996, - "6,7": 0.34998269095975243, - "0,1,2": -0.018851082429538202, - "0,1,3": 0.009907248081297948, - "0,1,4": 0.011733118794916064, - "0,1,5": 0.1268898275045992, - "0,1,6": 0.16314696275772636, - "0,1,7": 0.21390584710738167, - "0,2,3": 0.01062344165167442, - "0,2,4": 0.013730341515966776, - "0,2,5": -0.1268283605889948, - "0,2,6": 0.027118578573103805, - "0,2,7": -0.07552374354792973, - "0,3,4": -0.00637499348576491, - "0,3,5": 0.11966216487898834, - "0,3,6": -0.02189516363620929, - "0,3,7": -0.035914905426846264, - "0,4,5": 0.01640137003653054, - "0,4,6": -0.003587712980782462, - "0,4,7": 0.027891828976522107, - "0,5,6": -0.05235532788757019, - "0,5,7": -0.4432205522645835, - "0,6,7": 0.13886561480317183, - "1,2,3": -0.011036417896347905, - "1,2,4": 0.0025961583183446435, - "1,2,5": 0.08655901901935456, - "1,2,6": -0.008891591840425123, - "1,2,7": 0.009372205818700657, - "1,3,4": -0.0054890836823537625, - "1,3,5": 0.028483638990503574, - "1,3,6": -0.011299836373559441, - "1,3,7": -0.02137948884295024, - "1,4,5": -0.04667715497652539, - "1,4,6": 0.00567886509609164, - "1,4,7": 0.006142846339641711, - "1,5,6": 0.0327117631968523, - "1,5,7": -0.12431323478742287, - "1,6,7": 0.17100364982197064, - "2,3,4": -0.0025441953172685994, - "2,3,5": -0.0029780190873005263, - "2,3,6": 0.004043220062864589, - "2,3,7": 0.002386045994975633, - "2,4,5": -0.022951170988019604, - "2,4,6": -0.00011783414302304895, - "2,4,7": -0.000841063168020656, - "2,5,6": 0.01921794483798564, - "2,5,7": 0.06155986364993145, - "2,6,7": 0.036878356805788506, - "3,4,5": -0.015413163199801433, - "3,4,6": 0.0044948690698755345, - "3,4,7": -0.0003348015949957983, - "3,5,6": 0.02925574944122991, - "3,5,7": 0.013362147981973133, - "3,6,7": -0.013143439106036742, - "4,5,6": -0.02807947806552699, - "4,5,7": -0.028202008953004593, - "4,6,7": 0.012115259945239126, - "5,6,7": -0.2974524754443136, - "0,1,2,3": 0.02117940547929828, - "0,1,2,4": 0.008624041540626654, - "0,1,2,5": 0.07450750450992757, - "0,1,2,6": 0.012928456740665312, - "0,1,2,7": 0.009199262630120913, - "0,1,3,4": -0.004663453812038032, - "0,1,3,5": 0.06945652751387249, - "0,1,3,6": -0.01955369583079669, - "0,1,3,7": -0.03597948333813883, - "0,1,4,5": -0.018323124675839214, - "0,1,4,6": -0.001226098308179241, - "0,1,4,7": 0.011810744711610005, - "0,1,5,6": -0.015884537380773917, - "0,1,5,7": -0.17306895148238188, - "0,1,6,7": 0.19806558010890554, - "0,2,3,4": 0.004863157184574557, - "0,2,3,5": 0.016683058658604866, - "0,2,3,6": -0.004420775626289647, - "0,2,3,7": -0.0013055606115461305, - "0,2,4,5": 0.02841710923894583, - "0,2,4,6": 0.008040929422024862, - "0,2,4,7": 0.008522847440545683, - "0,2,5,6": -0.06763324206312923, - "0,2,5,7": -0.15174886909874785, - "0,2,6,7": -0.031176172295916155, - "0,3,4,5": -0.007042078275475067, - "0,3,4,6": 0.007681252981804915, - "0,3,4,7": -0.0011394340912243839, - "0,3,5,6": 0.02120464273370201, - "0,3,5,7": 0.05553004069407344, - "0,3,6,7": -0.016380445768365698, - "0,4,5,6": -0.037616735322958034, - "0,4,5,7": -0.01783281032886294, - "0,4,6,7": 0.008353183230199429, - "0,5,6,7": -0.4092786282466937, - "1,2,3,4": -0.0022216120949375973, - "1,2,3,5": 0.0034652797442408234, - "1,2,3,6": 0.0007831410605176337, - "1,2,3,7": 0.009913100072918457, - "1,2,4,5": 0.0007366053439661902, - "1,2,4,6": -0.001092192662150937, - "1,2,4,7": -0.00020564135314027343, - "1,2,5,6": 0.0006375014126192569, - "1,2,5,7": 0.0032188356169682852, - "1,2,6,7": 0.004620555462787446, - "1,3,4,5": -0.009486442964395658, - "1,3,4,6": 0.0002359871764195387, - "1,3,4,7": -0.0003743846823663355, - "1,3,5,6": 0.024874680058353527, - "1,3,5,7": 0.045996479295270454, - "1,3,6,7": -0.013621779880429952, - "1,4,5,6": -0.011668223317974957, - "1,4,5,7": -0.0066916218599300525, - "1,4,6,7": 0.0007905636059000742, - "1,5,6,7": -0.18583280699396548, - "2,3,4,5": -0.004178109362148852, - "2,3,4,6": -0.0001800535477189391, - "2,3,4,7": 0.0001980011854798014, - "2,3,5,6": 0.00056253780551202, - "2,3,5,7": -0.010319692617996645, - "2,3,6,7": 0.006561048697898697, - "2,4,5,6": -0.008095890584772059, - "2,4,5,7": -0.014322602405838769, - "2,4,6,7": 0.001962981159366939, - "2,5,6,7": 0.0039008628851723848, - "3,4,5,6": 0.00648982632045797, - "3,4,5,7": -0.0011283349001680043, - "3,4,6,7": 0.002582712995615133, - "3,5,6,7": 0.06957935295033993, - "4,5,6,7": -0.02283279421422918, - "0,1,2,3,4": 0.004362810876316903, - "0,1,2,3,5": -0.002995290929714456, - "0,1,2,3,6": 0.0036845826904682855, - "0,1,2,3,7": -0.011445729624705747, - "0,1,2,4,5": 0.01060083647608473, - "0,1,2,4,6": -0.0008849009219059067, - "0,1,2,4,7": 0.0038815715766671866, - "0,1,2,5,6": 0.0004343119377828164, - "0,1,2,5,7": -0.028136644454713478, - "0,1,2,6,7": 0.02765946610584563, - "0,1,3,4,5": -0.006700569643997789, - "0,1,3,4,6": 0.00204002449260704, - "0,1,3,4,7": -0.002423551746649266, - "0,1,3,5,6": 0.026711291492269862, - "0,1,3,5,7": 0.021232132878931165, - "0,1,3,6,7": -0.025716052101363684, - "0,1,4,5,6": -0.01881393978051321, - "0,1,4,5,7": -0.007356736285210774, - "0,1,4,6,7": -0.0016702339720446324, - "0,1,5,6,7": -0.26874576733498334, - "0,2,3,4,5": 0.008438490657661835, - "0,2,3,4,6": 0.0003391439970220067, - "0,2,3,4,7": 0.00020396162896513248, - "0,2,3,5,6": -0.007346358882294846, - "0,2,3,5,7": 0.011770494725837022, - "0,2,3,6,7": -0.00902862623185996, - "0,2,4,5,6": 0.005275049754891681, - "0,2,4,5,7": 0.0096339617992664, - "0,2,4,6,7": 0.004871835057568608, - "0,2,5,6,7": -0.09414442603818157, - "0,3,4,5,6": 0.010298099139704642, - "0,3,4,5,7": -0.0008536296275058475, - "0,3,4,6,7": 0.003095520939031815, - "0,3,5,6,7": 0.08240230973740298, - "0,4,5,6,7": -0.03351345036038417, - "1,2,3,4,5": -0.001802051398868243, - "1,2,3,4,6": 0.0002801385766885156, - "1,2,3,4,7": -0.00038612595931997173, - "1,2,3,5,6": -0.004027999895924617, - "1,2,3,5,7": -0.002978512463734595, - "1,2,3,6,7": 0.00415105985601838, - "1,2,4,5,6": -0.0015191877049035574, - "1,2,4,5,7": 0.0006966771567599173, - "1,2,4,6,7": -0.0023370178210286863, - "1,2,5,6,7": -0.010972051148461559, - "1,3,4,5,6": 0.001158687740952069, - "1,3,4,5,7": -0.0016871282830311918, - "1,3,4,6,7": 0.00045918192855054496, - "1,3,5,6,7": 0.059685736389364474, - "1,4,5,6,7": -0.002979944012982849, - "2,3,4,5,6": -0.0008162909960981457, - "2,3,4,5,7": 0.0004327232463078312, - "2,3,4,6,7": 0.00012828176844281725, - "2,3,5,6,7": -0.0013727403210926914, - "2,4,5,6,7": -0.005972788817966701, - "3,4,5,6,7": 0.002764449808270064 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=BII_order=6.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=BII_order=6.json deleted file mode 100644 index 78f847ece..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=BII_order=6.json +++ /dev/null @@ -1,266 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.229621+00:00Z", - "metadata": { - "n_players": 8, - "index": "BII", - "max_order": 6, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 1.045849735980281 - }, - "data": { - "0": 0.24731994667792678, - "1": 0.4485331318341233, - "2": 0.0658381165967853, - "3": 0.05010673965797067, - "4": 0.02743096467346769, - "5": 1.1886230659155308, - "6": 0.2001904106667597, - "7": 0.6381783304423816, - "0,1": 0.30620406246694787, - "0,2": -0.00555511773629682, - "0,3": -0.0106795395035136, - "0,4": 0.035596354485710587, - "0,5": 0.3738658667243975, - "0,6": 0.1725060088637346, - "0,7": 0.07096886660431162, - "1,2": -0.058507243837554776, - "1,3": 0.006936103861311146, - "1,4": -0.007479337064901517, - "1,5": 0.1202230094253404, - "1,6": 0.14548333075127196, - "1,7": 0.15767014066865515, - "2,3": -0.008180076368850722, - "2,4": -0.007532983704680377, - "2,5": 0.08900992344658656, - "2,6": 0.0030683018650347477, - "2,7": 0.06131660257288261, - "3,4": -0.00850762006839488, - "3,5": 0.07021704331418388, - "3,6": -0.014568487429507074, - "3,7": -0.02896052875161996, - "4,5": 0.0055197078234471425, - "4,6": 0.0028835078801960484, - "4,7": 0.011114380468612198, - "5,6": 0.08079650023397794, - "5,7": -0.2685033297179996, - "6,7": 0.34998269095975243, - "0,1,2": -0.018851082429538202, - "0,1,3": 0.009907248081297948, - "0,1,4": 0.011733118794916064, - "0,1,5": 0.1268898275045992, - "0,1,6": 0.16314696275772636, - "0,1,7": 0.21390584710738167, - "0,2,3": 0.01062344165167442, - "0,2,4": 0.013730341515966776, - "0,2,5": -0.1268283605889948, - "0,2,6": 0.027118578573103805, - "0,2,7": -0.07552374354792973, - "0,3,4": -0.00637499348576491, - "0,3,5": 0.11966216487898834, - "0,3,6": -0.02189516363620929, - "0,3,7": -0.035914905426846264, - "0,4,5": 0.01640137003653054, - "0,4,6": -0.003587712980782462, - "0,4,7": 0.027891828976522107, - "0,5,6": -0.05235532788757019, - "0,5,7": -0.4432205522645835, - "0,6,7": 0.13886561480317183, - "1,2,3": -0.011036417896347905, - "1,2,4": 0.0025961583183446435, - "1,2,5": 0.08655901901935456, - "1,2,6": -0.008891591840425123, - "1,2,7": 0.009372205818700657, - "1,3,4": -0.0054890836823537625, - "1,3,5": 0.028483638990503574, - "1,3,6": -0.011299836373559441, - "1,3,7": -0.02137948884295024, - "1,4,5": -0.04667715497652539, - "1,4,6": 0.00567886509609164, - "1,4,7": 0.006142846339641711, - "1,5,6": 0.0327117631968523, - "1,5,7": -0.12431323478742287, - "1,6,7": 0.17100364982197064, - "2,3,4": -0.0025441953172685994, - "2,3,5": -0.0029780190873005263, - "2,3,6": 0.004043220062864589, - "2,3,7": 0.002386045994975633, - "2,4,5": -0.022951170988019604, - "2,4,6": -0.00011783414302304895, - "2,4,7": -0.000841063168020656, - "2,5,6": 0.01921794483798564, - "2,5,7": 0.06155986364993145, - "2,6,7": 0.036878356805788506, - "3,4,5": -0.015413163199801433, - "3,4,6": 0.0044948690698755345, - "3,4,7": -0.0003348015949957983, - "3,5,6": 0.02925574944122991, - "3,5,7": 0.013362147981973133, - "3,6,7": -0.013143439106036742, - "4,5,6": -0.02807947806552699, - "4,5,7": -0.028202008953004593, - "4,6,7": 0.012115259945239126, - "5,6,7": -0.2974524754443136, - "0,1,2,3": 0.02117940547929828, - "0,1,2,4": 0.008624041540626654, - "0,1,2,5": 0.07450750450992757, - "0,1,2,6": 0.012928456740665312, - "0,1,2,7": 0.009199262630120913, - "0,1,3,4": -0.004663453812038032, - "0,1,3,5": 0.06945652751387249, - "0,1,3,6": -0.01955369583079669, - "0,1,3,7": -0.03597948333813883, - "0,1,4,5": -0.018323124675839214, - "0,1,4,6": -0.001226098308179241, - "0,1,4,7": 0.011810744711610005, - "0,1,5,6": -0.015884537380773917, - "0,1,5,7": -0.17306895148238188, - "0,1,6,7": 0.19806558010890554, - "0,2,3,4": 0.004863157184574557, - "0,2,3,5": 0.016683058658604866, - "0,2,3,6": -0.004420775626289647, - "0,2,3,7": -0.0013055606115461305, - "0,2,4,5": 0.02841710923894583, - "0,2,4,6": 0.008040929422024862, - "0,2,4,7": 0.008522847440545683, - "0,2,5,6": -0.06763324206312923, - "0,2,5,7": -0.15174886909874785, - "0,2,6,7": -0.031176172295916155, - "0,3,4,5": -0.007042078275475067, - "0,3,4,6": 0.007681252981804915, - "0,3,4,7": -0.0011394340912243839, - "0,3,5,6": 0.02120464273370201, - "0,3,5,7": 0.05553004069407344, - "0,3,6,7": -0.016380445768365698, - "0,4,5,6": -0.037616735322958034, - "0,4,5,7": -0.01783281032886294, - "0,4,6,7": 0.008353183230199429, - "0,5,6,7": -0.4092786282466937, - "1,2,3,4": -0.0022216120949375973, - "1,2,3,5": 0.0034652797442408234, - "1,2,3,6": 0.0007831410605176337, - "1,2,3,7": 0.009913100072918457, - "1,2,4,5": 0.0007366053439661902, - "1,2,4,6": -0.001092192662150937, - "1,2,4,7": -0.00020564135314027343, - "1,2,5,6": 0.0006375014126192569, - "1,2,5,7": 0.0032188356169682852, - "1,2,6,7": 0.004620555462787446, - "1,3,4,5": -0.009486442964395658, - "1,3,4,6": 0.0002359871764195387, - "1,3,4,7": -0.0003743846823663355, - "1,3,5,6": 0.024874680058353527, - "1,3,5,7": 0.045996479295270454, - "1,3,6,7": -0.013621779880429952, - "1,4,5,6": -0.011668223317974957, - "1,4,5,7": -0.0066916218599300525, - "1,4,6,7": 0.0007905636059000742, - "1,5,6,7": -0.18583280699396548, - "2,3,4,5": -0.004178109362148852, - "2,3,4,6": -0.0001800535477189391, - "2,3,4,7": 0.0001980011854798014, - "2,3,5,6": 0.00056253780551202, - "2,3,5,7": -0.010319692617996645, - "2,3,6,7": 0.006561048697898697, - "2,4,5,6": -0.008095890584772059, - "2,4,5,7": -0.014322602405838769, - "2,4,6,7": 0.001962981159366939, - "2,5,6,7": 0.0039008628851723848, - "3,4,5,6": 0.00648982632045797, - "3,4,5,7": -0.0011283349001680043, - "3,4,6,7": 0.002582712995615133, - "3,5,6,7": 0.06957935295033993, - "4,5,6,7": -0.02283279421422918, - "0,1,2,3,4": 0.004362810876316903, - "0,1,2,3,5": -0.002995290929714456, - "0,1,2,3,6": 0.0036845826904682855, - "0,1,2,3,7": -0.011445729624705747, - "0,1,2,4,5": 0.01060083647608473, - "0,1,2,4,6": -0.0008849009219059067, - "0,1,2,4,7": 0.0038815715766671866, - "0,1,2,5,6": 0.0004343119377828164, - "0,1,2,5,7": -0.028136644454713478, - "0,1,2,6,7": 0.02765946610584563, - "0,1,3,4,5": -0.006700569643997789, - "0,1,3,4,6": 0.00204002449260704, - "0,1,3,4,7": -0.002423551746649266, - "0,1,3,5,6": 0.026711291492269862, - "0,1,3,5,7": 0.021232132878931165, - "0,1,3,6,7": -0.025716052101363684, - "0,1,4,5,6": -0.01881393978051321, - "0,1,4,5,7": -0.007356736285210774, - "0,1,4,6,7": -0.0016702339720446324, - "0,1,5,6,7": -0.26874576733498334, - "0,2,3,4,5": 0.008438490657661835, - "0,2,3,4,6": 0.0003391439970220067, - "0,2,3,4,7": 0.00020396162896513248, - "0,2,3,5,6": -0.007346358882294846, - "0,2,3,5,7": 0.011770494725837022, - "0,2,3,6,7": -0.00902862623185996, - "0,2,4,5,6": 0.005275049754891681, - "0,2,4,5,7": 0.0096339617992664, - "0,2,4,6,7": 0.004871835057568608, - "0,2,5,6,7": -0.09414442603818157, - "0,3,4,5,6": 0.010298099139704642, - "0,3,4,5,7": -0.0008536296275058475, - "0,3,4,6,7": 0.003095520939031815, - "0,3,5,6,7": 0.08240230973740298, - "0,4,5,6,7": -0.03351345036038417, - "1,2,3,4,5": -0.001802051398868243, - "1,2,3,4,6": 0.0002801385766885156, - "1,2,3,4,7": -0.00038612595931997173, - "1,2,3,5,6": -0.004027999895924617, - "1,2,3,5,7": -0.002978512463734595, - "1,2,3,6,7": 0.00415105985601838, - "1,2,4,5,6": -0.0015191877049035574, - "1,2,4,5,7": 0.0006966771567599173, - "1,2,4,6,7": -0.0023370178210286863, - "1,2,5,6,7": -0.010972051148461559, - "1,3,4,5,6": 0.001158687740952069, - "1,3,4,5,7": -0.0016871282830311918, - "1,3,4,6,7": 0.00045918192855054496, - "1,3,5,6,7": 0.059685736389364474, - "1,4,5,6,7": -0.002979944012982849, - "2,3,4,5,6": -0.0008162909960981457, - "2,3,4,5,7": 0.0004327232463078312, - "2,3,4,6,7": 0.00012828176844281725, - "2,3,5,6,7": -0.0013727403210926914, - "2,4,5,6,7": -0.005972788817966701, - "3,4,5,6,7": 0.002764449808270064, - "0,1,2,3,4,5": 0.004503145079001292, - "0,1,2,3,4,6": -0.0005193769082284527, - "0,1,2,3,4,7": -0.0004287020329006852, - "0,1,2,3,5,6": -0.0059770303981211415, - "0,1,2,3,5,7": -0.009310524586868874, - "0,1,2,3,6,7": -0.002946824556545047, - "0,1,2,4,5,6": 0.0010017772458440488, - "0,1,2,4,5,7": 0.0029662385047813933, - "0,1,2,4,6,7": -0.0018964375681181922, - "0,1,2,5,6,7": -0.025531222098407413, - "0,1,3,4,5,6": 0.0023171735566481777, - "0,1,3,4,5,7": -0.003176212384875865, - "0,1,3,4,6,7": 0.0006734485297078541, - "0,1,3,5,6,7": 0.0686748739354186, - "0,1,4,5,6,7": -0.006217323836971489, - "0,2,3,4,5,6": 0.0016726824680098895, - "0,2,3,4,5,7": 2.2919105347907198e-05, - "0,2,3,4,6,7": -0.00025553758519458736, - "0,2,3,5,6,7": -0.002156194546705237, - "0,2,4,5,6,7": -0.0038986754216288055, - "0,3,4,5,6,7": 0.0033151481001364447, - "1,2,3,4,5,6": -0.00010841032563546626, - "1,2,3,4,5,7": -0.0005672589415810503, - "1,2,3,4,6,7": 5.678313582202499e-05, - "1,2,3,5,6,7": -0.002049443277983398, - "1,2,4,5,6,7": 0.0021097250110171384, - "1,3,4,5,6,7": 1.3401033638338333e-07, - "2,3,4,5,6,7": -0.0002269207681904195 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=BII_order=7.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=BII_order=7.json deleted file mode 100644 index 1b71c831d..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=BII_order=7.json +++ /dev/null @@ -1,274 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.232084+00:00Z", - "metadata": { - "n_players": 8, - "index": "BII", - "max_order": 7, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 1.045849735980281 - }, - "data": { - "0": 0.24731994667792678, - "1": 0.4485331318341233, - "2": 0.0658381165967853, - "3": 0.05010673965797067, - "4": 0.02743096467346769, - "5": 1.1886230659155308, - "6": 0.2001904106667597, - "7": 0.6381783304423816, - "0,1": 0.30620406246694787, - "0,2": -0.00555511773629682, - "0,3": -0.0106795395035136, - "0,4": 0.035596354485710587, - "0,5": 0.3738658667243975, - "0,6": 0.1725060088637346, - "0,7": 0.07096886660431162, - "1,2": -0.058507243837554776, - "1,3": 0.006936103861311146, - "1,4": -0.007479337064901517, - "1,5": 0.1202230094253404, - "1,6": 0.14548333075127196, - "1,7": 0.15767014066865515, - "2,3": -0.008180076368850722, - "2,4": -0.007532983704680377, - "2,5": 0.08900992344658656, - "2,6": 0.0030683018650347477, - "2,7": 0.06131660257288261, - "3,4": -0.00850762006839488, - "3,5": 0.07021704331418388, - "3,6": -0.014568487429507074, - "3,7": -0.02896052875161996, - "4,5": 0.0055197078234471425, - "4,6": 0.0028835078801960484, - "4,7": 0.011114380468612198, - "5,6": 0.08079650023397794, - "5,7": -0.2685033297179996, - "6,7": 0.34998269095975243, - "0,1,2": -0.018851082429538202, - "0,1,3": 0.009907248081297948, - "0,1,4": 0.011733118794916064, - "0,1,5": 0.1268898275045992, - "0,1,6": 0.16314696275772636, - "0,1,7": 0.21390584710738167, - "0,2,3": 0.01062344165167442, - "0,2,4": 0.013730341515966776, - "0,2,5": -0.1268283605889948, - "0,2,6": 0.027118578573103805, - "0,2,7": -0.07552374354792973, - "0,3,4": -0.00637499348576491, - "0,3,5": 0.11966216487898834, - "0,3,6": -0.02189516363620929, - "0,3,7": -0.035914905426846264, - "0,4,5": 0.01640137003653054, - "0,4,6": -0.003587712980782462, - "0,4,7": 0.027891828976522107, - "0,5,6": -0.05235532788757019, - "0,5,7": -0.4432205522645835, - "0,6,7": 0.13886561480317183, - "1,2,3": -0.011036417896347905, - "1,2,4": 0.0025961583183446435, - "1,2,5": 0.08655901901935456, - "1,2,6": -0.008891591840425123, - "1,2,7": 0.009372205818700657, - "1,3,4": -0.0054890836823537625, - "1,3,5": 0.028483638990503574, - "1,3,6": -0.011299836373559441, - "1,3,7": -0.02137948884295024, - "1,4,5": -0.04667715497652539, - "1,4,6": 0.00567886509609164, - "1,4,7": 0.006142846339641711, - "1,5,6": 0.0327117631968523, - "1,5,7": -0.12431323478742287, - "1,6,7": 0.17100364982197064, - "2,3,4": -0.0025441953172685994, - "2,3,5": -0.0029780190873005263, - "2,3,6": 0.004043220062864589, - "2,3,7": 0.002386045994975633, - "2,4,5": -0.022951170988019604, - "2,4,6": -0.00011783414302304895, - "2,4,7": -0.000841063168020656, - "2,5,6": 0.01921794483798564, - "2,5,7": 0.06155986364993145, - "2,6,7": 0.036878356805788506, - "3,4,5": -0.015413163199801433, - "3,4,6": 0.0044948690698755345, - "3,4,7": -0.0003348015949957983, - "3,5,6": 0.02925574944122991, - "3,5,7": 0.013362147981973133, - "3,6,7": -0.013143439106036742, - "4,5,6": -0.02807947806552699, - "4,5,7": -0.028202008953004593, - "4,6,7": 0.012115259945239126, - "5,6,7": -0.2974524754443136, - "0,1,2,3": 0.02117940547929828, - "0,1,2,4": 0.008624041540626654, - "0,1,2,5": 0.07450750450992757, - "0,1,2,6": 0.012928456740665312, - "0,1,2,7": 0.009199262630120913, - "0,1,3,4": -0.004663453812038032, - "0,1,3,5": 0.06945652751387249, - "0,1,3,6": -0.01955369583079669, - "0,1,3,7": -0.03597948333813883, - "0,1,4,5": -0.018323124675839214, - "0,1,4,6": -0.001226098308179241, - "0,1,4,7": 0.011810744711610005, - "0,1,5,6": -0.015884537380773917, - "0,1,5,7": -0.17306895148238188, - "0,1,6,7": 0.19806558010890554, - "0,2,3,4": 0.004863157184574557, - "0,2,3,5": 0.016683058658604866, - "0,2,3,6": -0.004420775626289647, - "0,2,3,7": -0.0013055606115461305, - "0,2,4,5": 0.02841710923894583, - "0,2,4,6": 0.008040929422024862, - "0,2,4,7": 0.008522847440545683, - "0,2,5,6": -0.06763324206312923, - "0,2,5,7": -0.15174886909874785, - "0,2,6,7": -0.031176172295916155, - "0,3,4,5": -0.007042078275475067, - "0,3,4,6": 0.007681252981804915, - "0,3,4,7": -0.0011394340912243839, - "0,3,5,6": 0.02120464273370201, - "0,3,5,7": 0.05553004069407344, - "0,3,6,7": -0.016380445768365698, - "0,4,5,6": -0.037616735322958034, - "0,4,5,7": -0.01783281032886294, - "0,4,6,7": 0.008353183230199429, - "0,5,6,7": -0.4092786282466937, - "1,2,3,4": -0.0022216120949375973, - "1,2,3,5": 0.0034652797442408234, - "1,2,3,6": 0.0007831410605176337, - "1,2,3,7": 0.009913100072918457, - "1,2,4,5": 0.0007366053439661902, - "1,2,4,6": -0.001092192662150937, - "1,2,4,7": -0.00020564135314027343, - "1,2,5,6": 0.0006375014126192569, - "1,2,5,7": 0.0032188356169682852, - "1,2,6,7": 0.004620555462787446, - "1,3,4,5": -0.009486442964395658, - "1,3,4,6": 0.0002359871764195387, - "1,3,4,7": -0.0003743846823663355, - "1,3,5,6": 0.024874680058353527, - "1,3,5,7": 0.045996479295270454, - "1,3,6,7": -0.013621779880429952, - "1,4,5,6": -0.011668223317974957, - "1,4,5,7": -0.0066916218599300525, - "1,4,6,7": 0.0007905636059000742, - "1,5,6,7": -0.18583280699396548, - "2,3,4,5": -0.004178109362148852, - "2,3,4,6": -0.0001800535477189391, - "2,3,4,7": 0.0001980011854798014, - "2,3,5,6": 0.00056253780551202, - "2,3,5,7": -0.010319692617996645, - "2,3,6,7": 0.006561048697898697, - "2,4,5,6": -0.008095890584772059, - "2,4,5,7": -0.014322602405838769, - "2,4,6,7": 0.001962981159366939, - "2,5,6,7": 0.0039008628851723848, - "3,4,5,6": 0.00648982632045797, - "3,4,5,7": -0.0011283349001680043, - "3,4,6,7": 0.002582712995615133, - "3,5,6,7": 0.06957935295033993, - "4,5,6,7": -0.02283279421422918, - "0,1,2,3,4": 0.004362810876316903, - "0,1,2,3,5": -0.002995290929714456, - "0,1,2,3,6": 0.0036845826904682855, - "0,1,2,3,7": -0.011445729624705747, - "0,1,2,4,5": 0.01060083647608473, - "0,1,2,4,6": -0.0008849009219059067, - "0,1,2,4,7": 0.0038815715766671866, - "0,1,2,5,6": 0.0004343119377828164, - "0,1,2,5,7": -0.028136644454713478, - "0,1,2,6,7": 0.02765946610584563, - "0,1,3,4,5": -0.006700569643997789, - "0,1,3,4,6": 0.00204002449260704, - "0,1,3,4,7": -0.002423551746649266, - "0,1,3,5,6": 0.026711291492269862, - "0,1,3,5,7": 0.021232132878931165, - "0,1,3,6,7": -0.025716052101363684, - "0,1,4,5,6": -0.01881393978051321, - "0,1,4,5,7": -0.007356736285210774, - "0,1,4,6,7": -0.0016702339720446324, - "0,1,5,6,7": -0.26874576733498334, - "0,2,3,4,5": 0.008438490657661835, - "0,2,3,4,6": 0.0003391439970220067, - "0,2,3,4,7": 0.00020396162896513248, - "0,2,3,5,6": -0.007346358882294846, - "0,2,3,5,7": 0.011770494725837022, - "0,2,3,6,7": -0.00902862623185996, - "0,2,4,5,6": 0.005275049754891681, - "0,2,4,5,7": 0.0096339617992664, - "0,2,4,6,7": 0.004871835057568608, - "0,2,5,6,7": -0.09414442603818157, - "0,3,4,5,6": 0.010298099139704642, - "0,3,4,5,7": -0.0008536296275058475, - "0,3,4,6,7": 0.003095520939031815, - "0,3,5,6,7": 0.08240230973740298, - "0,4,5,6,7": -0.03351345036038417, - "1,2,3,4,5": -0.001802051398868243, - "1,2,3,4,6": 0.0002801385766885156, - "1,2,3,4,7": -0.00038612595931997173, - "1,2,3,5,6": -0.004027999895924617, - "1,2,3,5,7": -0.002978512463734595, - "1,2,3,6,7": 0.00415105985601838, - "1,2,4,5,6": -0.0015191877049035574, - "1,2,4,5,7": 0.0006966771567599173, - "1,2,4,6,7": -0.0023370178210286863, - "1,2,5,6,7": -0.010972051148461559, - "1,3,4,5,6": 0.001158687740952069, - "1,3,4,5,7": -0.0016871282830311918, - "1,3,4,6,7": 0.00045918192855054496, - "1,3,5,6,7": 0.059685736389364474, - "1,4,5,6,7": -0.002979944012982849, - "2,3,4,5,6": -0.0008162909960981457, - "2,3,4,5,7": 0.0004327232463078312, - "2,3,4,6,7": 0.00012828176844281725, - "2,3,5,6,7": -0.0013727403210926914, - "2,4,5,6,7": -0.005972788817966701, - "3,4,5,6,7": 0.002764449808270064, - "0,1,2,3,4,5": 0.004503145079001292, - "0,1,2,3,4,6": -0.0005193769082284527, - "0,1,2,3,4,7": -0.0004287020329006852, - "0,1,2,3,5,6": -0.0059770303981211415, - "0,1,2,3,5,7": -0.009310524586868874, - "0,1,2,3,6,7": -0.002946824556545047, - "0,1,2,4,5,6": 0.0010017772458440488, - "0,1,2,4,5,7": 0.0029662385047813933, - "0,1,2,4,6,7": -0.0018964375681181922, - "0,1,2,5,6,7": -0.025531222098407413, - "0,1,3,4,5,6": 0.0023171735566481777, - "0,1,3,4,5,7": -0.003176212384875865, - "0,1,3,4,6,7": 0.0006734485297078541, - "0,1,3,5,6,7": 0.0686748739354186, - "0,1,4,5,6,7": -0.006217323836971489, - "0,2,3,4,5,6": 0.0016726824680098895, - "0,2,3,4,5,7": 2.2919105347907198e-05, - "0,2,3,4,6,7": -0.00025553758519458736, - "0,2,3,5,6,7": -0.002156194546705237, - "0,2,4,5,6,7": -0.0038986754216288055, - "0,3,4,5,6,7": 0.0033151481001364447, - "1,2,3,4,5,6": -0.00010841032563546626, - "1,2,3,4,5,7": -0.0005672589415810503, - "1,2,3,4,6,7": 5.678313582202499e-05, - "1,2,3,5,6,7": -0.002049443277983398, - "1,2,4,5,6,7": 0.0021097250110171384, - "1,3,4,5,6,7": 1.3401033638338333e-07, - "2,3,4,5,6,7": -0.0002269207681904195, - "0,1,2,3,4,5,6": 0.00013502016099198322, - "0,1,2,3,4,5,7": -0.0006438128514443253, - "0,1,2,3,4,6,7": -0.00011356627164382793, - "0,1,2,3,5,6,7": -0.008425710075444792, - "0,1,2,4,5,6,7": 0.004137675103682126, - "0,1,3,4,5,6,7": -0.00017309091617634387, - "0,2,3,4,5,6,7": 0.00045544107505191, - "1,2,3,4,5,6,7": 3.538738192654378e-05 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=BII_order=8.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=BII_order=8.json deleted file mode 100644 index a56ad15fc..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=BII_order=8.json +++ /dev/null @@ -1,275 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.197468+00:00Z", - "metadata": { - "n_players": 8, - "index": "BII", - "max_order": 8, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 1.045849735980281 - }, - "data": { - "0": 0.24731994667792678, - "1": 0.4485331318341233, - "2": 0.0658381165967853, - "3": 0.05010673965797067, - "4": 0.02743096467346769, - "5": 1.1886230659155308, - "6": 0.2001904106667597, - "7": 0.6381783304423816, - "0,1": 0.30620406246694787, - "0,2": -0.00555511773629682, - "0,3": -0.0106795395035136, - "0,4": 0.035596354485710587, - "0,5": 0.3738658667243975, - "0,6": 0.1725060088637346, - "0,7": 0.07096886660431162, - "1,2": -0.058507243837554776, - "1,3": 0.006936103861311146, - "1,4": -0.007479337064901517, - "1,5": 0.1202230094253404, - "1,6": 0.14548333075127196, - "1,7": 0.15767014066865515, - "2,3": -0.008180076368850722, - "2,4": -0.007532983704680377, - "2,5": 0.08900992344658656, - "2,6": 0.0030683018650347477, - "2,7": 0.06131660257288261, - "3,4": -0.00850762006839488, - "3,5": 0.07021704331418388, - "3,6": -0.014568487429507074, - "3,7": -0.02896052875161996, - "4,5": 0.0055197078234471425, - "4,6": 0.0028835078801960484, - "4,7": 0.011114380468612198, - "5,6": 0.08079650023397794, - "5,7": -0.2685033297179996, - "6,7": 0.34998269095975243, - "0,1,2": -0.018851082429538202, - "0,1,3": 0.009907248081297948, - "0,1,4": 0.011733118794916064, - "0,1,5": 0.1268898275045992, - "0,1,6": 0.16314696275772636, - "0,1,7": 0.21390584710738167, - "0,2,3": 0.01062344165167442, - "0,2,4": 0.013730341515966776, - "0,2,5": -0.1268283605889948, - "0,2,6": 0.027118578573103805, - "0,2,7": -0.07552374354792973, - "0,3,4": -0.00637499348576491, - "0,3,5": 0.11966216487898834, - "0,3,6": -0.02189516363620929, - "0,3,7": -0.035914905426846264, - "0,4,5": 0.01640137003653054, - "0,4,6": -0.003587712980782462, - "0,4,7": 0.027891828976522107, - "0,5,6": -0.05235532788757019, - "0,5,7": -0.4432205522645835, - "0,6,7": 0.13886561480317183, - "1,2,3": -0.011036417896347905, - "1,2,4": 0.0025961583183446435, - "1,2,5": 0.08655901901935456, - "1,2,6": -0.008891591840425123, - "1,2,7": 0.009372205818700657, - "1,3,4": -0.0054890836823537625, - "1,3,5": 0.028483638990503574, - "1,3,6": -0.011299836373559441, - "1,3,7": -0.02137948884295024, - "1,4,5": -0.04667715497652539, - "1,4,6": 0.00567886509609164, - "1,4,7": 0.006142846339641711, - "1,5,6": 0.0327117631968523, - "1,5,7": -0.12431323478742287, - "1,6,7": 0.17100364982197064, - "2,3,4": -0.0025441953172685994, - "2,3,5": -0.0029780190873005263, - "2,3,6": 0.004043220062864589, - "2,3,7": 0.002386045994975633, - "2,4,5": -0.022951170988019604, - "2,4,6": -0.00011783414302304895, - "2,4,7": -0.000841063168020656, - "2,5,6": 0.01921794483798564, - "2,5,7": 0.06155986364993145, - "2,6,7": 0.036878356805788506, - "3,4,5": -0.015413163199801433, - "3,4,6": 0.0044948690698755345, - "3,4,7": -0.0003348015949957983, - "3,5,6": 0.02925574944122991, - "3,5,7": 0.013362147981973133, - "3,6,7": -0.013143439106036742, - "4,5,6": -0.02807947806552699, - "4,5,7": -0.028202008953004593, - "4,6,7": 0.012115259945239126, - "5,6,7": -0.2974524754443136, - "0,1,2,3": 0.02117940547929828, - "0,1,2,4": 0.008624041540626654, - "0,1,2,5": 0.07450750450992757, - "0,1,2,6": 0.012928456740665312, - "0,1,2,7": 0.009199262630120913, - "0,1,3,4": -0.004663453812038032, - "0,1,3,5": 0.06945652751387249, - "0,1,3,6": -0.01955369583079669, - "0,1,3,7": -0.03597948333813883, - "0,1,4,5": -0.018323124675839214, - "0,1,4,6": -0.001226098308179241, - "0,1,4,7": 0.011810744711610005, - "0,1,5,6": -0.015884537380773917, - "0,1,5,7": -0.17306895148238188, - "0,1,6,7": 0.19806558010890554, - "0,2,3,4": 0.004863157184574557, - "0,2,3,5": 0.016683058658604866, - "0,2,3,6": -0.004420775626289647, - "0,2,3,7": -0.0013055606115461305, - "0,2,4,5": 0.02841710923894583, - "0,2,4,6": 0.008040929422024862, - "0,2,4,7": 0.008522847440545683, - "0,2,5,6": -0.06763324206312923, - "0,2,5,7": -0.15174886909874785, - "0,2,6,7": -0.031176172295916155, - "0,3,4,5": -0.007042078275475067, - "0,3,4,6": 0.007681252981804915, - "0,3,4,7": -0.0011394340912243839, - "0,3,5,6": 0.02120464273370201, - "0,3,5,7": 0.05553004069407344, - "0,3,6,7": -0.016380445768365698, - "0,4,5,6": -0.037616735322958034, - "0,4,5,7": -0.01783281032886294, - "0,4,6,7": 0.008353183230199429, - "0,5,6,7": -0.4092786282466937, - "1,2,3,4": -0.0022216120949375973, - "1,2,3,5": 0.0034652797442408234, - "1,2,3,6": 0.0007831410605176337, - "1,2,3,7": 0.009913100072918457, - "1,2,4,5": 0.0007366053439661902, - "1,2,4,6": -0.001092192662150937, - "1,2,4,7": -0.00020564135314027343, - "1,2,5,6": 0.0006375014126192569, - "1,2,5,7": 0.0032188356169682852, - "1,2,6,7": 0.004620555462787446, - "1,3,4,5": -0.009486442964395658, - "1,3,4,6": 0.0002359871764195387, - "1,3,4,7": -0.0003743846823663355, - "1,3,5,6": 0.024874680058353527, - "1,3,5,7": 0.045996479295270454, - "1,3,6,7": -0.013621779880429952, - "1,4,5,6": -0.011668223317974957, - "1,4,5,7": -0.0066916218599300525, - "1,4,6,7": 0.0007905636059000742, - "1,5,6,7": -0.18583280699396548, - "2,3,4,5": -0.004178109362148852, - "2,3,4,6": -0.0001800535477189391, - "2,3,4,7": 0.0001980011854798014, - "2,3,5,6": 0.00056253780551202, - "2,3,5,7": -0.010319692617996645, - "2,3,6,7": 0.006561048697898697, - "2,4,5,6": -0.008095890584772059, - "2,4,5,7": -0.014322602405838769, - "2,4,6,7": 0.001962981159366939, - "2,5,6,7": 0.0039008628851723848, - "3,4,5,6": 0.00648982632045797, - "3,4,5,7": -0.0011283349001680043, - "3,4,6,7": 0.002582712995615133, - "3,5,6,7": 0.06957935295033993, - "4,5,6,7": -0.02283279421422918, - "0,1,2,3,4": 0.004362810876316903, - "0,1,2,3,5": -0.002995290929714456, - "0,1,2,3,6": 0.0036845826904682855, - "0,1,2,3,7": -0.011445729624705747, - "0,1,2,4,5": 0.01060083647608473, - "0,1,2,4,6": -0.0008849009219059067, - "0,1,2,4,7": 0.0038815715766671866, - "0,1,2,5,6": 0.0004343119377828164, - "0,1,2,5,7": -0.028136644454713478, - "0,1,2,6,7": 0.02765946610584563, - "0,1,3,4,5": -0.006700569643997789, - "0,1,3,4,6": 0.00204002449260704, - "0,1,3,4,7": -0.002423551746649266, - "0,1,3,5,6": 0.026711291492269862, - "0,1,3,5,7": 0.021232132878931165, - "0,1,3,6,7": -0.025716052101363684, - "0,1,4,5,6": -0.01881393978051321, - "0,1,4,5,7": -0.007356736285210774, - "0,1,4,6,7": -0.0016702339720446324, - "0,1,5,6,7": -0.26874576733498334, - "0,2,3,4,5": 0.008438490657661835, - "0,2,3,4,6": 0.0003391439970220067, - "0,2,3,4,7": 0.00020396162896513248, - "0,2,3,5,6": -0.007346358882294846, - "0,2,3,5,7": 0.011770494725837022, - "0,2,3,6,7": -0.00902862623185996, - "0,2,4,5,6": 0.005275049754891681, - "0,2,4,5,7": 0.0096339617992664, - "0,2,4,6,7": 0.004871835057568608, - "0,2,5,6,7": -0.09414442603818157, - "0,3,4,5,6": 0.010298099139704642, - "0,3,4,5,7": -0.0008536296275058475, - "0,3,4,6,7": 0.003095520939031815, - "0,3,5,6,7": 0.08240230973740298, - "0,4,5,6,7": -0.03351345036038417, - "1,2,3,4,5": -0.001802051398868243, - "1,2,3,4,6": 0.0002801385766885156, - "1,2,3,4,7": -0.00038612595931997173, - "1,2,3,5,6": -0.004027999895924617, - "1,2,3,5,7": -0.002978512463734595, - "1,2,3,6,7": 0.00415105985601838, - "1,2,4,5,6": -0.0015191877049035574, - "1,2,4,5,7": 0.0006966771567599173, - "1,2,4,6,7": -0.0023370178210286863, - "1,2,5,6,7": -0.010972051148461559, - "1,3,4,5,6": 0.001158687740952069, - "1,3,4,5,7": -0.0016871282830311918, - "1,3,4,6,7": 0.00045918192855054496, - "1,3,5,6,7": 0.059685736389364474, - "1,4,5,6,7": -0.002979944012982849, - "2,3,4,5,6": -0.0008162909960981457, - "2,3,4,5,7": 0.0004327232463078312, - "2,3,4,6,7": 0.00012828176844281725, - "2,3,5,6,7": -0.0013727403210926914, - "2,4,5,6,7": -0.005972788817966701, - "3,4,5,6,7": 0.002764449808270064, - "0,1,2,3,4,5": 0.004503145079001292, - "0,1,2,3,4,6": -0.0005193769082284527, - "0,1,2,3,4,7": -0.0004287020329006852, - "0,1,2,3,5,6": -0.0059770303981211415, - "0,1,2,3,5,7": -0.009310524586868874, - "0,1,2,3,6,7": -0.002946824556545047, - "0,1,2,4,5,6": 0.0010017772458440488, - "0,1,2,4,5,7": 0.0029662385047813933, - "0,1,2,4,6,7": -0.0018964375681181922, - "0,1,2,5,6,7": -0.025531222098407413, - "0,1,3,4,5,6": 0.0023171735566481777, - "0,1,3,4,5,7": -0.003176212384875865, - "0,1,3,4,6,7": 0.0006734485297078541, - "0,1,3,5,6,7": 0.0686748739354186, - "0,1,4,5,6,7": -0.006217323836971489, - "0,2,3,4,5,6": 0.0016726824680098895, - "0,2,3,4,5,7": 2.2919105347907198e-05, - "0,2,3,4,6,7": -0.00025553758519458736, - "0,2,3,5,6,7": -0.002156194546705237, - "0,2,4,5,6,7": -0.0038986754216288055, - "0,3,4,5,6,7": 0.0033151481001364447, - "1,2,3,4,5,6": -0.00010841032563546626, - "1,2,3,4,5,7": -0.0005672589415810503, - "1,2,3,4,6,7": 5.678313582202499e-05, - "1,2,3,5,6,7": -0.002049443277983398, - "1,2,4,5,6,7": 0.0021097250110171384, - "1,3,4,5,6,7": 1.3401033638338333e-07, - "2,3,4,5,6,7": -0.0002269207681904195, - "0,1,2,3,4,5,6": 0.00013502016099198322, - "0,1,2,3,4,5,7": -0.0006438128514443253, - "0,1,2,3,4,6,7": -0.00011356627164382793, - "0,1,2,3,5,6,7": -0.008425710075444792, - "0,1,2,4,5,6,7": 0.004137675103682126, - "0,1,3,4,5,6,7": -0.00017309091617634387, - "0,2,3,4,5,6,7": 0.00045544107505191, - "1,2,3,4,5,6,7": 3.538738192654378e-05, - "0,1,2,3,4,5,6,7": -7.077476384909076e-05 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=BV_order=1.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=BV_order=1.json deleted file mode 100644 index b45b6db53..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=BV_order=1.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.242955+00:00Z", - "metadata": { - "n_players": 8, - "index": "BV", - "max_order": 1, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.072184995821221 - }, - "data": { - "0": 0.24731994667792645, - "1": 0.4485331318341229, - "2": 0.06583811659678519, - "3": 0.05010673965797155, - "4": 0.027430964673466736, - "5": 1.1886230659155306, - "6": 0.20019041066675947, - "7": 0.6381783304423816 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=FBII_order=1.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=FBII_order=1.json deleted file mode 100644 index 67da715ea..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=FBII_order=1.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.190845+00:00Z", - "metadata": { - "n_players": 8, - "index": "BV", - "max_order": 1, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": -0.3872606172521915 - }, - "data": { - "0": 0.24731994667792723, - "1": 0.44853313183412347, - "2": 0.06583811659678485, - "3": 0.05010673965797069, - "4": 0.027430964673468113, - "5": 1.18862306591553, - "6": 0.20019041066675902, - "7": 0.6381783304423811 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=FBII_order=2.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=FBII_order=2.json deleted file mode 100644 index 47a5f812a..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=FBII_order=2.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.185345+00:00Z", - "metadata": { - "n_players": 8, - "index": "FBII", - "max_order": 2, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 0.02396141730606677 - }, - "data": { - "0": -0.22413330427471864, - "1": 0.11326809869858813, - "2": 0.029028413478225358, - "3": 0.04697829213116715, - "4": 0.0116339597634742, - "5": 0.953058705290564, - "6": -0.1698855158954711, - "7": 0.4613839190400848, - "0,1": 0.3062040624669486, - "0,2": -0.0055551177362969445, - "0,3": -0.010679539503513816, - "0,4": 0.03559635448570994, - "0,5": 0.3738658667243972, - "0,6": 0.17250600886373477, - "0,7": 0.0709688666043119, - "1,2": -0.05850724383755468, - "1,3": 0.006936103861311286, - "1,4": -0.0074793370649019406, - "1,5": 0.1202230094253408, - "1,6": 0.1454833307512721, - "1,7": 0.15767014066865545, - "2,3": -0.008180076368850618, - "2,4": -0.007532983704680549, - "2,5": 0.0890099234465864, - "2,6": 0.0030683018650344983, - "2,7": 0.06131660257288245, - "3,4": -0.008507620068394596, - "3,5": 0.07021704331418446, - "3,6": -0.014568487429507393, - "3,7": -0.028960528751619925, - "4,5": 0.005519707823446696, - "4,6": 0.0028835078801958407, - "4,7": 0.011114380468611924, - "5,6": 0.08079650023397751, - "5,7": -0.26850332971799884, - "6,7": 0.3499826909597527 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=FBII_order=3.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=FBII_order=3.json deleted file mode 100644 index 28a268044..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=FBII_order=3.json +++ /dev/null @@ -1,112 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.189485+00:00Z", - "metadata": { - "n_players": 8, - "index": "FBII", - "max_order": 3, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 0.026456211136307462 - }, - "data": { - "0": -0.2003021786663035, - "1": 0.268316413703153, - "2": 0.029908837788679393, - "3": 0.06558204675715353, - "4": -0.0033230408520170465, - "5": 0.7894668411142837, - "6": -0.11795852216185994, - "7": 0.37467340756738304, - "0,1": 0.0528381015587564, - "0,2": 0.07931029467656069, - "0,3": -0.048683435535084335, - "0,4": 0.005699378057015897, - "0,5": 0.5535913058849118, - "0,6": 0.04685953304901437, - "0,7": 0.15796682178045257, - "1,2": -0.08838138933259848, - "1,3": 0.012343073723014741, - "1,4": 0.005528287990041826, - "1,5": 0.06839607995165967, - "1,6": -0.030691575578056785, - "1,7": 0.0303042279399931, - "2,3": -0.008427114073148612, - "2,4": -0.0024691018136709236, - "2,5": 0.08172028502510711, - "2,6": -0.036056035283111076, - "2,7": 0.04440076979616021, - "3,4": 0.004323064036760332, - "3,5": -0.015969216188609303, - "3,6": -0.010296187158588432, - "3,7": -0.0014483082546817953, - "4,5": 0.06798051089661855, - "4,6": 0.007631523419262265, - "4,7": 0.0027283496959198267, - "5,6": 0.22914741219465, - "5,7": 0.1406298001907122, - "6,7": 0.3258492075468419, - "0,1,2": -0.018851082429537896, - "0,1,3": 0.009907248081293153, - "0,1,4": 0.011733118794921671, - "0,1,5": 0.12688982750460445, - "0,1,6": 0.16314696275772203, - "0,1,7": 0.2139058471073829, - "0,2,3": 0.01062344165167746, - "0,2,4": 0.013730341515966527, - "0,2,5": -0.126828360588998, - "0,2,6": 0.027118578573102792, - "0,2,7": -0.07552374354793197, - "0,3,4": -0.00637499348576312, - "0,3,5": 0.11966216487898698, - "0,3,6": -0.02189516363620972, - "0,3,7": -0.035914905426843516, - "0,4,5": 0.016401370036527668, - "0,4,6": -0.0035877129807797836, - "0,4,7": 0.02789182897651657, - "0,5,6": -0.052355327887573536, - "0,5,7": -0.44322055226457857, - "0,6,7": 0.1388656148031758, - "1,2,3": -0.01103641789634846, - "1,2,4": 0.0025961583183429643, - "1,2,5": 0.08655901901935567, - "1,2,6": -0.008891591840421417, - "1,2,7": 0.009372205818700304, - "1,3,4": -0.0054890836823530825, - "1,3,5": 0.028483638990501534, - "1,3,6": -0.011299836373556332, - "1,3,7": -0.021379488842949365, - "1,4,5": -0.04667715497652902, - "1,4,6": 0.005678865096087393, - "1,4,7": 0.006142846339643265, - "1,5,6": 0.032711763196853275, - "1,5,7": -0.12431323478742423, - "1,6,7": 0.17100364982196697, - "2,3,4": -0.002544195317270667, - "2,3,5": -0.0029780190872986667, - "2,3,6": 0.004043220062861133, - "2,3,7": 0.002386045994973801, - "2,4,5": -0.02295117098802099, - "2,4,6": -0.00011783414302488776, - "2,4,7": -0.0008410631680159514, - "2,5,6": 0.01921794483798371, - "2,5,7": 0.06155986364992922, - "2,6,7": 0.03687835680579306, - "3,4,5": -0.015413163199801433, - "3,4,6": 0.004494869069878844, - "3,4,7": -0.0003348015949986641, - "3,5,6": 0.029255749441231244, - "3,5,7": 0.01336214798197563, - "3,6,7": -0.013143439106041696, - "4,5,6": -0.02807947806552543, - "4,5,7": -0.028202008953002816, - "4,6,7": 0.012115259945237933, - "5,6,7": -0.29745247544431674 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=FBII_order=4.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=FBII_order=4.json deleted file mode 100644 index 2a8624063..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=FBII_order=4.json +++ /dev/null @@ -1,182 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.174389+00:00Z", - "metadata": { - "n_players": 8, - "index": "FBII", - "max_order": 4, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": -0.00819056900933797 - }, - "data": { - "0": -0.1441513846990643, - "1": 0.2681726385222092, - "2": 0.038330611667630646, - "3": 0.036101434856541936, - "4": 0.00555342105133854, - "5": 0.8829324225285686, - "6": -0.059628737757343446, - "7": 0.4562276402457321, - "0,1": 0.08710614616047993, - "0,2": 0.06348058296397929, - "0,3": -0.022155146062065242, - "0,4": 0.0053167607909369585, - "0,5": 0.3954337825034699, - "0,6": -0.03986453835745004, - "0,7": 0.02135964766884864, - "1,2": -0.051807828456503, - "1,3": 0.034844010672461095, - "1,4": -0.002910425348070414, - "1,5": 0.01888050615664841, - "1,6": -0.032177292765081605, - "1,7": -0.002735659081467612, - "2,3": 0.001968617433937489, - "2,4": 0.0052982908125535355, - "2,5": 0.05067800729594485, - "2,6": -0.054206113316460594, - "2,7": 0.004155508988169854, - "3,4": 0.0022323225652365417, - "3,5": 0.05445272572493959, - "3,6": 0.011303420873168657, - "3,7": 0.026079596745659468, - "4,5": 0.03708670406930567, - "4,6": -0.0040121143472968135, - "4,7": -0.004848297680844216, - "5,6": 0.07124904870507084, - "5,7": -0.06307808498603831, - "6,7": 0.23017276097098516, - "0,1,2": -0.0820704178798518, - "0,1,3": -0.005312401924810695, - "0,1,4": 0.013622064066835485, - "0,1,5": 0.1585461182621962, - "0,1,6": 0.07598211009282176, - "0,1,7": 0.20889227079230854, - "0,2,3": -0.007876200890638854, - "0,2,4": -0.015503700897390685, - "0,2,5": -0.07694114121179363, - "0,2,6": 0.06824898048443587, - "0,2,7": 0.007730502419847629, - "0,3,4": -0.006224715479589908, - "0,3,5": 0.041746069216604176, - "0,3,6": -0.01616065288123822, - "0,3,7": -0.03627746386925747, - "0,4,5": 0.042600189718645626, - "0,4,6": 0.00379602101779538, - "0,4,7": 0.023034563495399604, - "0,5,6": 0.20224892225236146, - "0,5,7": -0.09502094303327649, - "0,6,7": 0.26407385628911617, - "1,2,3": -0.027596075027347323, - "1,2,4": -0.0003244420688442301, - "1,2,5": 0.045276155705492926, - "1,2,6": -0.01783032284764352, - "1,2,7": -0.004000850396117868, - "1,3,4": 0.0027658695063007485, - "1,3,5": -0.03866962283315948, - "1,3,6": -0.007659002665594598, - "1,3,7": -0.024346454576582972, - "1,4,5": -0.023960751239431935, - "1,4,6": 0.012158846849091826, - "1,4,7": 0.003478016128599673, - "1,5,6": 0.12664845630771782, - "1,5,7": 0.03387579792459212, - "1,6,7": 0.1689925936703655, - "2,3,4": -0.0017848869999046793, - "2,3,5": -0.0060845562013944615, - "2,3,6": 0.002390270867905938, - "2,3,7": -0.00013740236838313824, - "2,4,5": -0.02422972710311498, - "2,4,6": -0.0004357210364114711, - "2,4,7": 0.0010811438187676575, - "2,5,6": 0.054532060110266595, - "2,5,7": 0.14619559646015473, - "2,6,7": 0.043943718851138035, - "3,4,5": -0.007740593608925941, - "3,4,6": -0.003909993893421698, - "3,4,7": -0.0004040818486678588, - "3,5,6": -0.032099770492956294, - "3,5,7": -0.06646677472878204, - "3,6,7": -0.03750388360356932, - "4,5,6": 0.00878243049421397, - "4,5,7": 0.003202072901516889, - "4,6,7": 0.016686936556824752, - "5,6,7": -0.02522046863463168, - "0,1,2,3": 0.021179405479294117, - "0,1,2,4": 0.008624041540624919, - "0,1,2,5": 0.0745075045099284, - "0,1,2,6": 0.012928456740663327, - "0,1,2,7": 0.009199262630121753, - "0,1,3,4": -0.004663453812033001, - "0,1,3,5": 0.0694565275138751, - "0,1,3,6": -0.0195536958307935, - "0,1,3,7": -0.0359794833381263, - "0,1,4,5": -0.01832312467584684, - "0,1,4,6": -0.0012260983081903015, - "0,1,4,7": 0.011810744711612337, - "0,1,5,6": -0.015884537380771845, - "0,1,5,7": -0.1730689514823742, - "0,1,6,7": 0.19806558010891054, - "0,2,3,4": 0.00486315718457998, - "0,2,3,5": 0.016683058658599315, - "0,2,3,6": -0.004420775626293838, - "0,2,3,7": -0.0013055606115492946, - "0,2,4,5": 0.028417109238947788, - "0,2,4,6": 0.00804092942201954, - "0,2,4,7": 0.008522847440544254, - "0,2,5,6": -0.06763324206312826, - "0,2,5,7": -0.15174886909874916, - "0,2,6,7": -0.03117617229592229, - "0,3,4,5": -0.007042078275481027, - "0,3,4,6": 0.007681252981805001, - "0,3,4,7": -0.0011394340912192838, - "0,3,5,6": 0.02120464273370242, - "0,3,5,7": 0.05553004069407736, - "0,3,6,7": -0.016380445768364046, - "0,4,5,6": -0.037616735322968144, - "0,4,5,7": -0.017832810328870644, - "0,4,6,7": 0.008353183230183955, - "0,5,6,7": -0.4092786282466933, - "1,2,3,4": -0.0022216120949363274, - "1,2,3,5": 0.003465279744230658, - "1,2,3,6": 0.0007831410605134356, - "1,2,3,7": 0.009913100072904565, - "1,2,4,5": 0.0007366053439730041, - "1,2,4,6": -0.0010921926621484668, - "1,2,4,7": -0.0002056413531378934, - "1,2,5,6": 0.0006375014126257239, - "1,2,5,7": 0.0032188356169634696, - "1,2,6,7": 0.004620555462787258, - "1,3,4,5": -0.00948644296440182, - "1,3,4,6": 0.00023598717642147465, - "1,3,4,7": -0.0003743846823600211, - "1,3,5,6": 0.02487468005835445, - "1,3,5,7": 0.04599647929526961, - "1,3,6,7": -0.013621779880426815, - "1,4,5,6": -0.011668223317978548, - "1,4,5,7": -0.006691621859929935, - "1,4,6,7": 0.0007905636058996163, - "1,5,6,7": -0.18583280699395782, - "2,3,4,5": -0.0041781093621468465, - "2,3,4,6": -0.000180053547709981, - "2,3,4,7": 0.0001980011854804259, - "2,3,5,6": 0.0005625378055132482, - "2,3,5,7": -0.010319692618007605, - "2,3,6,7": 0.006561048697891092, - "2,4,5,6": -0.008095890584759124, - "2,4,5,7": -0.014322602405832392, - "2,4,6,7": 0.001962981159367029, - "2,5,6,7": 0.0039008628851762914, - "3,4,5,6": 0.006489826320456291, - "3,4,5,7": -0.0011283349001725007, - "3,4,6,7": 0.0025827129956148415, - "3,5,6,7": 0.06957935295034215, - "4,5,6,7": -0.022832794214233704 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=FBII_order=5.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=FBII_order=5.json deleted file mode 100644 index a8f1a92cb..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=FBII_order=5.json +++ /dev/null @@ -1,238 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.177067+00:00Z", - "metadata": { - "n_players": 8, - "index": "FBII", - "max_order": 5, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": -0.0003801029367207911 - }, - "data": { - "0": -0.16182888544730728, - "1": 0.25338883069041107, - "2": 0.03274802755999415, - "3": 0.04635508888558476, - "4": 0.0042561647569326014, - "5": 0.8672324065636344, - "6": -0.07553015056541033, - "7": 0.43881190324561403, - "0,1": 0.12139144469409047, - "0,2": 0.07133376543886985, - "0,3": -0.03566377787058492, - "0,4": 0.00646372403375501, - "0,5": 0.4306600118456899, - "0,6": -0.0032330233225648236, - "0,7": 0.0611450968348593, - "1,2": -0.05034107132266008, - "1,3": 0.0268936813131046, - "1,4": 0.000224756990159225, - "1,5": 0.04865502481475749, - "1,6": -0.005751966079634324, - "1,7": 0.02839804958303478, - "2,3": 0.0030196222689303776, - "2,4": 0.0008699009434510168, - "2,5": 0.06502823195809965, - "2,6": -0.04275629843709827, - "2,7": 0.0170735877330897, - "3,4": -0.00018419832791798443, - "3,5": 0.03016349530313582, - "3,6": -0.007307884142856685, - "3,7": 0.009775377177165867, - "4,5": 0.04117629671074849, - "4,6": 0.0007125533007103016, - "4,7": -0.0007217424338183676, - "5,6": 0.10393592486670261, - "5,7": -0.02931616831028666, - "6,7": 0.2640771680422168, - "0,1,2": -0.08028016444683453, - "0,1,3": -0.0031249898287682293, - "0,1,4": 0.009380891834656666, - "0,1,5": 0.0901035243511719, - "0,1,6": 0.01215680574484515, - "0,1,7": 0.13571188455275812, - "0,2,3": -0.008380331163723193, - "0,2,4": -0.0038230106717546536, - "0,2,5": -0.09855853495014037, - "0,2,6": 0.05096399985175785, - "0,2,7": -0.01345303144398284, - "0,3,4": -0.0015246403012933035, - "0,3,5": 0.07748531160367235, - "0,3,6": 0.0054593309370079834, - "0,3,7": -0.01896825622472223, - "0,4,5": 0.036852217751125745, - "0,4,6": -0.0034446918957327377, - "0,4,7": 0.017001875747820534, - "0,5,6": 0.1278882021687774, - "0,5,7": -0.1719488817731603, - "0,6,7": 0.18537650023936528, - "1,2,3": -0.030385354595558703, - "1,2,4": 0.0028987456452886917, - "1,2,5": 0.035101177599073316, - "1,2,6": -0.013713222429000707, - "1,2,7": -0.008967677090294307, - "1,3,4": 0.0015912236521248325, - "1,3,5": -0.01652054886160137, - "1,3,6": 0.009447660126812998, - "1,3,7": -0.014123701858062037, - "1,4,5": -0.031061590173361617, - "1,4,6": 0.006092048980441238, - "1,4,7": 2.7189274039364497e-05, - "1,5,6": 0.07188124072837195, - "1,5,7": -0.026434761464915055, - "1,6,7": 0.11387618814259642, - "2,3,4": 0.0010103835993994885, - "2,3,5": -0.006258940265876922, - "2,3,6": -0.001111931491749013, - "2,3,7": -0.0022687057121775767, - "2,4,5": -0.017987872059797294, - "2,4,6": -0.000594655313210693, - "2,4,7": 0.0038694137277045237, - "2,5,6": 0.024416439582227986, - "2,5,7": 0.11593476988116874, - "2,6,7": 0.022189466953459323, - "3,4,5": -0.00493239844807386, - "3,4,6": 0.001026815455389539, - "3,4,7": 2.933907711794026e-05, - "3,5,6": 0.01026452556019053, - "3,5,7": -0.023617815706086995, - "3,6,7": -0.008361603160369685, - "4,5,6": -0.0022473983130345196, - "4,5,7": -0.0065068934425941555, - "4,6,7": 0.007898395186190954, - "5,6,7": -0.09343263665937111, - "0,1,2,3": 0.024376218973121103, - "0,1,2,4": -0.0003561174629491126, - "0,1,2,5": 0.08455589799521007, - "0,1,2,6": -0.002518273165424384, - "0,1,2,7": 0.013219930828580504, - "0,1,3,4": -0.003302810801171875, - "0,1,3,5": 0.05033274561513424, - "0,1,3,6": -0.022913619117781645, - "0,1,3,7": -0.026802883041238013, - "0,1,4,5": -0.007187920059013912, - "0,1,4,6": 0.008438426782756442, - "0,1,4,7": 0.015595219925233793, - "0,1,5,6": 0.11432251446195531, - "0,1,5,7": -0.031565443884387194, - "0,1,6,7": 0.3323018737601881, - "0,2,3,4": -0.0018090463954118646, - "0,2,3,5": 0.011749390872858145, - "0,2,3,6": 0.0017548535870421378, - "0,2,3,7": 0.0029443891393332033, - "0,2,4,5": 0.011442939894991032, - "0,2,4,6": 0.0032403654782356094, - "0,2,4,7": -0.0007728175906960566, - "0,2,5,6": -0.01974253044922874, - "0,2,5,7": -0.10131056211485616, - "0,2,6,7": 0.004144703257394959, - "0,3,4,5": -0.012633273538408714, - "0,3,4,6": -0.00020514130238113298, - "0,3,4,7": -0.001150584688151185, - "0,3,5,6": -0.03482802800983864, - "0,3,5,7": -0.001745613163261231, - "0,3,6,7": -0.04175702193997233, - "0,4,5,6": -0.01923961469981006, - "0,4,5,7": -0.0017878830919524705, - "0,4,6,7": 0.02196134739810847, - "0,5,6,7": -0.25227796124862223, - "1,2,3,4": -0.0034489981423514345, - "1,2,3,5": 0.009367207088357532, - "1,2,3,6": -0.0012607495531055009, - "1,2,3,7": 0.0152427541687895, - "1,2,4,5": -0.003251531920576131, - "1,2,4,6": 0.0011382912734224093, - "1,2,4,7": -0.001133193829683743, - "1,2,5,6": 0.008679964818370835, - "1,2,5,7": 0.023914101072040044, - "1,2,6,7": -0.004630173033394119, - "1,3,4,5": -0.004970912171929154, - "1,3,4,6": -0.0017330291929817977, - "1,3,4,7": 0.001644427347854166, - "1,3,5,6": -0.0168891778049789, - "1,3,5,7": 0.007870365034503887, - "1,3,6,7": -0.03291174291671119, - "1,4,5,6": -0.0005910314392543886, - "1,4,5,7": -0.0010280561477022804, - "1,4,6,7": 0.004054570544650721, - "1,5,6,7": -0.07432679394043529, - "2,3,4,5": -0.007304545116662273, - "2,3,4,6": -0.00014569022075259716, - "2,3,4,7": 8.580843269934135e-06, - "2,3,5,6": 0.007344232853212979, - "2,3,5,7": -0.01424567521166381, - "2,3,6,7": 0.009622061162140289, - "2,4,5,6": -0.006579281702742877, - "2,4,5,7": -0.016717889098036426, - "2,4,6,7": 0.003617826065850472, - "2,5,6,7": 0.06013186604801785, - "3,4,5,6": -0.0002126465259657418, - "3,4,5,7": -0.0014565424722041975, - "3,4,6,7": -0.0006410042265437982, - "3,5,6,7": -0.002160524856637952, - "4,5,6,7": -0.0029819275227104328, - "0,1,2,3,4": 0.004362810876315678, - "0,1,2,3,5": -0.0029952909297160588, - "0,1,2,3,6": 0.003684582690465194, - "0,1,2,3,7": -0.01144572962470844, - "0,1,2,4,5": 0.010600836476080712, - "0,1,2,4,6": -0.0008849009219066041, - "0,1,2,4,7": 0.003881571576663072, - "0,1,2,5,6": 0.0004343119377820531, - "0,1,2,5,7": -0.028136644454714727, - "0,1,2,6,7": 0.027659466105840826, - "0,1,3,4,5": -0.0067005696440010434, - "0,1,3,4,6": 0.0020400244926073972, - "0,1,3,4,7": -0.00242355174664983, - "0,1,3,5,6": 0.026711291492268894, - "0,1,3,5,7": 0.021232132878931668, - "0,1,3,6,7": -0.02571605210136655, - "0,1,4,5,6": -0.018813939780517284, - "0,1,4,5,7": -0.007356736285213647, - "0,1,4,6,7": -0.0016702339720499615, - "0,1,5,6,7": -0.2687457673349861, - "0,2,3,4,5": 0.00843849065766334, - "0,2,3,4,6": 0.00033914399702798803, - "0,2,3,4,7": 0.00020396162897116932, - "0,2,3,5,6": -0.0073463588822964415, - "0,2,3,5,7": 0.01177049472583892, - "0,2,3,6,7": -0.009028626231860251, - "0,2,4,5,6": 0.00527504975489386, - "0,2,4,5,7": 0.009633961799268842, - "0,2,4,6,7": 0.004871835057572143, - "0,2,5,6,7": -0.09414442603817973, - "0,3,4,5,6": 0.01029809913970657, - "0,3,4,5,7": -0.0008536296275025203, - "0,3,4,6,7": 0.0030955209390364016, - "0,3,5,6,7": 0.08240230973740068, - "0,4,5,6,7": -0.033513450360383265, - "1,2,3,4,5": -0.0018020513988642878, - "1,2,3,4,6": 0.00028013857669044635, - "1,2,3,4,7": -0.00038612595931545104, - "1,2,3,5,6": -0.004027999895925269, - "1,2,3,5,7": -0.002978512463730468, - "1,2,3,6,7": 0.0041510598560167734, - "1,2,4,5,6": -0.0015191877049017949, - "1,2,4,5,7": 0.0006966771567636209, - "1,2,4,6,7": -0.0023370178210304522, - "1,2,5,6,7": -0.010972051148457389, - "1,3,4,5,6": 0.001158687740952291, - "1,3,4,5,7": -0.001687128283026678, - "1,3,4,6,7": 0.00045918192855110354, - "1,3,5,6,7": 0.05968573638936414, - "1,4,5,6,7": -0.002979944012980601, - "2,3,4,5,6": -0.0008162909960941489, - "2,3,4,5,7": 0.0004327232463177816, - "2,3,4,6,7": 0.00012828176845031125, - "2,3,5,6,7": -0.0013727403210903391, - "2,4,5,6,7": -0.005972788817960758, - "3,4,5,6,7": 0.0027644498082734885 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=FBII_order=6.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=FBII_order=6.json deleted file mode 100644 index 30a88450a..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=FBII_order=6.json +++ /dev/null @@ -1,266 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.183042+00:00Z", - "metadata": { - "n_players": 8, - "index": "FBII", - "max_order": 6, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": -3.560366417228427e-05 - }, - "data": { - "0": -0.16254242746607134, - "1": 0.25265212656256264, - "2": 0.03410863032458321, - "3": 0.044682780397874475, - "4": 0.004214154789032334, - "5": 0.8663772628002165, - "6": -0.07640634896230611, - "7": 0.43821321597292323, - "0,1": 0.1228997573490983, - "0,2": 0.06866165523263625, - "0,3": -0.03213821613466098, - "0,4": 0.006468740711996768, - "0,5": 0.4324229352657887, - "0,6": -0.001466993265324873, - "0,7": 0.06238478268218947, - "1,2": -0.05275966893006667, - "1,3": 0.03009004224020438, - "1,4": 0.00026942593229084544, - "1,5": 0.05044475240802021, - "1,6": -0.0039027256762474705, - "1,7": 0.029795377948184112, - "2,3": 0.0018764538851718249, - "2,4": 0.0011468978808339483, - "2,5": 0.06268140739865494, - "2,6": -0.04530161753674279, - "2,7": 0.014316583006379002, - "3,4": 0.0002707401119620423, - "3,5": 0.03372187536717719, - "3,6": -0.003403477557296041, - "3,7": 0.013001982685642902, - "4,5": 0.04140843054837026, - "4,6": 0.00058906515341417, - "4,7": -0.0011919094427256388, - "5,6": 0.10599381822005888, - "5,7": -0.02781896438505596, - "6,7": 0.26593038885861264, - "0,1,2": -0.07551279478187238, - "0,1,3": -0.009851236107907717, - "0,1,4": 0.009477925561548849, - "0,1,5": 0.08644716247414223, - "0,1,6": 0.008459423507213397, - "0,1,7": 0.13286097031461946, - "0,2,3": -0.006455900668437098, - "0,2,4": -0.004219014782633257, - "0,2,5": -0.09397017436905256, - "0,2,6": 0.0560273547729028, - "0,2,7": -0.008023661345703967, - "0,3,4": -0.002540226292256559, - "0,3,5": 0.06999956406268315, - "0,3,6": -0.00264046438736798, - "0,3,7": -0.025769805471907575, - "0,4,5": 0.03653885869908697, - "0,4,6": -0.002968801718268667, - "0,4,7": 0.018113767571515147, - "0,5,6": 0.1237380510432525, - "0,5,7": -0.17503501011943703, - "0,6,7": 0.181656343370404, - "1,2,3": -0.02821689924389875, - "1,2,4": 0.0020090602453318035, - "1,2,5": 0.03922155307258497, - "1,2,6": -0.009230664961429682, - "1,2,7": -0.0042679687889171924, - "1,3,4": 0.001247383187377521, - "1,3,5": -0.023308854694873843, - "1,3,6": 0.0019324941641776817, - "1,3,7": -0.020489486086857196, - "1,4,5": -0.031415213663144315, - "1,4,6": 0.006414862374178015, - "1,4,7": 0.0008371399706705446, - "1,5,6": 0.06760370900062093, - "1,5,7": -0.029797134756756462, - "1,6,7": 0.10976697398209861, - "2,3,4": 0.0004917181961159936, - "2,3,5": -0.0044843107417827655, - "2,3,6": 0.00045185260362349405, - "2,3,7": -3.599270530983342e-05, - "2,4,5": -0.018922274804408133, - "2,4,6": -0.0003366064736515101, - "2,4,7": 0.004134147047793545, - "2,5,6": 0.028811903596191894, - "2,5,7": 0.12076493950870124, - "2,6,7": 0.02678881041297656, - "3,4,5": -0.005901448435460914, - "3,4,6": 0.00016117492873780892, - "3,4,7": 0.00010261393105695515, - "3,5,6": 0.0020817739659658996, - "3,5,7": -0.030433630786698664, - "3,6,7": -0.01649728653244618, - "4,5,6": -0.0022430620679750983, - "4,5,7": -0.005797865114871497, - "4,6,7": 0.008690852235344194, - "5,6,7": -0.097685149297741, - "0,1,2,3": 0.02070639062219065, - "0,1,2,4": 0.00105054361714009, - "0,1,2,5": 0.0764689939317436, - "0,1,2,6": -0.011485551736335434, - "0,1,2,7": 0.003933062744046575, - "0,1,3,4": -0.002460441841338798, - "0,1,3,5": 0.06459060191541588, - "0,1,3,6": -0.007358053078080233, - "0,1,3,7": -0.013431368315260692, - "0,1,4,5": -0.0068392205179304, - "0,1,4,6": 0.007278242037472987, - "0,1,4,7": 0.013575472728133225, - "0,1,5,6": 0.12288957656302855, - "0,1,5,7": -0.024713986501139092, - "0,1,6,7": 0.34049100236143537, - "0,2,3,4": -0.0005602638639074162, - "0,2,3,5": 0.008938140153022685, - "0,2,3,6": -0.0007907167946763979, - "0,2,3,7": -0.000824326911398221, - "0,2,4,5": 0.013009961640328506, - "0,2,4,6": 0.0022664735358958084, - "0,2,4,7": -0.0016453663401060983, - "0,2,5,6": -0.0284646961369791, - "0,2,5,7": -0.11078742687572446, - "0,2,6,7": -0.005026519686771425, - "0,3,4,5": -0.010469559557340247, - "0,3,4,6": 0.0015957432378835915, - "0,3,4,7": -0.0011128187550976248, - "0,3,5,6": -0.017866364731009814, - "0,3,5,7": 0.012596889242335318, - "0,3,6,7": -0.024930793470771345, - "0,4,5,6": -0.01969191917180419, - "0,4,5,7": -0.003534859575256434, - "0,4,6,7": 0.019891502952597943, - "0,5,6,7": -0.24373130971566348, - "1,2,3,4": -0.002714953140765003, - "1,2,3,5": 0.005989826475550256, - "1,2,3,6": -0.004146825135803389, - "1,2,3,7": 0.011431261603767728, - "1,2,4,5": -0.0007752277772534871, - "1,2,4,6": 0.0012993064210696792, - "1,2,4,7": -0.0005731068024506791, - "1,2,5,6": 0.0010413138575506922, - "1,2,5,7": 0.01581847972476616, - "1,2,6,7": -0.01219452787198242, - "1,3,4,5": -0.004228769423471182, - "1,3,4,6": -0.0011280911933570503, - "1,3,4,7": 0.0007839754269625132, - "1,3,5,6": -0.0011748534298376481, - "1,3,5,7": 0.021263257223110024, - "1,3,6,7": -0.01680949997254507, - "1,4,5,6": -0.0008152625239628494, - "1,4,5,7": -0.0022492305570529503, - "1,4,6,7": 0.0027361528650667183, - "1,5,6,7": -0.06508010800459675, - "2,3,4,5": -0.005980505962426697, - "2,3,4,6": 9.114783371226565e-06, - "2,3,4,7": -0.00034109842840641946, - "2,3,5,6": 0.005132903641059323, - "2,3,5,7": -0.017817530965671288, - "2,3,6,7": 0.007727526762421291, - "2,4,5,6": -0.006441737150390932, - "2,4,5,7": -0.016616382225610262, - "2,4,6,7": 0.002590060266753992, - "2,5,6,7": 0.05219368327253644, - "3,4,5,6": 0.0015298052343599572, - "3,4,5,7": -0.001614590191923726, - "3,4,6,7": 0.0002497596291023141, - "3,5,6,7": 0.014728874506597578, - "4,5,6,7": -0.004211405749048033, - "0,1,2,3,4": 0.0025852778073859554, - "0,1,2,3,5": 0.002396914023294887, - "0,1,2,3,6": 0.008406198621917174, - "0,1,2,3,7": -0.00510270403654213, - "0,1,2,4,5": 0.0063652560612969325, - "0,1,2,4,6": -0.0001778823066577867, - "0,1,2,4,7": 0.0035610221247845547, - "0,1,2,5,6": 0.015687549563144602, - "0,1,2,5,7": -0.012198890364445769, - "0,1,2,6,7": 0.042846708217408755, - "0,1,3,4,5": -0.008522622769389115, - "0,1,3,4,6": 0.0008044019035420014, - "0,1,3,4,7": -0.0009578188026032356, - "0,1,3,5,6": -0.005796217054678254, - "0,1,3,5,7": -0.006861935602903914, - "0,1,3,6,7": -0.05891680105566019, - "0,1,4,5,6": -0.017364753263260257, - "0,1,4,5,7": -0.004143087426661592, - "0,1,4,6,7": 0.002049922465654934, - "0,1,5,6,7": -0.28720893133498876, - "0,2,3,4,5": 0.00533911733148712, - "0,2,3,4,6": -0.00010973999024494613, - "0,2,3,4,7": 0.0005346218853507969, - "0,2,3,5,6": -0.00411608764387468, - "0,2,3,5,7": 0.01749239473996851, - "0,2,3,6,7": -0.006349347887623508, - "0,2,4,5,6": 0.0058871576088063565, - "0,2,4,5,7": 0.010088720705020919, - "0,2,4,6,7": 0.00789716034506321, - "0,2,5,6,7": -0.07835138000480142, - "0,3,4,5,6": 0.0066455970773232065, - "0,3,4,5,7": -0.0009345570377869289, - "0,3,4,6,7": 0.0012289914167130378, - "0,3,5,6,7": 0.047485395992989565, - "0,4,5,6,7": -0.03011302478113495, - "1,2,3,4,5": -0.003715789304750819, - "1,2,3,4,6": 0.0005656406257208077, - "1,2,3,4,7": 8.346296000018294e-05, - "1,2,3,5,6": 3.944210495702982e-05, - "1,2,3,5,7": 0.0029851009394872285, - "1,2,3,6,7": 0.006620802205373158, - "1,2,4,5,6": -0.003020733670510971, - "1,2,4,5,7": -0.0015576751303362502, - "1,2,4,6,7": -0.0024720531103742116, - "1,2,5,6,7": 0.0017634190342427566, - "1,3,4,5,6": 5.4239120287249976e-05, - "1,3,4,5,7": 0.00018454037502665943, - "1,3,4,6,7": 9.399909062495632e-05, - "1,3,5,6,7": 0.026372954055499345, - "1,4,5,6,7": -0.0009262116051634156, - "2,3,4,5,6": -0.001484966683200653, - "2,3,4,5,7": 0.0008183535485246779, - "2,3,4,6,7": 0.0003411193772203235, - "2,3,5,6,7": 0.0008435389753687073, - "2,4,5,6,7": -0.0049648532285360945, - "3,4,5,6,7": 0.0012202691371372143, - "0,1,2,3,4,5": 0.004503145078997526, - "0,1,2,3,4,6": -0.0005193769082191269, - "0,1,2,3,4,7": -0.0004287020329183655, - "0,1,2,3,5,6": -0.005977030398137672, - "0,1,2,3,5,7": -0.009310524586883487, - "0,1,2,3,6,7": -0.0029468245565354503, - "0,1,2,4,5,6": 0.0010017772458252514, - "0,1,2,4,5,7": 0.002966238504778465, - "0,1,2,4,6,7": -0.0018964375681363235, - "0,1,2,5,6,7": -0.025531222098426648, - "0,1,3,4,5,6": 0.002317173556642821, - "0,1,3,4,5,7": -0.003176212384880285, - "0,1,3,4,6,7": 0.0006734485297009429, - "0,1,3,5,6,7": 0.06867487393542457, - "0,1,4,5,6,7": -0.0062173238369768735, - "0,2,3,4,5,6": 0.0016726824679879834, - "0,2,3,4,5,7": 2.2919105338511936e-05, - "0,2,3,4,6,7": -0.0002555375852036912, - "0,2,3,5,6,7": -0.0021561945467074434, - "0,2,4,5,6,7": -0.0038986754216665323, - "0,3,4,5,6,7": 0.003315148100117578, - "1,2,3,4,5,6": -0.00010841032562271605, - "1,2,3,4,5,7": -0.000567258941551416, - "1,2,3,4,6,7": 5.678313585989053e-05, - "1,2,3,5,6,7": -0.0020494432780252606, - "1,2,4,5,6,7": 0.0021097250110143836, - "1,3,4,5,6,7": 1.3401034655753652e-07, - "2,3,4,5,6,7": -0.00022692076817935544 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=FBII_order=7.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=FBII_order=7.json deleted file mode 100644 index 219fa2561..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=FBII_order=7.json +++ /dev/null @@ -1,274 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.180974+00:00Z", - "metadata": { - "n_players": 8, - "index": "FBII", - "max_order": 7, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.764639088268838e-07 - }, - "data": { - "0": -0.16261474065002013, - "1": 0.2525732500395952, - "2": 0.03403957461399362, - "3": 0.04454636896821563, - "4": 0.004274046252798393, - "5": 0.8663072770170648, - "6": -0.07646804964265182, - "7": 0.4381393460267523, - "0,1": 0.1230586162506401, - "0,2": 0.06880087250943837, - "0,3": -0.03186428741972319, - "0,4": 0.006350063640071124, - "0,5": 0.4325640126877396, - "0,6": -0.0013424860489965884, - "0,7": 0.06253362843015275, - "1,2": -0.05260732497528489, - "1,3": 0.030377097633109612, - "1,4": 0.0001638755383530366, - "1,5": 0.050598956507932405, - "1,6": -0.0037650917819534585, - "1,7": 0.02995735037411615, - "2,3": 0.002143867653334762, - "2,4": 0.001021705862152722, - "2,5": 0.06281596987381986, - "2,6": -0.045183625267189165, - "2,7": 0.014458913807578508, - "3,4": 0.00028025953140953935, - "3,5": 0.03399114928047519, - "3,6": -0.003150773849607262, - "3,7": 0.013279024924966715, - "4,5": 0.041285098674825826, - "4,6": 0.00044916307425085615, - "4,7": -0.0013074729902502469, - "5,6": 0.10611367063474207, - "5,7": -0.02767477343872264, - "6,7": 0.2660580095993308, - "0,1,2": -0.07581969440272572, - "0,1,3": -0.010427558605008734, - "0,1,4": 0.009686814638164613, - "0,1,5": 0.08613654256299524, - "0,1,6": 0.008181944007317178, - "0,1,7": 0.1325348137514467, - "0,2,3": -0.0069929399160834835, - "0,2,4": -0.003970842456560736, - "0,2,5": -0.09424151103071529, - "0,2,6": 0.05578915852246668, - "0,2,7": -0.008310534659413032, - "0,3,4": -0.0025614768424400674, - "0,3,5": 0.06945880452475794, - "0,3,6": -0.0031480835140552874, - "0,3,7": -0.026326101661871677, - "0,4,5": 0.03678331073486591, - "0,4,6": -0.002691209271245828, - "0,4,7": 0.01834268295526509, - "0,5,6": 0.12349613450253602, - "0,5,7": -0.1753256037234338, - "0,6,7": 0.18139889017764996, - "1,2,3": -0.0287801918474046, - "1,2,4": 0.0022309792154976277, - "1,2,5": 0.038923963055049235, - "1,2,6": -0.009495114567733498, - "1,2,7": -0.004581095458502252, - "1,3,4": 0.0011998792813087758, - "1,3,5": -0.0238758675886598, - "1,3,6": 0.0013986216816225944, - "1,3,7": -0.021072035632676345, - "1,4,5": -0.03119701498324566, - "1,4,6": 0.00666620146531724, - "1,4,7": 0.001039801998536899, - "1,5,6": 0.06733553910404717, - "1,5,7": -0.030113981716608458, - "1,6,7": 0.10948326743347422, - "2,3,4": 0.000483497539511199, - "2,3,5": -0.005012040386094138, - "2,3,6": -4.273662946679274e-05, - "2,3,7": -0.0005792590016781146, - "2,4,5": -0.018664792875041872, - "2,4,6": -4.598413304506693e-05, - "2,4,7": 0.004376092325124991, - "2,5,6": 0.028583016949094233, - "2,5,7": 0.12048737579830199, - "2,6,7": 0.026544387113803625, - "3,4,5": -0.005913389382335599, - "3,4,6": 0.00018237439308682601, - "3,4,7": 7.513633213674514e-05, - "3,5,6": 0.0015834644426026348, - "3,5,7": -0.03098061737334481, - "3,6,7": -0.01701113270785997, - "4,5,6": -0.0019561600176380978, - "4,5,7": -0.005559640127825921, - "4,6,7": 0.0089622176336275, - "5,6,7": -0.09793329288718035, - "0,1,2,3": 0.021837399251880045, - "0,1,2,4": 0.0006111290994255877, - "0,1,2,5": 0.07706859738952002, - "0,1,2,6": -0.010952229101039712, - "0,1,2,7": 0.004563739505898293, - "0,1,3,4": -0.002361010606567626, - "0,1,3,5": 0.06572905112567587, - "0,1,3,6": -0.0062858846903033685, - "0,1,3,7": -0.012261845800926326, - "0,1,4,5": -0.007271194455066125, - "0,1,4,6": 0.006779987277841799, - "0,1,4,7": 0.013174572095061662, - "0,1,5,6": 0.12343033977889825, - "0,1,5,7": -0.024075869158723402, - "0,1,6,7": 0.3410628388813733, - "0,2,3,4": -0.0005393991280309707, - "0,2,3,5": 0.009998022864359388, - "0,2,3,6": 0.00020288509420474457, - "0,2,3,7": 0.0002666291040347643, - "0,2,4,5": 0.012499421204275017, - "0,2,4,6": 0.001689652277373166, - "0,2,4,7": -0.0021248334720999212, - "0,2,5,6": -0.028002499420049287, - "0,2,5,7": -0.11022787603223037, - "0,2,6,7": -0.004533249665736733, - "0,3,4,5": -0.010441254240907683, - "0,3,4,6": 0.001557767731851463, - "0,3,4,7": -0.0010534401345751593, - "0,3,5,6": -0.01686532226157389, - "0,3,5,7": 0.013695285838329277, - "0,3,6,7": -0.023898677697265936, - "0,4,5,6": -0.02026129984976148, - "0,4,5,7": -0.004006886126662345, - "0,4,6,7": 0.01935319557870887, - "0,5,6,7": -0.24323059911407657, - "1,2,3,4": -0.002641581693194922, - "1,2,3,5": 0.007102215898559288, - "1,2,3,6": -0.003100716535263552, - "1,2,3,7": 0.012574724330845832, - "1,2,4,5": -0.0012332615016049236, - "1,2,4,6": 0.0007749918742352094, - "1,2,4,7": -0.0010000672227411236, - "1,2,5,6": 0.0015560172861483236, - "1,2,5,7": 0.01643053727993541, - "1,2,6,7": -0.011648751139268266, - "1,3,4,5": -0.004147957395359794, - "1,3,4,6": -0.001113559987702649, - "1,3,4,7": 0.0008958607591526349, - "1,3,5,6": -0.00012130424872582035, - "1,3,5,7": 0.022414160530755792, - "1,3,6,7": -0.015724877487364064, - "1,4,5,6": -0.001332136490247278, - "1,4,5,7": -0.002668750396779107, - "1,4,6,7": 0.002250352202867397, - "1,5,6,7": -0.06452689069134285, - "2,3,4,5": -0.005978260433228369, - "2,3,4,6": -5.4920509894654246e-05, - "2,3,4,7": -0.000307779595130446, - "2,3,5,6": 0.006107886323241135, - "2,3,5,7": -0.01674519415692117, - "2,3,6,7": 0.008733582748704082, - "2,4,5,6": -0.007037177615596385, - "2,4,5,7": -0.017114468564246317, - "2,4,6,7": 0.002025693105646459, - "2,5,6,7": 0.05266833408689401, - "3,4,5,6": 0.0014732105216418573, - "3,4,5,7": -0.0015738307780752414, - "3,4,6,7": 0.00022423822047885553, - "3,5,6,7": 0.01574237107344475, - "4,5,6,7": -0.0047683323295987234, - "0,1,2,3,4": 0.002429688066862036, - "0,1,2,3,5": 0.00016328833182138042, - "0,1,2,3,6": 0.006305134575399711, - "0,1,2,3,7": -0.00739847633617571, - "0,1,2,4,5": 0.0072724766645969885, - "0,1,2,4,6": 0.0008618999416163259, - "0,1,2,4,7": 0.0044060961199523085, - "0,1,2,5,6": 0.014649295860453854, - "0,1,2,5,7": -0.013431852320248561, - "0,1,2,6,7": 0.0417463079065446, - "0,1,3,4,5": -0.0086930936710293, - "0,1,3,4,6": 0.000766492646846975, - "0,1,3,4,7": -0.0011904363124271115, - "0,1,3,5,6": -0.007912162262348109, - "0,1,3,5,7": -0.009172589063660076, - "0,1,3,6,7": -0.06109489287145442, - "0,1,4,5,6": -0.016339852176134977, - "0,1,4,5,7": -0.0033128945926418664, - "0,1,4,6,7": 0.0030126769446312505, - "0,1,5,6,7": -0.2883242128069604, - "0,2,3,4,5": 0.0053257794276436645, - "0,2,3,4,6": 9.483750837405505e-06, - "0,2,3,4,7": 0.0004591373733437848, - "0,2,3,5,6": -0.006074899853713473, - "0,2,3,5,7": 0.015338874277013182, - "0,2,3,6,7": -0.008370306705628817, - "0,2,4,5,6": 0.007069191693737792, - "0,2,4,5,7": 0.011076046536863143, - "0,2,4,6,7": 0.009017047821841984, - "0,2,5,6,7": -0.07930952847896353, - "0,3,4,5,6": 0.006749939657290566, - "0,3,4,5,7": -0.0010249227109339065, - "0,3,4,6,7": 0.0012711873885238173, - "0,3,5,6,7": 0.04544955601386366, - "0,4,5,6,7": -0.029008018465490303, - "1,2,3,4,5": -0.003834140631901576, - "1,2,3,4,6": 0.0005798509435180899, - "1,2,3,4,7": -9.703497528499444e-05, - "1,2,3,5,6": -0.002024383528186957, - "1,2,3,5,7": 0.0007265670532488992, - "1,2,3,6,7": 0.004494829964087045, - "1,2,4,5,6": -0.0019437130088613697, - "1,2,4,5,7": -0.0006753627218076957, - "1,2,4,6,7": -0.0014571790569032211, - "1,2,5,6,7": 0.0007002571367758174, - "1,3,4,5,6": 5.356827696471195e-05, - "1,3,4,5,7": -1.0838721395164952e-05, - "1,3,4,6,7": 3.11816391385146e-05, - "1,3,5,6,7": 0.024232100653059162, - "1,4,5,6,7": 7.378128719159882e-05, - "2,3,4,5,6": -0.001328504528694631, - "2,3,4,5,7": 0.0007801074499045393, - "2,3,4,6,7": 0.00043543492356146185, - "2,3,5,6,7": -0.0011401814292728504, - "2,4,5,6,7": -0.003807727338391159, - "3,4,5,6,7": 0.0012997035223298592, - "0,1,2,3,4,5": 0.004757541424216624, - "0,1,2,3,4,6": -0.0005301038528926771, - "0,1,2,3,4,7": -5.001247136439402e-05, - "0,1,2,3,5,6": -0.0018316854408944178, - "0,1,2,3,5,7": -0.004775763123441468, - "0,1,2,3,6,7": 0.00132281361698805, - "0,1,2,4,5,6": -0.0011345703865179857, - "0,1,2,4,5,7": 0.0012193073786508496, - "0,1,2,4,6,7": -0.003908491984151566, - "0,1,2,5,6,7": -0.02338720461255328, - "0,1,3,4,5,6": 0.002336208934231941, - "0,1,3,4,5,7": -0.0027677605010744503, - "0,1,3,4,6,7": 0.0008167771236092282, - "0,1,3,5,6,7": 0.07297427443120746, - "0,1,4,5,6,7": -0.008199615930743143, - "0,2,3,4,5,6": 0.0013774518499736765, - "0,2,3,4,5,7": 0.00011710499353616288, - "0,2,3,4,6,7": -0.0004264749869094947, - "0,2,3,5,6,7": 0.0018289399534767992, - "0,2,4,5,6,7": -0.006195233511018125, - "0,3,4,5,6,7": 0.003173973020680884, - "1,2,3,4,5,6": -0.0001936140970919542, - "1,2,3,4,5,7": -0.0002630462068113626, - "1,2,3,4,6,7": 9.587258068666227e-05, - "1,2,3,5,6,7": 0.0021457180687745603, - "1,2,4,5,6,7": 2.3193768210139076e-05, - "1,3,4,5,6,7": 6.898577746485002e-05, - "2,3,4,5,6,7": -0.0004723349966778423, - "0,1,2,3,4,5,6": 0.0001350201609841284, - "0,1,2,3,4,5,7": -0.000643812851443798, - "0,1,2,3,4,6,7": -0.00011356627163969235, - "0,1,2,3,5,6,7": -0.00842571007543455, - "0,1,2,4,5,6,7": 0.004137675103705496, - "0,1,3,4,5,6,7": -0.00017309091615874683, - "0,2,3,4,5,6,7": 0.0004554410750578636, - "1,2,3,4,5,6,7": 3.538738191846691e-05 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=FBII_order=8.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=FBII_order=8.json deleted file mode 100644 index 2d9137596..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=FBII_order=8.json +++ /dev/null @@ -1,275 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.249242+00:00Z", - "metadata": { - "n_players": 8, - "index": "FBII", - "max_order": 8, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": -4.92873597576905e-15 - }, - "data": { - "0": -0.16261418772220193, - "1": 0.2525738029674308, - "2": 0.03404012754183246, - "3": 0.0445469218960536, - "4": 0.004274599180640885, - "5": 0.8663078299448912, - "6": -0.07646749671482152, - "7": 0.4381398989545861, - "0,1": 0.12305751039497938, - "0,2": 0.06879976665377716, - "0,3": -0.03186539327539284, - "0,4": 0.006348957784402069, - "0,5": 0.4325629068320903, - "0,6": -0.0013435919046544537, - "0,7": 0.06253252257449646, - "1,2": -0.05260843083097427, - "1,3": 0.030375991777420605, - "1,4": 0.00016276968266966396, - "1,5": 0.05059785065225786, - "1,6": -0.003766197637630142, - "1,7": 0.029956244518436655, - "2,3": 0.0021427617976510632, - "2,4": 0.0010206000064590937, - "2,5": 0.06281486401814397, - "2,6": -0.04518473112286925, - "2,7": 0.014457807951895815, - "3,4": 0.0002791536757172919, - "3,5": 0.0339900434248001, - "3,6": -0.0031518797052915992, - "3,7": 0.013277919069284952, - "4,5": 0.04128399281915174, - "4,6": 0.0004480572185666422, - "4,7": -0.001308578845935146, - "5,6": 0.10611256477907394, - "5,7": -0.027675879294392802, - "6,7": 0.2660569037436573, - "0,1,2": -0.07581748269137134, - "0,1,3": -0.01042534689364738, - "0,1,4": 0.00968902634951363, - "0,1,5": 0.08613875427433242, - "0,1,6": 0.0081841557186602, - "0,1,7": 0.13253702546279353, - "0,2,3": -0.006990728204724378, - "0,2,4": -0.003968630745201537, - "0,2,5": -0.09423929931938063, - "0,2,6": 0.05579137023381382, - "0,2,7": -0.008308322948070063, - "0,3,4": -0.002559265131077272, - "0,3,5": 0.06946101623610035, - "0,3,6": -0.0031458718027059032, - "0,3,7": -0.02632388995051841, - "0,4,5": 0.03678552244620683, - "0,4,6": -0.0026889975598917565, - "0,4,7": 0.01834489466662037, - "0,5,6": 0.12349834621386821, - "0,5,7": -0.1753233920121008, - "0,6,7": 0.18140110188899053, - "1,2,3": -0.02877798013602577, - "1,2,4": 0.0022331909268883815, - "1,2,5": 0.038926174766413295, - "1,2,6": -0.009492902856358183, - "1,2,7": -0.0045788837471285385, - "1,3,4": 0.0012020909926913348, - "1,3,5": -0.023873655877286702, - "1,3,6": 0.0014008333929997063, - "1,3,7": -0.02106982392129715, - "1,4,5": -0.03119480327188176, - "1,4,6": 0.006668413176691403, - "1,4,7": 0.0010420137099057883, - "1,5,6": 0.06733775081540606, - "1,5,7": -0.03011177000525138, - "1,6,7": 0.1094854791448352, - "2,3,4": 0.0004857092508978901, - "2,3,5": -0.0050098286747284615, - "2,3,6": -4.0524918090811823e-05, - "2,3,7": -0.0005770472903037921, - "2,4,5": -0.01866258116366908, - "2,4,6": -4.3772421668898664e-05, - "2,4,7": 0.004378304036502995, - "2,5,6": 0.028585228660455188, - "2,5,7": 0.12048958750966575, - "2,6,7": 0.02654659882517174, - "3,4,5": -0.005911177670964156, - "3,4,6": 0.00018458610447413815, - "3,4,7": 7.734804351803432e-05, - "3,5,6": 0.0015856761539667016, - "3,5,7": -0.030978405661983135, - "3,6,7": -0.01700892099648737, - "4,5,6": -0.0019539483062782567, - "4,5,7": -0.005557428416464366, - "4,6,7": 0.008964429344995375, - "5,6,7": -0.09793108117582416, - "0,1,2,3": 0.021832975829140826, - "0,1,2,4": 0.0006067056766892384, - "0,1,2,5": 0.07706417396681192, - "0,1,2,6": -0.010956652523767346, - "0,1,2,7": 0.0045593160831722025, - "0,1,3,4": -0.002365434029301512, - "0,1,3,5": 0.06572462770295609, - "0,1,3,6": -0.006290308113027139, - "0,1,3,7": -0.012266269223666373, - "0,1,4,5": -0.007275617877773633, - "0,1,4,6": 0.006775563855120254, - "0,1,4,7": 0.013170148672335777, - "0,1,5,6": 0.1234259163561963, - "0,1,5,7": -0.024080292581428922, - "0,1,6,7": 0.34105841545866, - "0,2,3,4": -0.0005438225507756189, - "0,2,3,5": 0.009993599441641854, - "0,2,3,6": 0.0001984616714710702, - "0,2,3,7": 0.0002622056813034457, - "0,2,4,5": 0.012494997781557049, - "0,2,4,6": 0.0016852288546447824, - "0,2,4,7": -0.0021292568948249324, - "0,2,5,6": -0.028006922842748888, - "0,2,5,7": -0.11023229945493808, - "0,2,6,7": -0.00453767308845357, - "0,3,4,5": -0.01044567766362918, - "0,3,4,6": 0.001553344309114739, - "0,3,4,7": -0.0010578635573140205, - "0,3,5,6": -0.016869745684279673, - "0,3,5,7": 0.013690862415617198, - "0,3,6,7": -0.023903101119985157, - "0,4,5,6": -0.02026572327247161, - "0,4,5,7": -0.004011309549375439, - "0,4,6,7": 0.01934877215598778, - "0,5,6,7": -0.24323502253677767, - "1,2,3,4": -0.002646005115969692, - "1,2,3,5": 0.007097792475813708, - "1,2,3,6": -0.0031051399580163605, - "1,2,3,7": 0.012570300908094703, - "1,2,4,5": -0.0012376849243561465, - "1,2,4,6": 0.0007705684514702112, - "1,2,4,7": -0.0010044906454983703, - "1,2,5,6": 0.0015515938634185246, - "1,2,5,7": 0.016426113857202017, - "1,2,6,7": -0.01165317456201516, - "1,3,4,5": -0.004152380818109279, - "1,3,4,6": -0.0011179834104652897, - "1,3,4,7": 0.0008914373363934983, - "1,3,5,6": -0.0001257276714677416, - "1,3,5,7": 0.02240973710801194, - "1,3,6,7": -0.015729300910112362, - "1,4,5,6": -0.0013365599129849942, - "1,4,5,7": -0.0026731738195149637, - "1,4,6,7": 0.002245928780123061, - "1,5,6,7": -0.06453131411406596, - "2,3,4,5": -0.005982683855982454, - "2,3,4,6": -5.9343932658016685e-05, - "2,3,4,7": -0.00031220301789591787, - "2,3,5,6": 0.00610346290049648, - "2,3,5,7": -0.016749617579662514, - "2,3,6,7": 0.008729159325952175, - "2,4,5,6": -0.007041601038337474, - "2,4,5,7": -0.01711889198699202, - "2,4,6,7": 0.0020212696828995, - "2,5,6,7": 0.05266391066415642, - "3,4,5,6": 0.0014687870988941351, - "3,4,5,7": -0.0015782542008219852, - "3,4,6,7": 0.0002198147977142302, - "3,5,6,7": 0.01573794765070432, - "4,5,6,7": -0.004772755752330153, - "0,1,2,3,4": 0.0024385349123583824, - "0,1,2,3,5": 0.0001721351772873067, - "0,1,2,3,6": 0.006313981420884613, - "0,1,2,3,7": -0.007389629490685477, - "0,1,2,4,5": 0.007281323510056361, - "0,1,2,4,6": 0.0008707467870956512, - "0,1,2,4,7": 0.004414942965432607, - "0,1,2,5,6": 0.01465814270589718, - "0,1,2,5,7": -0.013423005474796105, - "0,1,2,6,7": 0.0417551547520128, - "0,1,3,4,5": -0.008684246825568124, - "0,1,3,4,6": 0.0007753394923275952, - "0,1,3,4,7": -0.0011815894669369928, - "0,1,3,5,6": -0.00790331541689176, - "0,1,3,5,7": -0.009163742218198188, - "0,1,3,6,7": -0.06108604602598633, - "0,1,4,5,6": -0.016331005330684722, - "0,1,4,5,7": -0.0033040477471894224, - "0,1,4,6,7": 0.0030215237900984605, - "0,1,5,6,7": -0.2883153659615262, - "0,2,3,4,5": 0.005334626273123215, - "0,2,3,4,6": 1.8330596332084836e-05, - "0,2,3,4,7": 0.0004679842188335358, - "0,2,3,5,6": -0.0060660530082540486, - "0,2,3,5,7": 0.015347721122476028, - "0,2,3,6,7": -0.008361459860149776, - "0,2,4,5,6": 0.007078038539186513, - "0,2,4,5,7": 0.011084893382324, - "0,2,4,6,7": 0.00902589466730741, - "0,2,5,6,7": -0.07930068163351875, - "0,3,4,5,6": 0.006758786502751114, - "0,3,4,5,7": -0.0010160758654699335, - "0,3,4,6,7": 0.0012800342340091204, - "0,3,5,6,7": 0.04545840285930879, - "0,4,5,6,7": -0.028999171620042157, - "1,2,3,4,5": -0.0038252937863915894, - "1,2,3,4,6": 0.0005886977890419802, - "1,2,3,4,7": -8.818812976483029e-05, - "1,2,3,5,6": -0.0020155366826966163, - "1,2,3,5,7": 0.0007354138987388618, - "1,2,3,6,7": 0.004503676809583135, - "1,2,4,5,6": -0.0019348661633752512, - "1,2,4,5,7": -0.0006665158763092607, - "1,2,4,6,7": -0.0014483322113938886, - "1,2,5,6,7": 0.0007091039822461308, - "1,3,4,5,6": 6.241512245587152e-05, - "1,3,4,5,7": -1.9918758959562577e-06, - "1,3,4,6,7": 4.002848465163231e-05, - "1,3,5,6,7": 0.024240947498540936, - "1,4,5,6,7": 8.262813267439009e-05, - "2,3,4,5,6": -0.0013196576831933943, - "2,3,4,5,7": 0.0007889542954126402, - "2,3,4,6,7": 0.00044428176907518324, - "2,3,5,6,7": -0.0011313345837761016, - "2,4,5,6,7": -0.003798880492902182, - "3,4,5,6,7": 0.0013085503678294044, - "0,1,2,3,4,5": 0.0047398477332552535, - "0,1,2,3,4,6": -0.0005477975438913027, - "0,1,2,3,4,7": -6.77061623514108e-05, - "0,1,2,3,5,6": -0.0018493791318538871, - "0,1,2,3,5,7": -0.004793456814391764, - "0,1,2,3,6,7": 0.0013051199260203927, - "0,1,2,4,5,6": -0.0011522640774450088, - "0,1,2,4,5,7": 0.001201613687697639, - "0,1,2,4,6,7": -0.003926185675114741, - "0,1,2,5,6,7": -0.02340489830346891, - "0,1,3,4,5,6": 0.002318515243286544, - "0,1,3,4,5,7": -0.0027854541920268767, - "0,1,3,4,6,7": 0.0007990834326364674, - "0,1,3,5,6,7": 0.07295658074028341, - "0,1,4,5,6,7": -0.008217309621674447, - "0,2,3,4,5,6": 0.0013597581590163166, - "0,2,3,4,5,7": 9.941130256622965e-05, - "0,2,3,4,6,7": -0.0004441686778889897, - "0,2,3,5,6,7": 0.0018112462625261838, - "0,2,4,5,6,7": -0.0062129272019565696, - "0,3,4,5,6,7": 0.0031562793297421066, - "1,2,3,4,5,6": -0.0002113077880883229, - "1,2,3,4,5,7": -0.0002807398978224851, - "1,2,3,4,6,7": 7.817888967049519e-05, - "1,2,3,5,6,7": 0.0021280243777962934, - "1,2,4,5,6,7": 5.5000772323128555e-06, - "1,3,4,5,6,7": 5.129208647775083e-05, - "2,3,4,5,6,7": -0.0004900286876795279, - "0,1,2,3,4,5,6": 0.00017040754292583712, - "0,1,2,3,4,5,7": -0.000608425469496951, - "0,1,2,3,4,6,7": -7.817888967626661e-05, - "0,1,2,3,5,6,7": -0.008390322693524566, - "0,1,2,4,5,6,7": 0.0041730624855982335, - "0,1,3,4,5,6,7": -0.0001377035342614366, - "0,2,3,4,5,6,7": 0.000490828456992165, - "1,2,3,4,5,6,7": 7.077476389444337e-05, - "0,1,2,3,4,5,6,7": -7.077476386085912e-05 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=FSII_order=1.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=FSII_order=1.json deleted file mode 100644 index c6a512f65..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=FSII_order=1.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.184768+00:00Z", - "metadata": { - "n_players": 8, - "index": "SV", - "max_order": 1, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 0.0 - }, - "data": { - "0": 0.251717824634946, - "1": 0.4972478738863751, - "2": 0.0650052094688851, - "3": 0.05833923468381253, - "4": 0.02219440249113931, - "5": 1.130942443386558, - "6": 0.21431031165843126, - "7": 0.6057811263938011 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=FSII_order=2.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=FSII_order=2.json deleted file mode 100644 index b1a83abba..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=FSII_order=2.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.190223+00:00Z", - "metadata": { - "n_players": 8, - "index": "FSII", - "max_order": 2, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 0.0 - }, - "data": { - "0": -0.18635056940157288, - "1": 0.16158102955788278, - "2": 0.033831870404516344, - "3": 0.03680590063519439, - "4": 0.011705454707426368, - "5": 0.951091125681943, - "6": -0.12114307360349073, - "7": 0.47766285859490487, - "0,1": 0.3131869026840825, - "0,2": -0.008950150741568715, - "0,3": -0.005071743248097304, - "0,4": 0.035520208388463786, - "0,5": 0.34238541712477716, - "0,6": 0.15531251594219056, - "0,7": 0.04375363792382946, - "1,2": -0.05139989267324124, - "1,3": 0.011710212400399806, - "1,4": -0.009163303610655727, - "1,5": 0.11047324724403389, - "1,6": 0.14534464098961633, - "1,7": 0.1511818816225352, - "2,3": -0.006198968573509559, - "2,4": -0.005955815229373004, - "2,5": 0.08260025886539327, - "2,6": -0.0007799365947315375, - "2,7": 0.05303118307585898, - "3,4": -0.008886826283793671, - "3,5": 0.08460638305779461, - "3,6": -0.009913955046083736, - "3,7": -0.023178434209671306, - "4,5": -0.0006392090005235004, - "4,6": 0.0005441429839980672, - "4,7": 0.009558698319364475, - "5,6": 0.049393165750388615, - "5,7": -0.30911662763287207, - "6,7": 0.33100619649853336 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=FSII_order=3.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=FSII_order=3.json deleted file mode 100644 index a396daac4..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=FSII_order=3.json +++ /dev/null @@ -1,112 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.193443+00:00Z", - "metadata": { - "n_players": 8, - "index": "FSII", - "max_order": 3, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 0.0 - }, - "data": { - "0": -0.18059901620576232, - "1": 0.25646112242678765, - "2": 0.031195888196524774, - "3": 0.05500267675715691, - "4": 0.0010213513840378885, - "5": 0.8330251186265739, - "6": -0.09564098067654836, - "7": 0.4098688250463112, - "0,1": 0.07455246465832967, - "0,2": 0.07931405817632256, - "0,3": -0.048799831748919886, - "0,4": 0.006086531220303521, - "0,5": 0.5372414015812879, - "0,6": 0.045394905478650854, - "0,7": 0.14783793936922252, - "1,2": -0.08060915551743691, - "1,3": 0.013778244773941739, - "1,4": 0.005162840038225647, - "1,5": 0.07144354105254609, - "1,6": -0.019472355468359, - "1,7": 0.03719755176301154, - "2,3": -0.005931905769533841, - "2,4": -0.00281962236990959, - "2,5": 0.08149275547716234, - "2,6": -0.034969116755418694, - "2,7": 0.04168555800399634, - "3,4": 0.002910472554406074, - "3,5": -0.011925433764992, - "3,6": -0.013557760866109058, - "3,7": -0.002587773939211807, - "4,5": 0.06354491175082286, - "4,6": 0.0072837061137411285, - "4,7": 0.0029136760681008483, - "5,6": 0.2117812751856136, - "5,7": 0.11452022633630346, - "6,7": 0.3214335591467189, - "0,1,2": -0.018609946247427626, - "0,1,3": 0.01019229159486626, - "0,1,4": 0.011137184182638954, - "0,1,5": 0.11709752265343334, - "0,1,6": 0.15401584875986069, - "0,1,7": 0.20343597493191215, - "0,2,3": 0.010525849664534986, - "0,2,4": 0.015410829224952585, - "0,2,5": -0.1299294804951632, - "0,2,6": 0.024637952963985216, - "0,2,7": -0.07856362338178921, - "0,3,4": -0.005704566044438628, - "0,3,5": 0.12474202052521988, - "0,3,6": -0.018830766835746367, - "0,3,7": -0.033468651729532825, - "0,4,5": 0.015591871694277587, - "0,4,6": -0.004608881767903611, - "0,4,7": 0.027040917192938094, - "0,5,6": -0.0629898077129025, - "0,5,7": -0.45422409555914134, - "0,6,7": 0.12761087573340885, - "1,2,3": -0.011461709857942134, - "1,2,4": 0.003067181348109245, - "1,2,5": 0.08509127986851418, - "1,2,6": -0.008316027456761257, - "1,2,7": 0.008647748366817025, - "1,3,4": -0.005659152262813966, - "1,3,5": 0.03162079183219356, - "1,3,6": -0.008881450001957086, - "1,3,7": -0.019946836044524657, - "1,4,5": -0.04768117016215667, - "1,4,6": 0.004824148215957683, - "1,4,7": 0.005659521671363882, - "1,5,6": 0.024875105187531027, - "1,5,7": -0.13294411691547287, - "1,6,7": 0.16311636769237575, - "2,3,4": -0.002145262436705264, - "2,3,5": -0.003028061048126418, - "2,3,6": 0.0035193535532323864, - "2,3,7": 0.0020557042120659987, - "2,4,5": -0.022047216412546075, - "2,4,6": -0.00012669980799960567, - "2,4,7": -0.0004312177384886984, - "2,5,6": 0.014904814059256616, - "2,5,7": 0.05722367114781962, - "2,6,7": 0.03375896735671035, - "3,4,5": -0.015012561124349448, - "3,4,6": 0.005201137073850226, - "3,4,7": -0.0002741927552579321, - "3,5,6": 0.03528406269210926, - "3,5,7": 0.019457380912064087, - "3,6,7": -0.009004725063790804, - "4,5,6": -0.029641505953353492, - "4,5,7": -0.02957766017615862, - "4,6,7": 0.010872676225331057, - "5,6,7": -0.30720888722766393 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=FSII_order=4.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=FSII_order=4.json deleted file mode 100644 index 6568db31f..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=FSII_order=4.json +++ /dev/null @@ -1,182 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.179057+00:00Z", - "metadata": { - "n_players": 8, - "index": "FSII", - "max_order": 4, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 0.0 - }, - "data": { - "0": -0.1584555937196293, - "1": 0.25607642295903565, - "2": 0.03516954469520284, - "3": 0.04246741835021167, - "4": 0.004553499679208803, - "5": 0.8700315219587866, - "6": -0.07269825380314637, - "7": 0.4422246694888982, - "0,1": 0.10277093164692669, - "0,2": 0.06522476128460417, - "0,3": -0.025697302785853925, - "0,4": 0.00578271074752925, - "0,5": 0.411655206472284, - "0,6": -0.023042871114271696, - "0,7": 0.03921296371494987, - "1,2": -0.05264062776287568, - "1,3": 0.03348331800347268, - "1,4": -0.0015647095332802924, - "1,5": 0.03278520112347849, - "1,6": -0.019675069677529564, - "1,7": 0.011510481643184606, - "2,3": 0.0017745876825299434, - "2,4": 0.0035416212466887753, - "2,5": 0.05540689134855175, - "2,6": -0.05084708482937021, - "2,7": 0.008018544769452816, - "3,4": 0.001480111156806004, - "3,5": 0.0463095203280886, - "3,6": 0.00580387362201408, - "3,7": 0.021155004287169245, - "4,5": 0.03895326890941937, - "4,6": -0.0020974666392782337, - "4,7": -0.0033987996589145975, - "5,6": 0.08655972544060514, - "5,7": -0.04764797526492047, - "6,7": 0.2458803841923065, - "0,1,2": -0.08023982335638687, - "0,1,3": -0.007269105387013478, - "0,1,4": 0.013058809154364009, - "0,1,5": 0.14753536129246267, - "0,1,6": 0.06561887040872307, - "0,1,7": 0.1974724290358778, - "0,2,3": -0.007331980853337569, - "0,2,4": -0.013954879288514861, - "0,2,5": -0.078512472462567, - "0,2,6": 0.06745647488065187, - "0,2,7": 0.006500747800006007, - "0,3,4": -0.005892481693449345, - "0,3,5": 0.044331010792108085, - "0,3,6": -0.015795852703445773, - "0,3,7": -0.03609805824913795, - "0,4,5": 0.041686573622808254, - "0,4,6": 0.002933817283320747, - "0,4,7": 0.022554617348436584, - "0,5,6": 0.19023139371626843, - "0,5,7": -0.10705286066533712, - "0,6,7": 0.25157939993477973, - "1,2,3": -0.027298213515208464, - "1,2,4": -0.00014964567500278317, - "1,2,5": 0.0451822100565517, - "1,2,6": -0.0157602376614855, - "1,2,7": -0.0031584032454005304, - "1,3,4": 0.0024815225009799415, - "1,3,5": -0.03779490346572791, - "1,3,6": -0.007745336351550261, - "1,3,7": -0.025035394680903135, - "1,4,5": -0.02508230558300277, - "1,4,6": 0.011412069597642793, - "1,4,7": 0.0032650102619311283, - "1,5,6": 0.11738628953861355, - "1,5,7": 0.02412446000005932, - "1,6,7": 0.15973590876820892, - "2,3,4": -0.0015585075161585749, - "2,3,5": -0.005542720041411757, - "2,3,6": 0.0023880008001874228, - "2,3,7": 0.0002768285376468227, - "2,4,5": -0.02363690485890166, - "2,4,6": -0.00035823537690322926, - "2,4,7": 0.0015795688705059624, - "2,5,6": 0.05168441885427042, - "2,5,7": 0.14346979555043182, - "2,6,7": 0.04235777891741569, - "3,4,5": -0.007662673085696996, - "3,4,6": -0.0034919376625771846, - "3,4,7": -0.00031871313759021525, - "3,5,6": -0.02879870599131562, - "3,5,7": -0.06264314514585587, - "3,6,7": -0.03607672887235729, - "4,5,6": 0.007222183182044831, - "4,5,7": 0.002063099702297592, - "4,6,7": 0.015708840249855187, - "5,6,7": -0.036394049547191436, - "0,1,2,3": 0.020771512760076632, - "0,1,2,4": 0.008780203115784146, - "0,1,2,5": 0.07360882558671161, - "0,1,2,6": 0.01193195851872643, - "0,1,2,7": 0.008167254339875259, - "0,1,3,4": -0.004569991299015905, - "0,1,3,5": 0.07104059969517655, - "0,1,3,6": -0.017825433657395938, - "0,1,3,7": -0.03449389354066278, - "0,1,4,5": -0.01828451438283289, - "0,1,4,6": -0.0013551417200323747, - "0,1,4,7": 0.011586194300204446, - "0,1,5,6": -0.014932775555185511, - "0,1,5,7": -0.17230781254924527, - "0,1,6,7": 0.1989753492651508, - "0,2,3,4": 0.005001776738833855, - "0,2,3,5": 0.016370563434761648, - "0,2,3,6": -0.004703750850608562, - "0,2,3,7": -0.0017244408479583223, - "0,2,4,5": 0.028591088652649324, - "0,2,4,6": 0.007932585137447871, - "0,2,4,7": 0.008425763520226209, - "0,2,5,6": -0.06860250554708128, - "0,2,5,7": -0.1528019881208581, - "0,2,6,7": -0.0321953310766159, - "0,3,4,5": -0.0068017996628439575, - "0,3,4,6": 0.007881217200015767, - "0,3,4,7": -0.0011353718207510674, - "0,3,5,6": 0.023089137912962028, - "0,3,5,7": 0.05712351803716367, - "0,3,6,7": -0.014510998898524807, - "0,4,5,6": -0.037667125401925544, - "0,4,5,7": -0.018027052880394537, - "0,4,6,7": 0.008123066519432134, - "0,5,6,7": -0.40832913431365575, - "1,2,3,4": -0.0021401855807778314, - "1,2,3,5": 0.003089881228562047, - "1,2,3,6": 0.0004623319827284367, - "1,2,3,7": 0.009489466863258425, - "1,2,4,5": 0.001011616109014013, - "1,2,4,6": -0.0010744361566072946, - "1,2,4,7": -0.00014354360530692556, - "1,2,5,6": -0.00021137153174916046, - "1,2,5,7": 0.002319188024683328, - "1,2,6,7": 0.0037799375460109835, - "1,3,4,5": -0.009404116741211693, - "1,3,4,6": 0.00030306844262519006, - "1,3,4,7": -0.0004701245009000321, - "1,3,5,6": 0.026620582034230678, - "1,3,5,7": 0.04748444431157711, - "1,3,6,7": -0.011832775902095534, - "1,4,5,6": -0.011693271948380005, - "1,4,5,7": -0.006827442086067691, - "1,4,6,7": 0.0006439386465464103, - "1,5,6,7": -0.1848055315430666, - "2,3,4,5": -0.004031127911445179, - "2,3,4,6": -0.00016298703559795846, - "2,3,4,7": 0.00015901398073320944, - "2,3,5,6": 0.0003167005878934176, - "2,3,5,7": -0.01071669943916688, - "2,3,6,7": 0.006350410856040472, - "2,4,5,6": -0.008080741884930825, - "2,4,5,7": -0.014311457946514675, - "2,4,6,7": 0.001848650916661712, - "2,5,6,7": 0.0030187085986541785, - "3,4,5,6": 0.006683298040863862, - "3,4,5,7": -0.0011460297338107064, - "3,4,6,7": 0.002681552754623992, - "3,5,6,7": 0.07145581883326838, - "4,5,6,7": -0.022969536946197668 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=FSII_order=5.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=FSII_order=5.json deleted file mode 100644 index 6c05e3084..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=FSII_order=5.json +++ /dev/null @@ -1,238 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.183922+00:00Z", - "metadata": { - "n_players": 8, - "index": "FSII", - "max_order": 5, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 0.0 - }, - "data": { - "0": -0.16251870451015335, - "1": 0.2526726819745292, - "2": 0.03387200164946874, - "3": 0.04476859277181297, - "4": 0.004275651539821689, - "5": 0.8664211330060808, - "6": -0.07635209380913818, - "7": 0.4382209052230966, - "0,1": 0.1224450549537601, - "0,2": 0.06978461476563663, - "0,3": -0.03327422023555812, - "0,4": 0.006376467695409456, - "0,5": 0.431857767367079, - "0,6": -0.0020458979318547094, - "0,7": 0.06202482863683584, - "1,2": -0.051723341158352115, - "1,3": 0.029089392497595692, - "1,4": 0.00017199178269709792, - "1,5": 0.04987931800152334, - "1,6": -0.0045033850041742846, - "1,7": 0.029385314030646037, - "2,3": 0.0025140781285743763, - "2,4": 0.0009460779341085093, - "2,5": 0.06367692226283853, - "2,6": -0.04424303887469557, - "2,7": 0.015474242003491116, - "3,4": 0.00010418709682844148, - "3,5": 0.03256984299851136, - "3,6": -0.004699882934482202, - "3,7": 0.011982225302561891, - "4,5": 0.04122611053122913, - "4,6": 0.0005296668457729636, - "4,7": -0.0011008012664197146, - "5,6": 0.10530020145914792, - "5,7": -0.02828054689148577, - "6,7": 0.26532062757886266, - "0,1,2": -0.0788488057516683, - "0,1,3": -0.005663630434882341, - "0,1,4": 0.009521181297684471, - "0,1,5": 0.0887250558431874, - "0,1,6": 0.010781736179280091, - "0,1,7": 0.13459389482618617, - "0,2,3": -0.008015175843623011, - "0,2,4": -0.003826830446382906, - "0,2,5": -0.09716852570840585, - "0,2,6": 0.05252941270717518, - "0,2,7": -0.011790689491774406, - "0,3,4": -0.0018737810833849428, - "0,3,5": 0.07471182437053733, - "0,3,6": 0.0024982335039348824, - "0,3,7": -0.021521680829177214, - "0,4,5": 0.036874029748798075, - "0,4,6": -0.003142724443020231, - "0,4,7": 0.017490767666701705, - "0,5,6": 0.12638052986598441, - "0,5,7": -0.17312695597428113, - "0,6,7": 0.18400415577605672, - "1,2,3": -0.02995238200417985, - "1,2,4": 0.002716840717387918, - "1,2,5": 0.03632166713018996, - "1,2,6": -0.012354933059875756, - "1,2,7": -0.007562080247102608, - "1,3,4": 0.0014524734777919338, - "1,3,5": -0.01907507993916048, - "1,3,6": 0.006667914719305487, - "1,3,7": -0.016545396228087345, - "1,4,5": -0.031066724172263846, - "1,4,6": 0.006329466370659453, - "1,4,7": 0.00040190978872712245, - "1,5,6": 0.0703175836964791, - "1,5,7": -0.027718441642679413, - "1,6,7": 0.11236063325147796, - "2,3,4": 0.0008335954759515762, - "2,3,5": -0.005938922918082304, - "2,3,6": -0.0008451234203709634, - "2,3,7": -0.0018039975716597975, - "2,4,5": -0.018166362230738378, - "2,4,6": -0.0003585893182324329, - "2,4,7": 0.004082631852940426, - "2,5,6": 0.025764018027661706, - "2,5,7": 0.11740217413509359, - "2,6,7": 0.023597001544276172, - "3,4,5": -0.0052612313468983415, - "3,4,6": 0.0007495245538811091, - "3,4,7": 3.994391863404445e-05, - "3,5,6": 0.007280571801494329, - "3,5,7": -0.02617120005598235, - "3,6,7": -0.011337871269671368, - "4,5,6": -0.002097819729152399, - "4,5,7": -0.00614749373068384, - "4,6,7": 0.008302677006564618, - "5,6,7": -0.09497763723593752, - "0,1,2,3": 0.024276782998399166, - "0,1,2,4": -0.0003197961257337123, - "0,1,2,5": 0.08382074723292333, - "0,1,2,6": -0.0033693199176672434, - "0,1,2,7": 0.012359925278013252, - "0,1,3,4": -0.0031822305906638072, - "0,1,3,5": 0.05222730389931156, - "0,1,3,6": -0.02089294740898375, - "0,1,3,7": -0.024998332559069206, - "0,1,4,5": -0.007267120815430092, - "0,1,4,6": 0.008173495656172612, - "0,1,4,7": 0.015261332896228968, - "0,1,5,6": 0.11542175711961139, - "0,1,5,7": -0.03063027287846224, - "0,1,6,7": 0.33336759831860635, - "0,2,3,4": -0.001664736460842045, - "0,2,3,5": 0.011725954539905617, - "0,2,3,6": 0.0017428606816967396, - "0,2,3,7": 0.0028230422828604967, - "0,2,4,5": 0.011477681054378353, - "0,2,4,6": 0.002974706430083237, - "0,2,4,7": -0.0010006652291816992, - "0,2,5,6": -0.020585740342795318, - "0,2,5,7": -0.10221107634756824, - "0,2,6,7": 0.003260072635074135, - "0,3,4,5": -0.012385275278397416, - "0,3,4,6": -1.553403207418813e-05, - "0,3,4,7": -0.0011303283750339795, - "0,3,5,6": -0.032670521325378635, - "0,3,5,7": 0.00014742673562755104, - "0,3,6,7": -0.03960608900217055, - "0,4,5,6": -0.019445290430346998, - "0,4,5,7": -0.0021108600567499025, - "0,4,6,7": 0.0215844195631701, - "0,5,6,7": -0.25119190998603264, - "1,2,3,4": -0.0033475612082369127, - "1,2,3,5": 0.00929518741973482, - "1,2,3,6": -0.0012962564801417414, - "1,2,3,7": 0.015130974400054259, - "1,2,4,5": -0.003101439171572032, - "1,2,4,6": 0.001013053088164781, - "1,2,4,7": -0.0011875396579225025, - "1,2,5,6": 0.007971465537917527, - "1,2,5,7": 0.02318137831256801, - "1,2,6,7": -0.005321942687833506, - "1,3,4,5": -0.00486654630482513, - "1,3,4,6": -0.00166198476356718, - "1,3,4,7": 0.0015792017693644217, - "1,3,5,6": -0.014855944273419797, - "1,3,5,7": 0.009672212765432397, - "1,3,6,7": -0.03082693265312139, - "1,4,5,6": -0.0007570455515029662, - "1,4,5,7": -0.0012782907306144384, - "1,4,6,7": 0.00377545464539307, - "1,5,6,7": -0.0731486410115287, - "2,3,4,5": -0.007156951334121975, - "2,3,4,6": -0.00014608794171315498, - "2,3,4,7": -2.1319416951878084e-05, - "2,3,5,6": 0.007364299926065521, - "2,3,5,7": -0.014350226520895841, - "2,3,6,7": 0.009685802295962963, - "2,4,5,6": -0.00672652588432536, - "2,4,5,7": -0.016842586326360973, - "2,4,6,7": 0.0033495775577641884, - "2,5,6,7": 0.059379161830618685, - "3,4,5,6": -3.460980521504883e-05, - "3,4,5,7": -0.001463121194322084, - "3,4,6,7": -0.0005491247758321882, - "3,5,6,7": -7.65085111362196e-06, - "4,5,6,7": -0.0032705593011824394, - "0,1,2,3,4": 0.004348666399677181, - "0,1,2,3,5": -0.003198347739109878, - "0,1,2,3,6": 0.003493576756014652, - "0,1,2,3,7": -0.011654436161545781, - "0,1,2,4,5": 0.010683311001895117, - "0,1,2,4,6": -0.0007903753495951404, - "0,1,2,4,7": 0.003958396282331272, - "0,1,2,5,6": 0.0003399253020898718, - "0,1,2,5,7": -0.028248731936695456, - "0,1,2,6,7": 0.02755942969065285, - "0,1,3,4,5": -0.006716066925283516, - "0,1,3,4,6": 0.002036578258060716, - "0,1,3,4,7": -0.0024446987867959083, - "0,1,3,5,6": 0.026518932941516207, - "0,1,3,5,7": 0.0210220735264377, - "0,1,3,6,7": -0.025914060327982547, - "0,1,4,5,6": -0.018720766997220216, - "0,1,4,5,7": -0.007281264265097884, - "0,1,4,6,7": -0.0015827110574810344, - "0,1,5,6,7": -0.268847156487236, - "0,2,3,4,5": 0.008437278110383493, - "0,2,3,4,6": 0.0003499824810462293, - "0,2,3,4,7": 0.00019709935390675032, - "0,2,3,5,6": -0.007524432517547544, - "0,2,3,5,7": 0.011574720321118396, - "0,2,3,6,7": -0.00921234968573359, - "0,2,4,5,6": 0.005382507352948818, - "0,2,4,5,7": 0.009723718699870924, - "0,2,4,6,7": 0.004973642935606648, - "0,2,5,6,7": -0.09423153048473744, - "0,3,4,5,6": 0.010307584847423126, - "0,3,4,5,7": -0.0008618445987433297, - "0,3,4,6,7": 0.003099356904076464, - "0,3,5,6,7": 0.08221723329938266, - "0,4,5,6,7": -0.03341299516423247, - "1,2,3,4,5": -0.0018128105693817342, - "1,2,3,4,6": 0.0002814302482832265, - "1,2,3,4,7": -0.00040253486958083395, - "1,2,3,5,6": -0.004215620364831196, - "1,2,3,5,7": -0.0031838335840493337, - "1,2,3,6,7": 0.0039577897160066565, - "1,2,4,5,6": -0.0014212765783758047, - "1,2,4,5,7": 0.0007768873284588473, - "1,2,4,6,7": -0.00224475664932422, - "1,2,5,6,7": -0.011068702261584865, - "1,3,4,5,6": 0.0011586267178772328, - "1,3,4,5,7": -0.0017048901136646755, - "1,3,4,6,7": 0.0004534713395741921, - "1,3,5,6,7": 0.05949111340549997, - "1,4,5,6,7": -0.0028890356439019577, - "2,3,4,5,6": -0.0008020673573234521, - "2,3,4,5,7": 0.0004292463783157202, - "2,3,4,6,7": 0.00013685587317890935, - "2,3,5,6,7": -0.001553078317958194, - "2,4,5,6,7": -0.005867595833379785, - "3,4,5,6,7": 0.0027716711493693535 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=FSII_order=6.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=FSII_order=6.json deleted file mode 100644 index c29c56ff9..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=FSII_order=6.json +++ /dev/null @@ -1,266 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.178082+00:00Z", - "metadata": { - "n_players": 8, - "index": "FSII", - "max_order": 6, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 0.0 - }, - "data": { - "0": -0.16260919967748358, - "1": 0.25257924564159706, - "2": 0.03404489004284744, - "3": 0.04455634962951146, - "4": 0.004270430286924257, - "5": 0.8663126567715513, - "6": -0.0764632436664242, - "7": 0.43814499489989545, - "0,1": 0.12301916424481699, - "0,2": 0.0687661820787597, - "0,3": -0.031931635332762415, - "0,4": 0.006377892748185621, - "0,5": 0.4325288710549756, - "0,6": -0.0013736104418181994, - "0,7": 0.06249660370734323, - "1,2": -0.05264519768173214, - "1,3": 0.03030656752227788, - "1,4": 0.00018852263019941695, - "1,5": 0.05056063286244313, - "1,6": -0.0037993985073738606, - "1,7": 0.029917143388919924, - "2,3": 0.0020780992935517384, - "2,4": 0.0010511146550237355, - "2,5": 0.06278240785373276, - "2,6": -0.04521317029887343, - "2,7": 0.014423468540022147, - "3,4": 0.00027701090904824754, - "3,5": 0.03392492996112959, - "3,6": -0.0032129763229953034, - "3,7": 0.013210922264476142, - "4,5": 0.041314056478549445, - "4,6": 0.000482137793970841, - "4,7": -0.0012803984600661678, - "5,6": 0.10608367457364648, - "5,7": -0.027710669672136673, - "6,7": 0.2660261303212865, - "0,1,2": -0.07566942548770775, - "0,1,3": -0.010146660182019776, - "0,1,4": 0.009587004578421404, - "0,1,5": 0.0862886154920014, - "0,1,6": 0.008317948682406647, - "0,1,7": 0.13269441962781842, - "0,2,3": -0.006731087965485952, - "0,2,4": -0.004089699073364456, - "0,2,5": -0.09410848446735835, - "0,2,6": 0.055906116815819196, - "0,2,7": -0.008169975365838657, - "0,3,4": -0.002549703938944603, - "0,3,5": 0.06972246040341162, - "0,3,6": -0.002900495750709109, - "0,3,7": -0.02605491286639902, - "0,4,5": 0.03666625816008119, - "0,4,6": -0.002824330114033005, - "0,4,7": 0.018233163110819087, - "0,5,6": 0.12361489683806792, - "0,5,7": -0.17518324041216668, - "0,6,7": 0.18152518523516695, - "1,2,3": -0.028505611003318422, - "1,2,4": 0.0021248514033197913, - "1,2,5": 0.039069718335709554, - "1,2,6": -0.009365427318297499, - "1,2,7": -0.00442780716949643, - "1,3,4": 0.0012243809631931543, - "1,3,5": -0.02359948303603119, - "1,3,6": 0.0016589383484870712, - "1,3,7": -0.020788117862388125, - "1,4,5": -0.03130133896327489, - "1,4,6": 0.006545809414822218, - "1,4,7": 0.0009430110239421821, - "1,5,6": 0.06746703013218279, - "1,5,7": -0.02995888964164861, - "1,6,7": 0.10962229149803782, - "2,3,4": 0.0004889525999157082, - "2,3,5": -0.0047547022720927645, - "2,3,6": 0.00019853361911293006, - "2,3,7": -0.00031438787921212255, - "2,4,5": -0.018788163377844475, - "2,4,6": -0.00018542268353473335, - "2,4,7": 0.004260254619292254, - "2,5,6": 0.028695461644178855, - "2,5,7": 0.12062342130853165, - "2,6,7": 0.026664364631371944, - "3,4,5": -0.0059061306084655305, - "3,4,6": 0.00017356529523696734, - "3,4,7": 8.992812035523573e-05, - "3,5,6": 0.0018265383838825151, - "3,5,7": -0.03071394256190587, - "3,6,7": -0.016760525745875856, - "4,5,6": -0.0020937947700845547, - "4,5,7": -0.00567367403266783, - "4,6,7": 0.008832115709939171, - "5,6,7": -0.0978115115944063, - "0,1,2,3": 0.02101289914991658, - "0,1,2,4": 0.0009287546333632615, - "0,1,2,5": 0.07663057352503408, - "0,1,2,6": -0.011342048272277638, - "0,1,2,7": 0.00410311702651836, - "0,1,3,4": -0.0024352734873676063, - "0,1,3,5": 0.06489913936710273, - "0,1,3,6": -0.007067592155173273, - "0,1,3,7": -0.013114356667987048, - "0,1,4,5": -0.0069589807936938225, - "0,1,4,6": 0.0071404055910866265, - "0,1,4,7": 0.013464187060496485, - "0,1,5,6": 0.12303510873692775, - "0,1,5,7": -0.024541903464485308, - "0,1,6,7": 0.34064500916954665, - "0,2,3,4": -0.0005565224067594909, - "0,2,3,5": 0.009225250308473848, - "0,2,3,6": -0.0005216831408192887, - "0,2,3,7": -0.0005287420581612731, - "0,2,4,5": 0.012868774171913892, - "0,2,4,6": 0.002107209917659711, - "0,2,4,7": -0.001778078707364801, - "0,2,5,6": -0.02834059153627578, - "0,2,5,7": -0.1106367709422671, - "0,2,6,7": -0.004893939947769623, - "0,3,4,5": -0.010463789240045838, - "0,3,4,6": 0.0015834370333983397, - "0,3,4,7": -0.0010985738338688752, - "0,3,5,6": -0.017595302201929293, - "0,3,5,7": 0.012894503001521292, - "0,3,6,7": -0.02465125630648226, - "0,4,5,6": -0.019849154141919283, - "0,4,5,7": -0.003665543263165545, - "0,4,6,7": 0.01974274303595741, - "0,5,6,7": -0.24359670128026925, - "1,2,3,4": -0.002696891623770681, - "1,2,3,5": 0.006291256936415676, - "1,2,3,6": -0.0038634717567872477, - "1,2,3,7": 0.011741166033876375, - "1,2,4,5": -0.0009020945972945116, - "1,2,4,6": 0.0011543628518747018, - "1,2,4,7": -0.0006914992633900857, - "1,2,5,6": 0.0011797387558258599, - "1,2,5,7": 0.01598345580544873, - "1,2,6,7": -0.012047628563901347, - "1,3,4,5": -0.004208678328192786, - "1,3,4,6": -0.0011260772178923878, - "1,3,4,7": 0.0008125404084272266, - "1,3,5,6": -0.000889470480237374, - "1,3,5,7": 0.021575191267393504, - "1,3,6,7": -0.01651564309567945, - "1,4,5,6": -0.0009581767401805608, - "1,4,5,7": -0.002365593623778958, - "1,4,6,7": 0.0026017129775083338, - "1,5,6,7": -0.06493117930831672, - "2,3,4,5": -0.005981841914424579, - "2,3,4,6": -1.0298252252474716e-05, - "2,3,4,7": -0.0003339599896754128, - "2,3,5,6": 0.0053968591732586405, - "2,3,5,7": -0.017527023868991257, - "2,3,6,7": 0.007999956729819492, - "2,4,5,6": -0.0066060786805101634, - "2,4,5,7": -0.016754172142760523, - "2,4,6,7": 0.0024341935714570218, - "2,5,6,7": 0.05232118473954242, - "3,4,5,6": 0.0015124216959182812, - "3,4,5,7": -0.0016054222175962696, - "3,4,6,7": 0.0002408504397431177, - "3,5,6,7": 0.015003334012929095, - "4,5,6,7": -0.00436524313655616, - "0,1,2,3,4": 0.002573174863743255, - "0,1,2,3,5": 0.002195898127037292, - "0,1,2,3,6": 0.008217233625496437, - "0,1,2,3,7": -0.00530936921776512, - "0,1,2,4,5": 0.006449772503120024, - "0,1,2,4,6": -8.131565946070674e-05, - "0,1,2,4,7": 0.00363988844836817, - "0,1,2,5,6": 0.015595204141045621, - "0,1,2,5,7": -0.012308936270361035, - "0,1,2,6,7": 0.04274871263242715, - "0,1,3,4,5": -0.008536078058735581, - "0,1,3,4,6": 0.0008029975364728242, - "0,1,3,4,7": -0.0009769232815000292, - "0,1,3,5,6": -0.005986534442997751, - "0,1,3,5,7": -0.007069953251464908, - "0,1,3,6,7": -0.05911276769548346, - "0,1,4,5,6": -0.017269538521169997, - "0,1,4,5,7": -0.00406557308757774, - "0,1,4,6,7": 0.002139487135686638, - "0,1,5,6,7": -0.2873082789545788, - "0,2,3,4,5": 0.0053399467796989425, - "0,2,3,4,6": -9.685966145833724e-05, - "0,2,3,4,7": 0.0005298011979291278, - "0,2,3,5,6": -0.004292119576147765, - "0,2,3,5,7": 0.017298661633097744, - "0,2,3,6,7": -0.006531030015907269, - "0,2,4,5,6": 0.005996657564643348, - "0,2,4,5,7": 0.010180519355054984, - "0,2,4,6,7": 0.00800100928560172, - "0,2,5,6,7": -0.07843644260881472, - "0,3,4,5,6": 0.006657125164699004, - "0,3,4,5,7": -0.000940730044123983, - "0,3,4,6,7": 0.0012348694091669082, - "0,3,5,6,7": 0.04730236150987512, - "0,4,5,6,7": -0.030010527713598707, - "1,2,3,4,5": -0.003724507603868596, - "1,2,3,4,6": 0.0005689744468611938, - "1,2,3,4,7": 6.909597367827508e-05, - "1,2,3,5,6": -0.0001461368261407095, - "1,2,3,5,7": 0.002781821045282795, - "1,2,3,6,7": 0.006429574541013033, - "1,2,4,5,6": -0.0029207812759285967, - "1,2,4,5,7": -0.0014754238354113686, - "1,2,4,6,7": -0.002377750279170277, - "1,2,5,6,7": 0.0016688098365860125, - "1,3,4,5,6": 5.621933994348627e-05, - "1,3,4,5,7": 0.00016881972691944191, - "1,3,4,6,7": 9.033067165724329e-05, - "1,3,5,6,7": 0.026180372670216126, - "1,4,5,6,7": -0.0008332620152528402, - "2,3,4,5,6": -0.0014687015351826788, - "2,3,4,5,7": 0.0008169169017640671, - "2,3,4,6,7": 0.0003517349502825465, - "2,3,5,6,7": 0.00066524231912014, - "2,4,5,6,7": -0.004857619145799602, - "3,4,5,6,7": 0.0012295311328332503, - "0,1,2,3,4,5": 0.0045017840223860565, - "0,1,2,3,4,6": -0.0005207377041518968, - "0,1,2,3,4,7": -0.0004300634560911662, - "0,1,2,3,5,6": -0.005978390851189105, - "0,1,2,3,5,7": -0.009311885356663732, - "0,1,2,3,6,7": -0.002948185256655571, - "0,1,2,4,5,6": 0.0010004160041569878, - "0,1,2,4,5,7": 0.002964877167745049, - "0,1,2,4,6,7": -0.0018977976535643273, - "0,1,2,5,6,7": -0.025532583116691834, - "0,1,3,4,5,6": 0.002315812310700688, - "0,1,3,4,5,7": -0.0031775741548392897, - "0,1,3,4,6,7": 0.000672086793395428, - "0,1,3,5,6,7": 0.06867351295996407, - "0,1,4,5,6,7": -0.006218685027335958, - "0,2,3,4,5,6": 0.001671320490089426, - "0,2,3,4,5,7": 2.155824103305254e-05, - "0,2,3,4,6,7": -0.00025689836752094963, - "0,2,3,5,6,7": -0.0021575559034504588, - "0,2,4,5,6,7": -0.003900036583484985, - "0,3,4,5,6,7": 0.0033137867815624233, - "1,2,3,4,5,6": -0.00010977121182786584, - "1,2,3,4,5,7": -0.0005686191871867308, - "1,2,3,4,6,7": 5.5420949545016e-05, - "1,2,3,5,6,7": -0.00205080515518046, - "1,2,4,5,6,7": 0.002108364332406451, - "1,3,4,5,6,7": -1.2263266430598274e-06, - "2,3,4,5,6,7": -0.00022828065087911187 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=FSII_order=7.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=FSII_order=7.json deleted file mode 100644 index 41f1c5449..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=FSII_order=7.json +++ /dev/null @@ -1,274 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.173080+00:00Z", - "metadata": { - "n_players": 8, - "index": "FSII", - "max_order": 7, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 0.0 - }, - "data": { - "0": -0.16261420796705972, - "1": 0.2525737822909922, - "2": 0.03404010685219519, - "3": 0.04454690113571455, - "4": 0.0042745784814283315, - "5": 0.8663078092570458, - "6": -0.07646751740133893, - "7": 0.4381398781285771, - "0,1": 0.12305767530519368, - "0,2": 0.068799931326429, - "0,3": -0.03186522845070462, - "0,4": 0.006349122661781562, - "0,5": 0.4325630717239693, - "0,6": -0.0013434270715816654, - "0,7": 0.06253268758421965, - "1,2": -0.05260826553092872, - "1,3": 0.030376157096548555, - "1,4": 0.0001629347682371024, - "1,5": 0.050598015801619614, - "1,6": -0.00376603258402175, - "1,7": 0.02995640993500147, - "2,3": 0.002142926986732116, - "2,4": 0.0010207653043561226, - "2,5": 0.06281502910965067, - "2,6": -0.04518456576261414, - "2,7": 0.014457973615152164, - "3,4": 0.00027931909043093367, - "3,5": 0.033990208899074906, - "3,6": -0.0031517142860986273, - "3,7": 0.01327808429903729, - "4,5": 0.04128415823661661, - "4,6": 0.0004482225561870806, - "4,7": -0.0013084136602899352, - "5,6": 0.10611272980629437, - "5,7": -0.027675713862655132, - "6,7": 0.26605706905849963, - "0,1,2": -0.07581822545803815, - "0,1,3": -0.01042608978204728, - "0,1,4": 0.009688283401162522, - "0,1,5": 0.08613801148876996, - "0,1,6": 0.008183412962809125, - "0,1,7": 0.13253628237541526, - "0,2,3": -0.006991470724731622, - "0,2,4": -0.003969373657691712, - "0,2,5": -0.09424004211295699, - "0,2,6": 0.05579062732738145, - "0,2,7": -0.008309065758264594, - "0,3,4": -0.0025600080397891883, - "0,3,5": 0.06946027343355281, - "0,3,6": -0.0031466145675169976, - "0,3,7": -0.02632463297810199, - "0,4,5": 0.03678477952680462, - "0,4,6": -0.002689740520880078, - "0,4,7": 0.018344151578649128, - "0,5,6": 0.12349760320215342, - "0,5,7": -0.17532413507181008, - "0,6,7": 0.1814003584950869, - "1,2,3": -0.028778723346827628, - "1,2,4": 0.0022324478378900614, - "1,2,5": 0.03892543165584555, - "1,2,6": -0.009493645927959062, - "1,2,7": -0.004579626921481301, - "1,3,4": 0.0012013476419382232, - "1,3,5": -0.02387439902988457, - "1,3,6": 0.0014000904851568519, - "1,3,7": -0.0210705670389328, - "1,4,5": -0.03119554630312938, - "1,4,6": 0.006667670367609943, - "1,4,7": 0.001041270712111915, - "1,5,6": 0.06733700797200338, - "1,5,7": -0.03011251286018468, - "1,6,7": 0.10948473616684695, - "2,3,4": 0.00048496598379742933, - "2,3,5": -0.005010571887293199, - "2,3,6": -4.126784852274967e-05, - "2,3,7": -0.0005777906254101212, - "2,4,5": -0.018663324423771332, - "2,4,6": -4.4515273888091206e-05, - "2,4,7": 0.004377560816074044, - "2,5,6": 0.028584485356932546, - "2,5,7": 0.12048884427640985, - "2,6,7": 0.02654585554196695, - "3,4,5": -0.005911921163715528, - "3,4,6": 0.00018384302995357038, - "3,4,7": 7.660494907339027e-05, - "3,5,6": 0.0015849330462297112, - "3,5,7": -0.03097914879330932, - "3,6,7": -0.01700966410081437, - "4,5,6": -0.0019546913714746095, - "4,5,7": -0.005558171266370898, - "4,6,7": 0.008963686383228725, - "5,6,7": -0.09793182408588752, - "0,1,2,3": 0.021835451101419184, - "0,1,2,4": 0.0006091815325294792, - "0,1,2,5": 0.07706664967490837, - "0,1,2,6": -0.010954176639665848, - "0,1,2,7": 0.004561792238943103, - "0,1,3,4": -0.0023629580495194945, - "0,1,3,5": 0.06572710342076281, - "0,1,3,6": -0.006287832098384679, - "0,1,3,7": -0.012263793050608124, - "0,1,4,5": -0.007273141748565012, - "0,1,4,6": 0.006778040142005058, - "0,1,4,7": 0.01317262497436901, - "0,1,5,6": 0.12342839261667796, - "0,1,5,7": -0.024077816781090125, - "0,1,6,7": 0.3410608923696993, - "0,2,3,4": -0.0005413469550175423, - "0,2,3,5": 0.00999607521871844, - "0,2,3,6": 0.0002009369837708292, - "0,2,3,7": 0.00026468142081187765, - "0,2,4,5": 0.012497474039028664, - "0,2,4,6": 0.0016877046204942844, - "0,2,4,7": -0.0021267808568199206, - "0,2,5,6": -0.02800444678630929, - "0,2,5,7": -0.11022982343289081, - "0,2,6,7": -0.004535196718879565, - "0,3,4,5": -0.01044320137563215, - "0,3,4,6": 0.0015558200964619698, - "0,3,4,7": -0.0010553873799185667, - "0,3,5,6": -0.016867269655665637, - "0,3,5,7": 0.013693338283956531, - "0,3,6,7": -0.02390062480326019, - "0,4,5,6": -0.020263247014044777, - "0,4,5,7": -0.0040088334360756026, - "0,4,6,7": 0.01935124847029247, - "0,5,6,7": -0.2432325460985046, - "1,2,3,4": -0.002643528553722704, - "1,2,3,5": 0.0071002689899066235, - "1,2,3,6": -0.003102663946134461, - "1,2,3,7": 0.012572777198286707, - "1,2,4,5": -0.0012352084445086606, - "1,2,4,6": 0.0007730444305417, - "1,2,4,7": -0.0010020146226250711, - "1,2,5,6": 0.001554069865403171, - "1,2,5,7": 0.016428589646615553, - "1,2,6,7": -0.011650698459620475, - "1,3,4,5": -0.004149904523957741, - "1,3,4,6": -0.0011155075520261192, - "1,3,4,7": 0.0008939135147301401, - "1,3,5,6": -0.0001232517205198326, - "1,3,5,7": 0.022412212887634467, - "1,3,6,7": -0.015726824638121036, - "1,4,5,6": -0.0013340843817996537, - "1,4,5,7": -0.002670698537369662, - "1,4,6,7": 0.0022484043221620495, - "1,5,6,7": -0.06452883857592409, - "2,3,4,5": -0.005980206815479828, - "2,3,4,6": -5.6867874367184934e-05, - "2,3,4,7": -0.00030972675545263423, - "2,3,5,6": 0.006105939304034927, - "2,3,5,7": -0.016747141316743458, - "2,3,6,7": 0.008731635398564558, - "2,4,5,6": -0.007039124736323538, - "2,4,5,7": -0.017116415897252667, - "2,4,6,7": 0.0020237454755494128, - "2,5,6,7": 0.05266638673470734, - "3,4,5,6": 0.001471263036426522, - "3,4,5,7": -0.0015757781942387673, - "3,4,6,7": 0.00022229052998780363, - "3,5,6,7": 0.015740423582825805, - "4,5,6,7": -0.004770280377429444, - "0,1,2,3,4": 0.0024317281197050594, - "0,1,2,3,5": 0.0001653284423198051, - "0,1,2,3,6": 0.006307174649272815, - "0,1,2,3,7": -0.007396436623437211, - "0,1,2,4,5": 0.007274515778613724, - "0,1,2,4,6": 0.0008639392365100557, - "0,1,2,4,7": 0.004408135273275276, - "0,1,2,5,6": 0.014651335337477894, - "0,1,2,5,7": -0.013429812720854917, - "0,1,2,6,7": 0.041748346089931665, - "0,1,3,4,5": -0.008691054777347638, - "0,1,3,4,6": 0.0007685318527925755, - "0,1,3,4,7": -0.0011883970208265288, - "0,1,3,5,6": -0.007910123124183668, - "0,1,3,5,7": -0.009170549837325737, - "0,1,3,6,7": -0.061092854949316364, - "0,1,4,5,6": -0.016337813222780304, - "0,1,4,5,7": -0.003310855268084903, - "0,1,4,6,7": 0.003014715109869396, - "0,1,5,6,7": -0.28832217424194095, - "0,2,3,4,5": 0.005327818209500658, - "0,2,3,4,6": 1.1523901976326356e-05, - "0,2,3,4,7": 0.0004611771174319809, - "0,2,3,5,6": -0.006072859977354836, - "0,2,3,5,7": 0.015340913885372395, - "0,2,3,6,7": -0.008368267361759385, - "0,2,4,5,6": 0.007071230701821557, - "0,2,4,5,7": 0.011078085572342106, - "0,2,4,6,7": 0.009019086784757949, - "0,2,5,6,7": -0.07930748936444988, - "0,3,4,5,6": 0.006751978577809556, - "0,3,4,5,7": -0.001022883523354376, - "0,3,4,6,7": 0.0012732265405868692, - "0,3,5,6,7": 0.04545159494919262, - "0,4,5,6,7": -0.0290059792415171, - "1,2,3,4,5": -0.0038321029801075684, - "1,2,3,4,6": 0.0005818898860593252, - "1,2,3,4,7": -9.499624331523251e-05, - "1,2,3,5,6": -0.002022344781921259, - "1,2,3,5,7": 0.0007286057867154187, - "1,2,3,6,7": 0.004496868332440923, - "1,2,4,5,6": -0.001941673875913083, - "1,2,4,5,7": -0.0006733233365163408, - "1,2,4,6,7": -0.0014551398097333995, - "1,2,5,6,7": 0.0007022966147029117, - "1,3,4,5,6": 5.560734419725322e-05, - "1,3,4,5,7": -8.799055249378296e-06, - "1,3,4,6,7": 3.322118752893677e-05, - "1,3,5,6,7": 0.024234140194237676, - "1,4,5,6,7": 7.582225100740206e-05, - "2,3,4,5,6": -0.0013264664578615804, - "2,3,4,5,7": 0.0007821454786671941, - "2,3,4,6,7": 0.00043747402959346676, - "2,3,5,6,7": -0.001138142606131029, - "2,4,5,6,7": -0.0038056876948744656, - "3,4,5,6,7": 0.001301743536728274, - "0,1,2,3,4,5": 0.004756183900891053, - "0,1,2,3,4,6": -0.0005314629287321085, - "0,1,2,3,4,7": -5.1370651950349844e-05, - "0,1,2,3,5,6": -0.0018330441337286313, - "0,1,2,3,5,7": -0.0047771217242218375, - "0,1,2,3,6,7": 0.0013214561772216735, - "0,1,2,4,5,6": -0.0011359281310156996, - "0,1,2,4,5,7": 0.0012179490130017068, - "0,1,2,4,6,7": -0.003909848949001482, - "0,1,2,5,6,7": -0.02338856216564265, - "0,1,3,4,5,6": 0.0023348516831138387, - "0,1,3,4,5,7": -0.002769118346746452, - "0,1,3,4,6,7": 0.0008154201008191281, - "0,1,3,5,6,7": 0.07297291716146778, - "0,1,4,5,6,7": -0.008200973716904807, - "0,2,3,4,5,6": 0.0013760938955582197, - "0,2,3,4,5,7": 0.00011574732490789164, - "0,2,3,4,6,7": -0.0004278330702361527, - "0,2,3,5,6,7": 0.0018275820253470035, - "0,2,4,5,6,7": -0.006196591017389053, - "0,3,4,5,6,7": 0.0031726150324254895, - "1,2,3,4,5,6": -0.00019497026660780098, - "1,2,3,4,5,7": -0.00026440254061287777, - "1,2,3,4,6,7": 9.45150112447446e-05, - "1,2,3,5,6,7": 0.002144361066025266, - "1,2,4,5,6,7": 2.183488715697124e-05, - "1,3,4,5,6,7": 6.76267218840676e-05, - "2,3,4,5,6,7": -0.00047369233937068905, - "0,1,2,3,4,5,6": 0.00013501675965443827, - "0,1,2,3,4,5,7": -0.0006438162353101934, - "0,1,2,3,4,6,7": -0.00011356924098106236, - "0,1,2,3,5,6,7": -0.008425713009724216, - "0,1,2,4,5,6,7": 0.00413767203607324, - "0,1,3,4,5,6,7": -0.0001730940857626144, - "0,2,3,4,5,6,7": 0.00045543781089196766, - "1,2,3,4,5,6,7": 3.538454743554076e-05 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=FSII_order=8.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=FSII_order=8.json deleted file mode 100644 index 0c7a4005d..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=FSII_order=8.json +++ /dev/null @@ -1,275 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.246043+00:00Z", - "metadata": { - "n_players": 8, - "index": "FSII", - "max_order": 8, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 0.0 - }, - "data": { - "0": -0.1626141880627747, - "1": 0.25257380320463874, - "2": 0.034040127796778646, - "3": 0.044546921841197566, - "4": 0.00427459924273504, - "5": 0.8663078299682231, - "6": -0.0764674968183972, - "7": 0.4381398988348255, - "0,1": 0.12305751035112739, - "0,2": 0.06879976674738313, - "0,3": -0.03186539285532747, - "0,4": 0.006348957819072559, - "0,5": 0.4325629065678358, - "0,6": -0.0013435917453952506, - "0,7": 0.06253252268505731, - "1,2": -0.052608430870208625, - "1,3": 0.03037599177830072, - "1,4": 0.00016276970370472654, - "1,5": 0.050597850477261265, - "1,6": -0.0037661974477984153, - "1,7": 0.02995624455546917, - "2,3": 0.002142761659052597, - "2,4": 0.0010205999661546464, - "2,5": 0.06281486415616659, - "2,6": -0.045184731157745975, - "2,7": 0.01445780794484619, - "3,4": 0.00027915366074154815, - "3,5": 0.033990043283052135, - "3,6": -0.0031518796976419683, - "3,7": 0.013277919001632197, - "4,5": 0.04128399297037421, - "4,6": 0.0004480570365509584, - "4,7": -0.00130857889882538, - "5,6": 0.10611256494368813, - "5,7": -0.027675879245306345, - "6,7": 0.26605690372088575, - "0,1,2": -0.0758174825460655, - "0,1,3": -0.010425347279712248, - "0,1,4": 0.009689026483157594, - "0,1,5": 0.08613875514250129, - "0,1,6": 0.00818415558789845, - "0,1,7": 0.13253702545864626, - "0,2,3": -0.006990728701269294, - "0,2,4": -0.0039686308712545415, - "0,2,5": -0.09423929918036317, - "0,2,6": 0.05579137006369429, - "0,2,7": -0.008308323132119544, - "0,3,4": -0.0025592656821716436, - "0,3,5": 0.06946101647648295, - "0,3,6": -0.0031458724094065305, - "0,3,7": -0.026323890516250073, - "0,4,5": 0.036785522691603234, - "0,4,6": -0.002688997229135154, - "0,4,7": 0.018344894679599696, - "0,5,6": 0.12349834639901242, - "0,5,7": -0.17532339164798233, - "0,6,7": 0.18140110182801977, - "1,2,3": -0.028777979919704613, - "1,2,4": 0.0022331908390465366, - "1,2,5": 0.03892617474981889, - "1,2,6": -0.009492902966704336, - "1,2,7": -0.004578883726476562, - "1,3,4": 0.0012020907925336943, - "1,3,5": -0.02387365552411334, - "1,3,6": 0.0014008330861022197, - "1,3,7": -0.02106982403143684, - "1,4,5": -0.03119480364741787, - "1,4,6": 0.006668413097306411, - "1,4,7": 0.0010420135470567415, - "1,5,6": 0.06733775037217418, - "1,5,7": -0.03011177007231715, - "1,6,7": 0.10948547884967386, - "2,3,4": 0.00048570938126923924, - "2,3,5": -0.005009828445546122, - "2,3,6": -4.0524617200391605e-05, - "2,3,7": -0.0005770468887395935, - "2,4,5": -0.01866258183085715, - "2,4,6": -4.37720848777412e-05, - "2,4,7": 0.004378304120392848, - "2,5,6": 0.028585228190888462, - "2,5,7": 0.12048958726920024, - "2,6,7": 0.026546599058095685, - "3,4,5": -0.005911177771028439, - "3,4,6": 0.00018458639212003136, - "3,4,7": 7.734822515582593e-05, - "3,5,6": 0.0015856761637874951, - "3,5,7": -0.030978405322098196, - "3,6,7": -0.017008920743966593, - "4,5,6": -0.0019539485963519093, - "4,5,7": -0.00555742876937429, - "4,6,7": 0.008964429872789684, - "5,6,7": -0.09793108142952188, - "0,1,2,3": 0.02183297595056873, - "0,1,2,4": 0.000606705373233582, - "0,1,2,5": 0.07706417317272596, - "0,1,2,6": -0.010956652584107128, - "0,1,2,7": 0.004559316001725572, - "0,1,3,4": -0.00236543369587746, - "0,1,3,5": 0.06572462689635068, - "0,1,3,6": -0.006290307436585187, - "0,1,3,7": -0.012266268413827563, - "0,1,4,5": -0.007275618475118236, - "0,1,4,6": 0.006775563255638658, - "0,1,4,7": 0.01317014854495148, - "0,1,5,6": 0.1234259160895159, - "0,1,5,7": -0.02408029314833863, - "0,1,6,7": 0.34105841571178597, - "0,2,3,4": -0.000543821737380927, - "0,2,3,5": 0.009993599345278784, - "0,2,3,6": 0.0001984625311045561, - "0,2,3,7": 0.0002622064756943529, - "0,2,4,5": 0.012494998203953792, - "0,2,4,6": 0.001685228775074564, - "0,2,4,7": -0.002129256553154983, - "0,2,5,6": -0.028006922386407968, - "0,2,5,7": -0.11023229940263594, - "0,2,6,7": -0.004537672682944183, - "0,3,4,5": -0.010445677737585597, - "0,3,4,6": 0.0015533445745072871, - "0,3,4,7": -0.0010578628895400108, - "0,3,5,6": -0.016869745609061702, - "0,3,5,7": 0.01369086218490765, - "0,3,6,7": -0.023903100275417033, - "0,4,5,6": -0.020265723651540918, - "0,4,5,7": -0.00401130969961775, - "0,4,6,7": 0.019348771578584275, - "0,5,6,7": -0.24323502253630896, - "1,2,3,4": -0.002646005210359431, - "1,2,3,5": 0.0070977917658297945, - "1,2,3,6": -0.003105140137194873, - "1,2,3,7": 0.01257030056366229, - "1,2,4,5": -0.001237684217295268, - "1,2,4,6": 0.0007705681978827719, - "1,2,4,7": -0.0010044907296550554, - "1,2,5,6": 0.0015515944181178284, - "1,2,5,7": 0.016426113816237854, - "1,2,6,7": -0.011653174697822732, - "1,3,4,5": -0.0041523805171073645, - "1,3,4,6": -0.0011179831691675163, - "1,3,4,7": 0.000891437715837079, - "1,3,5,6": -0.00012572727040295606, - "1,3,5,7": 0.022409736999100004, - "1,3,6,7": -0.01572930033935284, - "1,4,5,6": -0.001336559007419351, - "1,4,5,7": -0.002673173038575616, - "1,4,6,7": 0.0022459287072003897, - "1,5,6,7": -0.06453131321599045, - "2,3,4,5": -0.0059826837081188786, - "2,3,4,6": -5.9344432687107734e-05, - "2,3,4,7": -0.0003122035080813171, - "2,3,5,6": 0.006103462736900003, - "2,3,5,7": -0.016749618432101723, - "2,3,6,7": 0.008729158600393173, - "2,4,5,6": -0.007041600311273558, - "2,4,5,7": -0.017118891420429258, - "2,4,6,7": 0.002021268877215836, - "2,5,6,7": 0.05266391092841434, - "3,4,5,6": 0.0014687871178632461, - "3,4,5,7": -0.0015782544300254504, - "3,4,6,7": 0.00021981406758007221, - "3,5,6,7": 0.015737947365515148, - "4,5,6,7": -0.004772755634902107, - "0,1,2,3,4": 0.002438534917046587, - "0,1,2,3,5": 0.0001721361128775578, - "0,1,2,3,6": 0.006313981278291889, - "0,1,2,3,7": -0.007389630001274822, - "0,1,2,4,5": 0.007281323489737635, - "0,1,2,4,6": 0.0008707476719233415, - "0,1,2,4,7": 0.004414943227194403, - "0,1,2,5,6": 0.014658142559442273, - "0,1,2,5,7": -0.01342300510676378, - "0,1,2,6,7": 0.04175515483778508, - "0,1,3,4,5": -0.008684246310780151, - "0,1,3,4,6": 0.0007753399209196599, - "0,1,3,4,7": -0.0011815900359207973, - "0,1,3,5,6": -0.007903315330860035, - "0,1,3,5,7": -0.009163742227944357, - "0,1,3,6,7": -0.061086047082205636, - "0,1,4,5,6": -0.01633100495766736, - "0,1,4,5,7": -0.0033040477805623136, - "0,1,4,6,7": 0.0030215247411747997, - "0,1,5,6,7": -0.2883153664315559, - "0,2,3,4,5": 0.005334625763796459, - "0,2,3,4,6": 1.8329634243998555e-05, - "0,2,3,4,7": 0.0004679830476354077, - "0,2,3,5,6": -0.006066053602429185, - "0,2,3,5,7": 0.015347721327848597, - "0,2,3,6,7": -0.00836146115514231, - "0,2,4,5,6": 0.007078037636373883, - "0,2,4,5,7": 0.011084892707489746, - "0,2,4,6,7": 0.009025894486976074, - "0,2,5,6,7": -0.07930068237241404, - "0,3,4,5,6": 0.006758786925121003, - "0,3,4,5,7": -0.0010160755034600809, - "0,3,4,6,7": 0.0012800341641149536, - "0,3,5,6,7": 0.045458402833281106, - "0,4,5,6,7": -0.02899917110226514, - "1,2,3,4,5": -0.003825294061266485, - "1,2,3,4,6": 0.0005886977848464647, - "1,2,3,4,7": -8.818822429881856e-05, - "1,2,3,5,6": -0.0020155366008775266, - "1,2,3,5,7": 0.0007354148097351021, - "1,2,3,6,7": 0.00450367695154643, - "1,2,4,5,6": -0.0019348672266228176, - "1,2,4,5,7": -0.0006665164179966432, - "1,2,4,6,7": -0.0014483314816520765, - "1,2,5,6,7": 0.0007091037951081486, - "1,3,4,5,6": 6.241401729703555e-05, - "1,3,4,5,7": -1.992734736049051e-06, - "1,3,4,6,7": 4.002787021557819e-05, - "1,3,5,6,7": 0.024240946442552008, - "1,4,5,6,7": 8.26269513697353e-05, - "2,3,4,5,6": -0.0013196578108656022, - "2,3,4,5,7": 0.0007889551697003207, - "2,3,4,6,7": 0.00044428255167118166, - "2,3,5,6,7": -0.0011313333371841747, - "2,4,5,6,7": -0.003798880359652687, - "3,4,5,6,7": 0.0013085511504888209, - "0,1,2,3,4,5": 0.004739847666258928, - "0,1,2,3,4,6": -0.0005477981612139193, - "0,1,2,3,4,7": -6.770568285054818e-05, - "0,1,2,3,5,6": -0.0018493792672857404, - "0,1,2,3,5,7": -0.004793457012214869, - "0,1,2,3,6,7": 0.0013051203559394792, - "0,1,2,4,5,6": -0.0011522634356050734, - "0,1,2,4,5,7": 0.0012016142362716448, - "0,1,2,4,6,7": -0.003926186818125586, - "0,1,2,5,6,7": -0.0234048978612566, - "0,1,3,4,5,6": 0.0023185146457027975, - "0,1,3,4,5,7": -0.0027854537476579323, - "0,1,3,4,6,7": 0.0007990829270443367, - "0,1,3,5,6,7": 0.07295658173445595, - "0,1,4,5,6,7": -0.008217309440189953, - "0,2,3,4,5,6": 0.0013597592156169638, - "0,2,3,4,5,7": 9.941133494761889e-05, - "0,2,3,4,6,7": -0.0004441669149887681, - "0,2,3,5,6,7": 0.0018112465098520276, - "0,2,4,5,6,7": -0.006212926350536545, - "0,3,4,5,6,7": 0.0031562781167222415, - "1,2,3,4,5,6": -0.0002113066490590093, - "1,2,3,4,5,7": -0.0002807397821671387, - "1,2,3,4,6,7": 7.817963346463952e-05, - "1,2,3,5,6,7": 0.002128023826376106, - "1,2,4,5,6,7": 5.499982522139124e-06, - "1,3,4,5,6,7": 5.1293938494213764e-05, - "2,3,4,5,6,7": -0.0004900302908389595, - "0,1,2,3,4,5,6": 0.00017040726456361843, - "0,1,2,3,4,5,7": -0.0006084259069927024, - "0,1,2,3,4,6,7": -7.817917220858533e-05, - "0,1,2,3,5,6,7": -0.008390323151497375, - "0,1,2,4,5,6,7": 0.00417306207567255, - "0,1,3,4,5,6,7": -0.00013770380926864112, - "0,2,3,4,5,6,7": 0.0004908279626161527, - "1,2,3,4,5,6,7": 7.077442200601608e-05, - "0,1,2,3,4,5,6,7": -7.077406472862091e-05 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=Moebius_order=8.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=Moebius_order=8.json deleted file mode 100644 index 6072e98c3..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=Moebius_order=8.json +++ /dev/null @@ -1,276 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.187695+00:00Z", - "metadata": { - "n_players": 8, - "index": "Moebius", - "max_order": 8, - "min_order": 0, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.072184995821221 - }, - "data": { - "Empty": 2.072184995821221, - "0": -0.16261418772220537, - "1": 0.25257380296742893, - "2": 0.03404012754182517, - "3": 0.044546921896047476, - "4": 0.004274599180631888, - "5": 0.866307829944895, - "6": -0.07646749671482511, - "7": 0.4381398989545833, - "0,1": 0.12305751039498114, - "0,2": 0.06879976665378207, - "0,3": -0.03186539327538562, - "0,4": 0.006348957784406473, - "0,5": 0.43256290683208176, - "0,6": -0.001343591904652719, - "0,7": 0.06253252257449615, - "1,2": -0.05260843083096711, - "1,3": 0.030375991777427558, - "1,4": 0.0001627696826771441, - "1,5": 0.050597850652254195, - "1,6": -0.0037661976376255346, - "1,7": 0.029956244518440034, - "2,3": 0.0021427617976605973, - "2,4": 0.0010206000064738596, - "2,5": 0.06281486401814362, - "2,6": -0.04518473112286081, - "2,7": 0.014457807951902879, - "3,4": 0.0002791536757293933, - "3,5": 0.03399004342480172, - "3,6": -0.003151879705280969, - "3,7": 0.01327791906929221, - "4,5": 0.041283992819152626, - "4,6": 0.00044805721857854586, - "4,7": -0.001308578845925279, - "5,6": 0.1061125647790706, - "5,7": -0.027675879294393635, - "6,7": 0.2660569037436611, - "0,1,2": -0.07581748269137645, - "0,1,3": -0.010425346893652154, - "0,1,4": 0.00968902634951041, - "0,1,5": 0.08613875427434436, - "0,1,6": 0.008184155718661046, - "0,1,7": 0.13253702546279555, - "0,2,3": -0.006990728204731234, - "0,2,4": -0.003968630745211588, - "0,2,5": -0.09423929931937414, - "0,2,6": 0.05579137023380798, - "0,2,7": -0.00830832294807271, - "0,3,4": -0.0025592651310848424, - "0,3,5": 0.06946101623610534, - "0,3,6": -0.0031458718027115307, - "0,3,7": -0.026323889950522705, - "0,4,5": 0.03678552244621436, - "0,4,6": -0.0026889975598953786, - "0,4,7": 0.018344894666615374, - "0,5,6": 0.12349834621387856, - "0,5,7": -0.17532339201209135, - "0,6,7": 0.18140110188899028, - "1,2,3": -0.028777980136038384, - "1,2,4": 0.0022331909268720196, - "1,2,5": 0.03892617476641469, - "1,2,6": -0.00949290285636728, - "1,2,7": -0.004578883747135443, - "1,3,4": 0.0012020909926775403, - "1,3,5": -0.02387365587728807, - "1,3,6": 0.001400833392986467, - "1,3,7": -0.021069823921308295, - "1,4,5": -0.03119480327188162, - "1,4,6": 0.006668413176678545, - "1,4,7": 0.0010420137098949844, - "1,5,6": 0.06733775081541005, - "1,5,7": -0.03011177000524956, - "1,6,7": 0.1094854791448312, - "2,3,4": 0.00048570925087876304, - "2,3,5": -0.005009828674734873, - "2,3,6": -4.052491810746517e-05, - "2,3,7": -0.000577047290315047, - "2,4,5": -0.018662581163675362, - "2,4,6": -4.377242168729367e-05, - "2,4,7": 0.004378304036486647, - "2,5,6": 0.028585228660454653, - "2,5,7": 0.12048958750966543, - "2,6,7": 0.026546598825164303, - "3,4,5": -0.005911177670970602, - "3,4,6": 0.00018458610445559742, - "3,4,7": 7.734804350167934e-05, - "3,5,6": 0.0015856761539625452, - "3,5,7": -0.030978405661989505, - "3,6,7": -0.017008920996498755, - "4,5,6": -0.001953948306280484, - "4,5,7": -0.005557428416471222, - "4,6,7": 0.008964429344984648, - "5,6,7": -0.09793108117582294, - "0,1,2,3": 0.021832975829152, - "0,1,2,4": 0.0006067056767014023, - "0,1,2,5": 0.07706417396679965, - "0,1,2,6": -0.010956652523764099, - "0,1,2,7": 0.004559316083174725, - "0,1,3,4": -0.002365434029293123, - "0,1,3,5": 0.06572462770294774, - "0,1,3,6": -0.006290308113023002, - "0,1,3,7": -0.012266269223661919, - "0,1,4,5": -0.0072756178777830804, - "0,1,4,6": 0.0067755638551236785, - "0,1,4,7": 0.013170148672343007, - "0,1,5,6": 0.12342591635617994, - "0,1,5,7": -0.024080292581441398, - "0,1,6,7": 0.34105841545865845, - "0,2,3,4": -0.0005438225507607974, - "0,2,3,5": 0.009993599441640022, - "0,2,3,6": 0.0001984616714851839, - "0,2,3,7": 0.00026220568131396504, - "0,2,4,5": 0.012494997781556272, - "0,2,4,6": 0.001685228854655385, - "0,2,4,7": -0.0021292568948139134, - "0,2,5,6": -0.028006922842757298, - "0,2,5,7": -0.11023229945494428, - "0,2,6,7": -0.00453767308844899, - "0,3,4,5": -0.01044567766363258, - "0,3,4,6": 0.0015533443091246824, - "0,3,4,7": -0.0010578635573033068, - "0,3,5,6": -0.01686974568428612, - "0,3,5,7": 0.013690862415616234, - "0,3,6,7": -0.02390310111997973, - "0,4,5,6": -0.02026572327248166, - "0,4,5,7": -0.004011309549377895, - "0,4,6,7": 0.019348772155992844, - "0,5,6,7": -0.24323502253679052, - "1,2,3,4": -0.002646005115943151, - "1,2,3,5": 0.007097792475822207, - "1,2,3,6": -0.003105139957997327, - "1,2,3,7": 0.012570300908113285, - "1,2,4,5": -0.0012376849243453947, - "1,2,4,6": 0.0007705684514918154, - "1,2,4,7": -0.0010044906454762526, - "1,2,5,6": 0.0015515938634185211, - "1,2,5,7": 0.01642611385720505, - "1,2,6,7": -0.011653174562005209, - "1,3,4,5": -0.004152380818100543, - "1,3,4,6": -0.001117983410442669, - "1,3,4,7": 0.0008914373364135031, - "1,3,5,6": -0.00012572767146457053, - "1,3,5,7": 0.022409737108019634, - "1,3,6,7": -0.015729300910098054, - "1,4,5,6": -0.001336559912983759, - "1,4,5,7": -0.0026731738195073795, - "1,4,6,7": 0.002245928780140183, - "1,5,6,7": -0.0645313141140682, - "2,3,4,5": -0.005982683855967785, - "2,3,4,6": -5.934393263018478e-05, - "2,3,4,7": -0.0003122030178661639, - "2,3,5,6": 0.006103462900506784, - "2,3,5,7": -0.016749617579648657, - "2,3,6,7": 0.008729159325970848, - "2,4,5,6": -0.007041601038324963, - "2,4,5,7": -0.017118891986976692, - "2,4,6,7": 0.002021269682918714, - "2,5,6,7": 0.05266391066415821, - "3,4,5,6": 0.0014687870989047447, - "3,4,5,7": -0.0015782542008055955, - "3,4,6,7": 0.00021981479773725, - "3,5,6,7": 0.01573794765071357, - "4,5,6,7": -0.004772755752323832, - "0,1,2,3,4": 0.0024385349123359212, - "0,1,2,3,5": 0.00017213517728631444, - "0,1,2,3,6": 0.006313981420873027, - "0,1,2,3,7": -0.0073896294907007665, - "0,1,2,4,5": 0.007281323510054172, - "0,1,2,4,6": 0.0008707467870818775, - "0,1,2,4,7": 0.004414942965413449, - "0,1,2,5,6": 0.01465814270591359, - "0,1,2,5,7": -0.013423005474786365, - "0,1,2,6,7": 0.04175515475200786, - "0,1,3,4,5": -0.008684246825566344, - "0,1,3,4,6": 0.0007753394923168955, - "0,1,3,4,7": -0.0011815894669506832, - "0,1,3,5,6": -0.00790331541688083, - "0,1,3,5,7": -0.009163742218194493, - "0,1,3,6,7": -0.06108604602599321, - "0,1,4,5,6": -0.016331005330674664, - "0,1,4,5,7": -0.0033040477471857344, - "0,1,4,6,7": 0.0030215237900912406, - "0,1,5,6,7": -0.2883153659615081, - "0,2,3,4,5": 0.0053346262731124305, - "0,2,3,4,6": 1.8330596308624436e-05, - "0,2,3,4,7": 0.0004679842188104466, - "0,2,3,5,6": -0.006066053008254357, - "0,2,3,5,7": 0.015347721122471292, - "0,2,3,6,7": -0.0083614598601649, - "0,2,4,5,6": 0.007078038539193088, - "0,2,4,5,7": 0.011084893382318661, - "0,2,4,6,7": 0.009025894667296086, - "0,2,5,6,7": -0.0793006816335069, - "0,3,4,5,6": 0.006758786502754965, - "0,3,4,5,7": -0.0010160758654760293, - "0,3,4,6,7": 0.0012800342339929216, - "0,3,5,6,7": 0.04545840285931435, - "0,4,5,6,7": -0.028999171620033515, - "1,2,3,4,5": -0.0038252937864156067, - "1,2,3,4,6": 0.0005886977890039446, - "1,2,3,4,7": -8.818812980315727e-05, - "1,2,3,5,6": -0.002015536682707264, - "1,2,3,5,7": 0.0007354138987190062, - "1,2,3,6,7": 0.004503676809557877, - "1,2,4,5,6": -0.0019348661633875608, - "1,2,4,5,7": -0.0006665158763317081, - "1,2,4,6,7": -0.0014483322114196007, - "1,2,5,6,7": 0.0007091039822446632, - "1,3,4,5,6": 6.24151224433156e-05, - "1,3,4,5,7": -1.9918759166515088e-06, - "1,3,4,6,7": 4.0028484622034455e-05, - "1,3,5,6,7": 0.02424094749853367, - "1,4,5,6,7": 8.262813266401992e-05, - "2,3,4,5,6": -0.0013196576832239515, - "2,3,4,5,7": 0.0007889542953769535, - "2,3,4,6,7": 0.0004442817690337719, - "2,3,5,6,7": -0.0011313345837948852, - "2,4,5,6,7": -0.00379888049291921, - "3,4,5,6,7": 0.0013085503678111898, - "0,1,2,3,4,5": 0.004739847733265634, - "0,1,2,3,4,6": -0.000547797543859474, - "0,1,2,3,4,7": -6.770616231444038e-05, - "0,1,2,3,5,6": -0.0018493791318610064, - "0,1,2,3,5,7": -0.0047934568143865874, - "0,1,2,3,6,7": 0.001305119926039655, - "0,1,2,4,5,6": -0.001152264077448173, - "0,1,2,4,5,7": 0.0012016136876944472, - "0,1,2,4,6,7": -0.003926185675097393, - "0,1,2,5,6,7": -0.023404898303483357, - "0,1,3,4,5,6": 0.002318515243286967, - "0,1,3,4,5,7": -0.0027854541920211418, - "0,1,3,4,6,7": 0.0007990834326601082, - "0,1,3,5,6,7": 0.07295658074027322, - "0,1,4,5,6,7": -0.00821730962167333, - "0,2,3,4,5,6": 0.0013597581590234498, - "0,2,3,4,5,7": 9.941130257917763e-05, - "0,2,3,4,6,7": -0.0004441686778600129, - "0,2,3,5,6,7": 0.0018112462625281545, - "0,2,4,5,6,7": -0.0062129272019548765, - "0,3,4,5,6,7": 0.003156279329737277, - "1,2,3,4,5,6": -0.0002113077880467884, - "1,2,3,4,5,7": -0.00028073989778176767, - "1,2,3,4,6,7": 7.817888971972664e-05, - "1,2,3,5,6,7": 0.002128024377817006, - "1,2,4,5,6,7": 5.500077262965419e-06, - "1,3,4,5,6,7": 5.129208650256345e-05, - "2,3,4,5,6,7": -0.0004900286876377002, - "0,1,2,3,4,5,6": 0.00017040754290320592, - "0,1,2,3,4,5,7": -0.0006084254695313263, - "0,1,2,3,4,6,7": -7.817888974726017e-05, - "0,1,2,3,5,6,7": -0.008390322693541563, - "0,1,2,4,5,6,7": 0.004173062485596013, - "0,1,3,4,5,6,7": -0.00013770353427400295, - "0,2,3,4,5,6,7": 0.0004908284569649091, - "1,2,3,4,5,6,7": 7.07747638184486e-05, - "0,1,2,3,4,5,6,7": -7.077476389305559e-05 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=SII_order=1.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=SII_order=1.json deleted file mode 100644 index 9db94df5d..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=SII_order=1.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.224661+00:00Z", - "metadata": { - "n_players": 8, - "index": "SV", - "max_order": 1, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.072184995821221 - }, - "data": { - "0": 0.25171782460956404, - "1": 0.49724787386124647, - "2": 0.06500520944389898, - "3": 0.05833923465868318, - "4": 0.022194402466152785, - "5": 1.130942443361428, - "6": 0.21431031163344444, - "7": 0.6057811263686717 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=SII_order=2.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=SII_order=2.json deleted file mode 100644 index c38c75882..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=SII_order=2.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.220574+00:00Z", - "metadata": { - "n_players": 8, - "index": "SII", - "max_order": 2, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.072184995821221 - }, - "data": { - "0": 0.25171782460956404, - "1": 0.49724787386124647, - "2": 0.06500520944389898, - "3": 0.05833923465868318, - "4": 0.022194402466152785, - "5": 1.130942443361428, - "6": 0.21431031163344444, - "7": 0.6057811263686717, - "0,1": 0.31792824855247537, - "0,2": -0.01136626832778509, - "0,3": -0.0011318219780405148, - "0,4": 0.03546966075328439, - "0,5": 0.3214991189685559, - "0,6": 0.14395103309364898, - "0,7": 0.025680921090524, - "1,2": -0.04679993437970997, - "1,3": 0.015075530383837354, - "1,4": -0.01028346570188543, - "1,5": 0.10407560569961094, - "1,6": 0.14535778179023118, - "1,7": 0.14693615268848426, - "2,3": -0.0049436241892806265, - "2,4": -0.004888611421182798, - "2,5": 0.07819297464559072, - "2,6": -0.003490945945392454, - "2,7": 0.04734995671216602, - "3,4": -0.009113704183641547, - "3,5": 0.09440254198546572, - "3,6": -0.0065878947478539285, - "3,7": -0.019139397295857785, - "4,5": -0.004731958997510555, - "4,6": -0.0010225603174927045, - "4,7": 0.00849463996186306, - "5,6": 0.028575133095404937, - "5,7": -0.33610667530458416, - "6,7": 0.31846102828503464 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=SII_order=3.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=SII_order=3.json deleted file mode 100644 index 9364798dc..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=SII_order=3.json +++ /dev/null @@ -1,112 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.220016+00:00Z", - "metadata": { - "n_players": 8, - "index": "SII", - "max_order": 3, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.072184995821221 - }, - "data": { - "0": 0.25171782460956404, - "1": 0.49724787386124647, - "2": 0.06500520944389898, - "3": 0.05833923465868318, - "4": 0.022194402466152785, - "5": 1.130942443361428, - "6": 0.21431031163344444, - "7": 0.6057811263686717, - "0,1": 0.31792824855247537, - "0,2": -0.01136626832778509, - "0,3": -0.0011318219780405148, - "0,4": 0.03546966075328439, - "0,5": 0.3214991189685559, - "0,6": 0.14395103309364898, - "0,7": 0.025680921090524, - "1,2": -0.04679993437970997, - "1,3": 0.015075530383837354, - "1,4": -0.01028346570188543, - "1,5": 0.10407560569961094, - "1,6": 0.14535778179023118, - "1,7": 0.14693615268848426, - "2,3": -0.0049436241892806265, - "2,4": -0.004888611421182798, - "2,5": 0.07819297464559072, - "2,6": -0.003490945945392454, - "2,7": 0.04734995671216602, - "3,4": -0.009113704183641547, - "3,5": 0.09440254198546572, - "3,6": -0.0065878947478539285, - "3,7": -0.019139397295857785, - "4,5": -0.004731958997510555, - "4,6": -0.0010225603174927045, - "4,7": 0.00849463996186306, - "5,6": 0.028575133095404937, - "5,7": -0.33610667530458416, - "6,7": 0.31846102828503464, - "0,1,2": -0.01831571120936748, - "0,1,3": 0.010521120947223128, - "0,1,4": 0.010361172532846297, - "0,1,5": 0.1040135055520307, - "0,1,6": 0.14181636540842402, - "0,1,7": 0.18944715371489163, - "0,2,3": 0.010347990377784777, - "0,2,4": 0.017673539389719606, - "0,2,5": -0.13408842583411595, - "0,2,6": 0.021309279112123214, - "0,2,7": -0.0826422961652864, - "0,3,4": -0.004812551869708859, - "0,3,5": 0.13146709376709176, - "0,3,6": -0.01479002618880032, - "0,3,7": -0.030256428783335343, - "0,4,5": 0.01453426978784822, - "0,4,6": -0.0059457654625518774, - "0,4,7": 0.025926716137407935, - "0,5,6": -0.0771906178902444, - "0,5,7": -0.46892131723201547, - "0,6,7": 0.1125816721480346, - "1,2,3": -0.012078836273108351, - "1,2,4": 0.003714938017095104, - "1,2,5": 0.08310784164704299, - "1,2,6": -0.007572114955466613, - "1,2,7": 0.007653971586732533, - "1,3,4": -0.005890133081621007, - "1,3,5": 0.035753261068938835, - "1,3,6": -0.005704389939261478, - "1,3,7": -0.01808841451260501, - "1,4,5": -0.04900046155184756, - "1,4,6": 0.003706866958111066, - "1,4,7": 0.00503310312702987, - "1,5,6": 0.014402390691089506, - "1,5,7": -0.1444801239758966, - "1,6,7": 0.15257477333632607, - "2,3,4": -0.0016140825821560068, - "2,3,5": -0.0031416930376553243, - "2,3,6": 0.0027769014296976646, - "2,3,7": 0.0015669582877777533, - "2,4,5": -0.020819056254380852, - "2,4,6": -0.00011268776717221485, - "2,4,7": 0.00013674919042094835, - "2,5,6": 0.009133627332542193, - "2,5,7": 0.05141740871485578, - "2,6,7": 0.029578054846731705, - "3,4,5": -0.01447948633555507, - "3,4,6": 0.006144712079016124, - "3,4,7": -0.00019582347285251878, - "3,5,6": 0.04327751955427184, - "3,5,7": 0.027535737005543348, - "3,6,7": -0.0035321148600515606, - "4,5,6": -0.03169870725787849, - "4,5,7": -0.03139068607029771, - "4,6,7": 0.009240019234687313, - "5,6,7": -0.32023949350378533 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=SII_order=4.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=SII_order=4.json deleted file mode 100644 index 73374b4ba..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=SII_order=4.json +++ /dev/null @@ -1,182 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.231195+00:00Z", - "metadata": { - "n_players": 8, - "index": "SII", - "max_order": 4, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.072184995821221 - }, - "data": { - "0": 0.25171782460956404, - "1": 0.49724787386124647, - "2": 0.06500520944389898, - "3": 0.05833923465868318, - "4": 0.022194402466152785, - "5": 1.130942443361428, - "6": 0.21431031163344444, - "7": 0.6057811263686717, - "0,1": 0.31792824855247537, - "0,2": -0.01136626832778509, - "0,3": -0.0011318219780405148, - "0,4": 0.03546966075328439, - "0,5": 0.3214991189685559, - "0,6": 0.14395103309364898, - "0,7": 0.025680921090524, - "1,2": -0.04679993437970997, - "1,3": 0.015075530383837354, - "1,4": -0.01028346570188543, - "1,5": 0.10407560569961094, - "1,6": 0.14535778179023118, - "1,7": 0.14693615268848426, - "2,3": -0.0049436241892806265, - "2,4": -0.004888611421182798, - "2,5": 0.07819297464559072, - "2,6": -0.003490945945392454, - "2,7": 0.04734995671216602, - "3,4": -0.009113704183641547, - "3,5": 0.09440254198546572, - "3,6": -0.0065878947478539285, - "3,7": -0.019139397295857785, - "4,5": -0.004731958997510555, - "4,6": -0.0010225603174927045, - "4,7": 0.00849463996186306, - "5,6": 0.028575133095404937, - "5,7": -0.33610667530458416, - "6,7": 0.31846102828503464, - "0,1,2": -0.01831571120936748, - "0,1,3": 0.010521120947223128, - "0,1,4": 0.010361172532846297, - "0,1,5": 0.1040135055520307, - "0,1,6": 0.14181636540842402, - "0,1,7": 0.18944715371489163, - "0,2,3": 0.010347990377784777, - "0,2,4": 0.017673539389719606, - "0,2,5": -0.13408842583411595, - "0,2,6": 0.021309279112123214, - "0,2,7": -0.0826422961652864, - "0,3,4": -0.004812551869708859, - "0,3,5": 0.13146709376709176, - "0,3,6": -0.01479002618880032, - "0,3,7": -0.030256428783335343, - "0,4,5": 0.01453426978784822, - "0,4,6": -0.0059457654625518774, - "0,4,7": 0.025926716137407935, - "0,5,6": -0.0771906178902444, - "0,5,7": -0.46892131723201547, - "0,6,7": 0.1125816721480346, - "1,2,3": -0.012078836273108351, - "1,2,4": 0.003714938017095104, - "1,2,5": 0.08310784164704299, - "1,2,6": -0.007572114955466613, - "1,2,7": 0.007653971586732533, - "1,3,4": -0.005890133081621007, - "1,3,5": 0.035753261068938835, - "1,3,6": -0.005704389939261478, - "1,3,7": -0.01808841451260501, - "1,4,5": -0.04900046155184756, - "1,4,6": 0.003706866958111066, - "1,4,7": 0.00503310312702987, - "1,5,6": 0.014402390691089506, - "1,5,7": -0.1444801239758966, - "1,6,7": 0.15257477333632607, - "2,3,4": -0.0016140825821560068, - "2,3,5": -0.0031416930376553243, - "2,3,6": 0.0027769014296976646, - "2,3,7": 0.0015669582877777533, - "2,4,5": -0.020819056254380852, - "2,4,6": -0.00011268776717221485, - "2,4,7": 0.00013674919042094835, - "2,5,6": 0.009133627332542193, - "2,5,7": 0.05141740871485578, - "2,6,7": 0.029578054846731705, - "3,4,5": -0.01447948633555507, - "3,4,6": 0.006144712079016124, - "3,4,7": -0.00019582347285251878, - "3,5,6": 0.04327751955427184, - "3,5,7": 0.027535737005543348, - "3,6,7": -0.0035321148600515606, - "4,5,6": -0.03169870725787849, - "4,5,7": -0.03139068607029771, - "4,6,7": 0.009240019234687313, - "5,6,7": -0.32023949350378533, - "0,1,2,3": 0.019955244677778428, - "0,1,2,4": 0.009092043882777512, - "0,1,2,5": 0.07181098513756501, - "0,1,2,6": 0.009938479199153027, - "0,1,2,7": 0.0061027552507348926, - "0,1,3,4": -0.004383548843306717, - "0,1,3,5": 0.07420826159609117, - "0,1,3,6": -0.014369391835438727, - "0,1,3,7": -0.03152319644735879, - "0,1,4,5": -0.018207776180018342, - "0,1,4,6": -0.0016137112411539478, - "0,1,4,7": 0.011136610961364535, - "0,1,5,6": -0.013029734698287276, - "0,1,5,7": -0.17078601703917307, - "0,1,6,7": 0.20079440495811463, - "0,2,3,4": 0.005278533343863301, - "0,2,3,5": 0.01574509040077887, - "0,2,3,6": -0.005270183771403647, - "0,2,3,7": -0.0025626839796658585, - "0,2,4,5": 0.028938565136177652, - "0,2,4,6": 0.007715414090033623, - "0,2,4,7": 0.008231113172855076, - "0,2,5,6": -0.07054151531026132, - "0,2,5,7": -0.15490870870358497, - "0,2,6,7": -0.03423413129518127, - "0,3,4,5": -0.006321724966334097, - "0,3,4,6": 0.008280663144013323, - "0,3,4,7": -0.0011277301314207566, - "0,3,5,6": 0.02685764580876948, - "0,3,5,7": 0.06030999014473015, - "0,3,6,7": -0.010772587629845676, - "0,4,5,6": -0.03776838816483585, - "0,4,5,7": -0.0184160205078443, - "0,4,6,7": 0.007662350397146134, - "0,5,6,7": -0.4064306290869213, - "1,2,3,4": -0.001977815112278347, - "1,2,3,5": 0.002338601522094863, - "1,2,3,6": -0.00017976881825443325, - "1,2,3,7": 0.00864171786670076, - "1,2,4,5": 0.001561155373870915, - "1,2,4,6": -0.0010394056308075106, - "1,2,4,7": -1.9830361935979646e-05, - "1,2,5,6": -0.00190960025886866, - "1,2,5,7": 0.0005194104833342594, - "1,2,6,7": 0.0020982191653892146, - "1,3,4,5": -0.009239946732786275, - "1,3,4,6": 0.0004367484917590092, - "1,3,4,7": -0.0006620866738703546, - "1,3,5,6": 0.030111903498860504, - "1,3,5,7": 0.05045989200692669, - "1,3,6,7": -0.008255250250247648, - "1,4,5,6": -0.011743851697420093, - "1,4,5,7": -0.0070995646809189905, - "1,4,6,7": 0.000350206361501626, - "1,5,6,7": -0.18275146303322853, - "2,3,4,5": -0.003737647661951171, - "2,3,4,6": -0.00012933656421842965, - "2,3,4,7": 8.055674370777144e-05, - "2,3,5,6": -0.0001754566164225979, - "2,3,5,7": -0.011511195887209724, - "2,3,6,7": 0.005928652546784874, - "2,4,5,6": -0.00805092708520283, - "2,4,5,7": -0.014289651466241282, - "2,4,6,7": 0.001619507875127435, - "2,5,6,7": 0.0012539172754658656, - "3,4,5,6": 0.007069758889350575, - "3,4,5,7": -0.0011819021579521083, - "3,4,6,7": 0.0028787495962846466, - "3,5,6,7": 0.07520826805354297, - "4,5,6,7": -0.023243504974219675 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=SII_order=5.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=SII_order=5.json deleted file mode 100644 index 3805c0050..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=SII_order=5.json +++ /dev/null @@ -1,238 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.230377+00:00Z", - "metadata": { - "n_players": 8, - "index": "SII", - "max_order": 5, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.072184995821221 - }, - "data": { - "0": 0.25171782460956404, - "1": 0.49724787386124647, - "2": 0.06500520944389898, - "3": 0.05833923465868318, - "4": 0.022194402466152785, - "5": 1.130942443361428, - "6": 0.21431031163344444, - "7": 0.6057811263686717, - "0,1": 0.31792824855247537, - "0,2": -0.01136626832778509, - "0,3": -0.0011318219780405148, - "0,4": 0.03546966075328439, - "0,5": 0.3214991189685559, - "0,6": 0.14395103309364898, - "0,7": 0.025680921090524, - "1,2": -0.04679993437970997, - "1,3": 0.015075530383837354, - "1,4": -0.01028346570188543, - "1,5": 0.10407560569961094, - "1,6": 0.14535778179023118, - "1,7": 0.14693615268848426, - "2,3": -0.0049436241892806265, - "2,4": -0.004888611421182798, - "2,5": 0.07819297464559072, - "2,6": -0.003490945945392454, - "2,7": 0.04734995671216602, - "3,4": -0.009113704183641547, - "3,5": 0.09440254198546572, - "3,6": -0.0065878947478539285, - "3,7": -0.019139397295857785, - "4,5": -0.004731958997510555, - "4,6": -0.0010225603174927045, - "4,7": 0.00849463996186306, - "5,6": 0.028575133095404937, - "5,7": -0.33610667530458416, - "6,7": 0.31846102828503464, - "0,1,2": -0.01831571120936748, - "0,1,3": 0.010521120947223128, - "0,1,4": 0.010361172532846297, - "0,1,5": 0.1040135055520307, - "0,1,6": 0.14181636540842402, - "0,1,7": 0.18944715371489163, - "0,2,3": 0.010347990377784777, - "0,2,4": 0.017673539389719606, - "0,2,5": -0.13408842583411595, - "0,2,6": 0.021309279112123214, - "0,2,7": -0.0826422961652864, - "0,3,4": -0.004812551869708859, - "0,3,5": 0.13146709376709176, - "0,3,6": -0.01479002618880032, - "0,3,7": -0.030256428783335343, - "0,4,5": 0.01453426978784822, - "0,4,6": -0.0059457654625518774, - "0,4,7": 0.025926716137407935, - "0,5,6": -0.0771906178902444, - "0,5,7": -0.46892131723201547, - "0,6,7": 0.1125816721480346, - "1,2,3": -0.012078836273108351, - "1,2,4": 0.003714938017095104, - "1,2,5": 0.08310784164704299, - "1,2,6": -0.007572114955466613, - "1,2,7": 0.007653971586732533, - "1,3,4": -0.005890133081621007, - "1,3,5": 0.035753261068938835, - "1,3,6": -0.005704389939261478, - "1,3,7": -0.01808841451260501, - "1,4,5": -0.04900046155184756, - "1,4,6": 0.003706866958111066, - "1,4,7": 0.00503310312702987, - "1,5,6": 0.014402390691089506, - "1,5,7": -0.1444801239758966, - "1,6,7": 0.15257477333632607, - "2,3,4": -0.0016140825821560068, - "2,3,5": -0.0031416930376553243, - "2,3,6": 0.0027769014296976646, - "2,3,7": 0.0015669582877777533, - "2,4,5": -0.020819056254380852, - "2,4,6": -0.00011268776717221485, - "2,4,7": 0.00013674919042094835, - "2,5,6": 0.009133627332542193, - "2,5,7": 0.05141740871485578, - "2,6,7": 0.029578054846731705, - "3,4,5": -0.01447948633555507, - "3,4,6": 0.006144712079016124, - "3,4,7": -0.00019582347285251878, - "3,5,6": 0.04327751955427184, - "3,5,7": 0.027535737005543348, - "3,6,7": -0.0035321148600515606, - "4,5,6": -0.03169870725787849, - "4,5,7": -0.03139068607029771, - "4,6,7": 0.009240019234687313, - "5,6,7": -0.32023949350378533, - "0,1,2,3": 0.019955244677778428, - "0,1,2,4": 0.009092043882777512, - "0,1,2,5": 0.07181098513756501, - "0,1,2,6": 0.009938479199153027, - "0,1,2,7": 0.0061027552507348926, - "0,1,3,4": -0.004383548843306717, - "0,1,3,5": 0.07420826159609117, - "0,1,3,6": -0.014369391835438727, - "0,1,3,7": -0.03152319644735879, - "0,1,4,5": -0.018207776180018342, - "0,1,4,6": -0.0016137112411539478, - "0,1,4,7": 0.011136610961364535, - "0,1,5,6": -0.013029734698287276, - "0,1,5,7": -0.17078601703917307, - "0,1,6,7": 0.20079440495811463, - "0,2,3,4": 0.005278533343863301, - "0,2,3,5": 0.01574509040077887, - "0,2,3,6": -0.005270183771403647, - "0,2,3,7": -0.0025626839796658585, - "0,2,4,5": 0.028938565136177652, - "0,2,4,6": 0.007715414090033623, - "0,2,4,7": 0.008231113172855076, - "0,2,5,6": -0.07054151531026132, - "0,2,5,7": -0.15490870870358497, - "0,2,6,7": -0.03423413129518127, - "0,3,4,5": -0.006321724966334097, - "0,3,4,6": 0.008280663144013323, - "0,3,4,7": -0.0011277301314207566, - "0,3,5,6": 0.02685764580876948, - "0,3,5,7": 0.06030999014473015, - "0,3,6,7": -0.010772587629845676, - "0,4,5,6": -0.03776838816483585, - "0,4,5,7": -0.0184160205078443, - "0,4,6,7": 0.007662350397146134, - "0,5,6,7": -0.4064306290869213, - "1,2,3,4": -0.001977815112278347, - "1,2,3,5": 0.002338601522094863, - "1,2,3,6": -0.00017976881825443325, - "1,2,3,7": 0.00864171786670076, - "1,2,4,5": 0.001561155373870915, - "1,2,4,6": -0.0010394056308075106, - "1,2,4,7": -1.9830361935979646e-05, - "1,2,5,6": -0.00190960025886866, - "1,2,5,7": 0.0005194104833342594, - "1,2,6,7": 0.0020982191653892146, - "1,3,4,5": -0.009239946732786275, - "1,3,4,6": 0.0004367484917590092, - "1,3,4,7": -0.0006620866738703546, - "1,3,5,6": 0.030111903498860504, - "1,3,5,7": 0.05045989200692669, - "1,3,6,7": -0.008255250250247648, - "1,4,5,6": -0.011743851697420093, - "1,4,5,7": -0.0070995646809189905, - "1,4,6,7": 0.000350206361501626, - "1,5,6,7": -0.18275146303322853, - "2,3,4,5": -0.003737647661951171, - "2,3,4,6": -0.00012933656421842965, - "2,3,4,7": 8.055674370777144e-05, - "2,3,5,6": -0.0001754566164225979, - "2,3,5,7": -0.011511195887209724, - "2,3,6,7": 0.005928652546784874, - "2,4,5,6": -0.00805092708520283, - "2,4,5,7": -0.014289651466241282, - "2,4,6,7": 0.001619507875127435, - "2,5,6,7": 0.0012539172754658656, - "3,4,5,6": 0.007069758889350575, - "3,4,5,7": -0.0011819021579521083, - "3,4,6,7": 0.0028787495962846466, - "3,5,6,7": 0.07520826805354297, - "4,5,6,7": -0.023243504974219675, - "0,1,2,3,4": 0.0043109476294724836, - "0,1,2,3,5": -0.0037398328268727354, - "0,1,2,3,6": 0.0029842280082932326, - "0,1,2,3,7": -0.012210987057918121, - "0,1,2,4,5": 0.010903243343854285, - "0,1,2,4,6": -0.0005383068391533463, - "0,1,2,4,7": 0.004163262908381871, - "0,1,2,5,6": 8.822737021985105e-05, - "0,1,2,5,7": -0.02854763177331332, - "0,1,2,6,7": 0.02729266600222857, - "0,1,3,4,5": -0.006757393277884383, - "0,1,3,4,6": 0.0020273880737033956, - "0,1,3,4,7": -0.0025010909165885664, - "0,1,3,5,6": 0.026005976423050026, - "0,1,3,5,7": 0.020461915058676006, - "0,1,3,6,7": -0.026442082706637393, - "0,1,4,5,6": -0.01847230608480377, - "0,1,4,5,7": -0.007080005340538431, - "0,1,4,6,7": -0.0013493158123898397, - "0,1,5,6,7": -0.26911752782564546, - "0,2,3,4,5": 0.00843404468971043, - "0,2,3,4,6": 0.0003788852440558266, - "0,2,3,4,7": 0.00017880012496274134, - "0,2,3,5,6": -0.007999296285578605, - "0,2,3,5,7": 0.011052654571517717, - "0,2,3,6,7": -0.009702279171197148, - "0,2,4,5,6": 0.005669061116536422, - "0,2,4,5,7": 0.009963070409873875, - "0,2,4,6,7": 0.005245130883162252, - "0,2,5,6,7": -0.0944638088629075, - "0,3,4,5,6": 0.010332879999694233, - "0,3,4,5,7": -0.0008837515185522449, - "0,3,4,6,7": 0.0031095862629686444, - "0,3,5,6,7": 0.08172369641102262, - "0,4,5,6,7": -0.03314511492183714, - "1,2,3,4,5": -0.0018415018412487605, - "1,2,3,4,6": 0.0002848753492941114, - "1,2,3,4,7": -0.00044629193774659015, - "1,2,3,5,6": -0.004715941773637766, - "1,2,3,5,7": -0.003731357092481513, - "1,2,3,6,7": 0.0034424024422539112, - "1,2,4,5,6": -0.001160180817689982, - "1,2,4,5,7": 0.0009907812929410564, - "1,2,4,6,7": -0.001998726469862877, - "1,2,5,6,7": -0.01132643844761616, - "1,3,4,5,6": 0.0011584641265134366, - "1,3,4,5,7": -0.0017522546485015944, - "1,3,4,6,7": 0.00043824277806070455, - "1,3,5,6,7": 0.058972118588555666, - "1,4,5,6,7": -0.0026466130488662643, - "2,3,4,5,6": -0.0007641369446038659, - "2,3,4,5,7": 0.00041997454677389356, - "2,3,4,6,7": 0.0001597202838858891, - "2,3,5,6,7": -0.00203398045596348, - "2,4,5,6,7": -0.005587080187909432, - "3,4,5,6,7": 0.0027909279366715722 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=SII_order=6.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=SII_order=6.json deleted file mode 100644 index e6f0bb794..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=SII_order=6.json +++ /dev/null @@ -1,266 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.238340+00:00Z", - "metadata": { - "n_players": 8, - "index": "SII", - "max_order": 6, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.072184995821221 - }, - "data": { - "0": 0.25171782460956404, - "1": 0.49724787386124647, - "2": 0.06500520944389898, - "3": 0.05833923465868318, - "4": 0.022194402466152785, - "5": 1.130942443361428, - "6": 0.21431031163344444, - "7": 0.6057811263686717, - "0,1": 0.31792824855247537, - "0,2": -0.01136626832778509, - "0,3": -0.0011318219780405148, - "0,4": 0.03546966075328439, - "0,5": 0.3214991189685559, - "0,6": 0.14395103309364898, - "0,7": 0.025680921090524, - "1,2": -0.04679993437970997, - "1,3": 0.015075530383837354, - "1,4": -0.01028346570188543, - "1,5": 0.10407560569961094, - "1,6": 0.14535778179023118, - "1,7": 0.14693615268848426, - "2,3": -0.0049436241892806265, - "2,4": -0.004888611421182798, - "2,5": 0.07819297464559072, - "2,6": -0.003490945945392454, - "2,7": 0.04734995671216602, - "3,4": -0.009113704183641547, - "3,5": 0.09440254198546572, - "3,6": -0.0065878947478539285, - "3,7": -0.019139397295857785, - "4,5": -0.004731958997510555, - "4,6": -0.0010225603174927045, - "4,7": 0.00849463996186306, - "5,6": 0.028575133095404937, - "5,7": -0.33610667530458416, - "6,7": 0.31846102828503464, - "0,1,2": -0.01831571120936748, - "0,1,3": 0.010521120947223128, - "0,1,4": 0.010361172532846297, - "0,1,5": 0.1040135055520307, - "0,1,6": 0.14181636540842402, - "0,1,7": 0.18944715371489163, - "0,2,3": 0.010347990377784777, - "0,2,4": 0.017673539389719606, - "0,2,5": -0.13408842583411595, - "0,2,6": 0.021309279112123214, - "0,2,7": -0.0826422961652864, - "0,3,4": -0.004812551869708859, - "0,3,5": 0.13146709376709176, - "0,3,6": -0.01479002618880032, - "0,3,7": -0.030256428783335343, - "0,4,5": 0.01453426978784822, - "0,4,6": -0.0059457654625518774, - "0,4,7": 0.025926716137407935, - "0,5,6": -0.0771906178902444, - "0,5,7": -0.46892131723201547, - "0,6,7": 0.1125816721480346, - "1,2,3": -0.012078836273108351, - "1,2,4": 0.003714938017095104, - "1,2,5": 0.08310784164704299, - "1,2,6": -0.007572114955466613, - "1,2,7": 0.007653971586732533, - "1,3,4": -0.005890133081621007, - "1,3,5": 0.035753261068938835, - "1,3,6": -0.005704389939261478, - "1,3,7": -0.01808841451260501, - "1,4,5": -0.04900046155184756, - "1,4,6": 0.003706866958111066, - "1,4,7": 0.00503310312702987, - "1,5,6": 0.014402390691089506, - "1,5,7": -0.1444801239758966, - "1,6,7": 0.15257477333632607, - "2,3,4": -0.0016140825821560068, - "2,3,5": -0.0031416930376553243, - "2,3,6": 0.0027769014296976646, - "2,3,7": 0.0015669582877777533, - "2,4,5": -0.020819056254380852, - "2,4,6": -0.00011268776717221485, - "2,4,7": 0.00013674919042094835, - "2,5,6": 0.009133627332542193, - "2,5,7": 0.05141740871485578, - "2,6,7": 0.029578054846731705, - "3,4,5": -0.01447948633555507, - "3,4,6": 0.006144712079016124, - "3,4,7": -0.00019582347285251878, - "3,5,6": 0.04327751955427184, - "3,5,7": 0.027535737005543348, - "3,6,7": -0.0035321148600515606, - "4,5,6": -0.03169870725787849, - "4,5,7": -0.03139068607029771, - "4,6,7": 0.009240019234687313, - "5,6,7": -0.32023949350378533, - "0,1,2,3": 0.019955244677778428, - "0,1,2,4": 0.009092043882777512, - "0,1,2,5": 0.07181098513756501, - "0,1,2,6": 0.009938479199153027, - "0,1,2,7": 0.0061027552507348926, - "0,1,3,4": -0.004383548843306717, - "0,1,3,5": 0.07420826159609117, - "0,1,3,6": -0.014369391835438727, - "0,1,3,7": -0.03152319644735879, - "0,1,4,5": -0.018207776180018342, - "0,1,4,6": -0.0016137112411539478, - "0,1,4,7": 0.011136610961364535, - "0,1,5,6": -0.013029734698287276, - "0,1,5,7": -0.17078601703917307, - "0,1,6,7": 0.20079440495811463, - "0,2,3,4": 0.005278533343863301, - "0,2,3,5": 0.01574509040077887, - "0,2,3,6": -0.005270183771403647, - "0,2,3,7": -0.0025626839796658585, - "0,2,4,5": 0.028938565136177652, - "0,2,4,6": 0.007715414090033623, - "0,2,4,7": 0.008231113172855076, - "0,2,5,6": -0.07054151531026132, - "0,2,5,7": -0.15490870870358497, - "0,2,6,7": -0.03423413129518127, - "0,3,4,5": -0.006321724966334097, - "0,3,4,6": 0.008280663144013323, - "0,3,4,7": -0.0011277301314207566, - "0,3,5,6": 0.02685764580876948, - "0,3,5,7": 0.06030999014473015, - "0,3,6,7": -0.010772587629845676, - "0,4,5,6": -0.03776838816483585, - "0,4,5,7": -0.0184160205078443, - "0,4,6,7": 0.007662350397146134, - "0,5,6,7": -0.4064306290869213, - "1,2,3,4": -0.001977815112278347, - "1,2,3,5": 0.002338601522094863, - "1,2,3,6": -0.00017976881825443325, - "1,2,3,7": 0.00864171786670076, - "1,2,4,5": 0.001561155373870915, - "1,2,4,6": -0.0010394056308075106, - "1,2,4,7": -1.9830361935979646e-05, - "1,2,5,6": -0.00190960025886866, - "1,2,5,7": 0.0005194104833342594, - "1,2,6,7": 0.0020982191653892146, - "1,3,4,5": -0.009239946732786275, - "1,3,4,6": 0.0004367484917590092, - "1,3,4,7": -0.0006620866738703546, - "1,3,5,6": 0.030111903498860504, - "1,3,5,7": 0.05045989200692669, - "1,3,6,7": -0.008255250250247648, - "1,4,5,6": -0.011743851697420093, - "1,4,5,7": -0.0070995646809189905, - "1,4,6,7": 0.000350206361501626, - "1,5,6,7": -0.18275146303322853, - "2,3,4,5": -0.003737647661951171, - "2,3,4,6": -0.00012933656421842965, - "2,3,4,7": 8.055674370777144e-05, - "2,3,5,6": -0.0001754566164225979, - "2,3,5,7": -0.011511195887209724, - "2,3,6,7": 0.005928652546784874, - "2,4,5,6": -0.00805092708520283, - "2,4,5,7": -0.014289651466241282, - "2,4,6,7": 0.001619507875127435, - "2,5,6,7": 0.0012539172754658656, - "3,4,5,6": 0.007069758889350575, - "3,4,5,7": -0.0011819021579521083, - "3,4,6,7": 0.0028787495962846466, - "3,5,6,7": 0.07520826805354297, - "4,5,6,7": -0.023243504974219675, - "0,1,2,3,4": 0.0043109476294724836, - "0,1,2,3,5": -0.0037398328268727354, - "0,1,2,3,6": 0.0029842280082932326, - "0,1,2,3,7": -0.012210987057918121, - "0,1,2,4,5": 0.010903243343854285, - "0,1,2,4,6": -0.0005383068391533463, - "0,1,2,4,7": 0.004163262908381871, - "0,1,2,5,6": 8.822737021985105e-05, - "0,1,2,5,7": -0.02854763177331332, - "0,1,2,6,7": 0.02729266600222857, - "0,1,3,4,5": -0.006757393277884383, - "0,1,3,4,6": 0.0020273880737033956, - "0,1,3,4,7": -0.0025010909165885664, - "0,1,3,5,6": 0.026005976423050026, - "0,1,3,5,7": 0.020461915058676006, - "0,1,3,6,7": -0.026442082706637393, - "0,1,4,5,6": -0.01847230608480377, - "0,1,4,5,7": -0.007080005340538431, - "0,1,4,6,7": -0.0013493158123898397, - "0,1,5,6,7": -0.26911752782564546, - "0,2,3,4,5": 0.00843404468971043, - "0,2,3,4,6": 0.0003788852440558266, - "0,2,3,4,7": 0.00017880012496274134, - "0,2,3,5,6": -0.007999296285578605, - "0,2,3,5,7": 0.011052654571517717, - "0,2,3,6,7": -0.009702279171197148, - "0,2,4,5,6": 0.005669061116536422, - "0,2,4,5,7": 0.009963070409873875, - "0,2,4,6,7": 0.005245130883162252, - "0,2,5,6,7": -0.0944638088629075, - "0,3,4,5,6": 0.010332879999694233, - "0,3,4,5,7": -0.0008837515185522449, - "0,3,4,6,7": 0.0031095862629686444, - "0,3,5,6,7": 0.08172369641102262, - "0,4,5,6,7": -0.03314511492183714, - "1,2,3,4,5": -0.0018415018412487605, - "1,2,3,4,6": 0.0002848753492941114, - "1,2,3,4,7": -0.00044629193774659015, - "1,2,3,5,6": -0.004715941773637766, - "1,2,3,5,7": -0.003731357092481513, - "1,2,3,6,7": 0.0034424024422539112, - "1,2,4,5,6": -0.001160180817689982, - "1,2,4,5,7": 0.0009907812929410564, - "1,2,4,6,7": -0.001998726469862877, - "1,2,5,6,7": -0.01132643844761616, - "1,3,4,5,6": 0.0011584641265134366, - "1,3,4,5,7": -0.0017522546485015944, - "1,3,4,6,7": 0.00043824277806070455, - "1,3,5,6,7": 0.058972118588555666, - "1,4,5,6,7": -0.0026466130488662643, - "2,3,4,5,6": -0.0007641369446038659, - "2,3,4,5,7": 0.00041997454677389356, - "2,3,4,6,7": 0.0001597202838858891, - "2,3,5,6,7": -0.00203398045596348, - "2,4,5,6,7": -0.005587080187909432, - "3,4,5,6,7": 0.0027909279366715722, - "0,1,2,3,4,5": 0.004497247182012387, - "0,1,2,3,4,6": -0.0005252748052164691, - "0,1,2,3,4,7": -0.00043459992988914564, - "0,1,2,3,5,6": -0.0059829282951078255, - "0,1,2,3,5,7": -0.009316422483857778, - "0,1,2,3,6,7": -0.002952722453532175, - "0,1,2,4,5,6": 0.0009958793488569206, - "0,1,2,4,5,7": 0.002960340607792933, - "0,1,2,4,6,7": -0.001902335465107985, - "0,1,2,5,6,7": -0.025537119995397095, - "0,1,3,4,5,6": 0.0023112756596617157, - "0,1,3,4,5,7": -0.003182110281861883, - "0,1,3,4,6,7": 0.0006675506327218361, - "0,1,3,5,6,7": 0.06866897603842959, - "0,1,4,5,6,7": -0.006223221733959283, - "0,2,3,4,5,6": 0.0016667845710240936, - "0,2,3,4,5,7": 1.702120835900267e-05, - "0,2,3,4,6,7": -0.00026143548218438006, - "0,2,3,5,6,7": -0.0021620924436958067, - "0,2,4,5,6,7": -0.003904573318612714, - "0,3,4,5,6,7": 0.0033092502031490945, - "1,2,3,4,5,6": -0.00011430822262381568, - "1,2,3,4,5,7": -0.000573156838571176, - "1,2,3,4,6,7": 5.088523883545193e-05, - "1,2,3,5,6,7": -0.0020553411749708594, - "1,2,4,5,6,7": 0.0021038271140310094, - "1,3,4,5,6,7": -5.763886646636962e-06, - "2,3,4,5,6,7": -0.00023281866517299576 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=SII_order=7.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=SII_order=7.json deleted file mode 100644 index 3b6f5a99b..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=SII_order=7.json +++ /dev/null @@ -1,274 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.239138+00:00Z", - "metadata": { - "n_players": 8, - "index": "SII", - "max_order": 7, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.072184995821221 - }, - "data": { - "0": 0.25171782460956404, - "1": 0.49724787386124647, - "2": 0.06500520944389898, - "3": 0.05833923465868318, - "4": 0.022194402466152785, - "5": 1.130942443361428, - "6": 0.21431031163344444, - "7": 0.6057811263686717, - "0,1": 0.31792824855247537, - "0,2": -0.01136626832778509, - "0,3": -0.0011318219780405148, - "0,4": 0.03546966075328439, - "0,5": 0.3214991189685559, - "0,6": 0.14395103309364898, - "0,7": 0.025680921090524, - "1,2": -0.04679993437970997, - "1,3": 0.015075530383837354, - "1,4": -0.01028346570188543, - "1,5": 0.10407560569961094, - "1,6": 0.14535778179023118, - "1,7": 0.14693615268848426, - "2,3": -0.0049436241892806265, - "2,4": -0.004888611421182798, - "2,5": 0.07819297464559072, - "2,6": -0.003490945945392454, - "2,7": 0.04734995671216602, - "3,4": -0.009113704183641547, - "3,5": 0.09440254198546572, - "3,6": -0.0065878947478539285, - "3,7": -0.019139397295857785, - "4,5": -0.004731958997510555, - "4,6": -0.0010225603174927045, - "4,7": 0.00849463996186306, - "5,6": 0.028575133095404937, - "5,7": -0.33610667530458416, - "6,7": 0.31846102828503464, - "0,1,2": -0.01831571120936748, - "0,1,3": 0.010521120947223128, - "0,1,4": 0.010361172532846297, - "0,1,5": 0.1040135055520307, - "0,1,6": 0.14181636540842402, - "0,1,7": 0.18944715371489163, - "0,2,3": 0.010347990377784777, - "0,2,4": 0.017673539389719606, - "0,2,5": -0.13408842583411595, - "0,2,6": 0.021309279112123214, - "0,2,7": -0.0826422961652864, - "0,3,4": -0.004812551869708859, - "0,3,5": 0.13146709376709176, - "0,3,6": -0.01479002618880032, - "0,3,7": -0.030256428783335343, - "0,4,5": 0.01453426978784822, - "0,4,6": -0.0059457654625518774, - "0,4,7": 0.025926716137407935, - "0,5,6": -0.0771906178902444, - "0,5,7": -0.46892131723201547, - "0,6,7": 0.1125816721480346, - "1,2,3": -0.012078836273108351, - "1,2,4": 0.003714938017095104, - "1,2,5": 0.08310784164704299, - "1,2,6": -0.007572114955466613, - "1,2,7": 0.007653971586732533, - "1,3,4": -0.005890133081621007, - "1,3,5": 0.035753261068938835, - "1,3,6": -0.005704389939261478, - "1,3,7": -0.01808841451260501, - "1,4,5": -0.04900046155184756, - "1,4,6": 0.003706866958111066, - "1,4,7": 0.00503310312702987, - "1,5,6": 0.014402390691089506, - "1,5,7": -0.1444801239758966, - "1,6,7": 0.15257477333632607, - "2,3,4": -0.0016140825821560068, - "2,3,5": -0.0031416930376553243, - "2,3,6": 0.0027769014296976646, - "2,3,7": 0.0015669582877777533, - "2,4,5": -0.020819056254380852, - "2,4,6": -0.00011268776717221485, - "2,4,7": 0.00013674919042094835, - "2,5,6": 0.009133627332542193, - "2,5,7": 0.05141740871485578, - "2,6,7": 0.029578054846731705, - "3,4,5": -0.01447948633555507, - "3,4,6": 0.006144712079016124, - "3,4,7": -0.00019582347285251878, - "3,5,6": 0.04327751955427184, - "3,5,7": 0.027535737005543348, - "3,6,7": -0.0035321148600515606, - "4,5,6": -0.03169870725787849, - "4,5,7": -0.03139068607029771, - "4,6,7": 0.009240019234687313, - "5,6,7": -0.32023949350378533, - "0,1,2,3": 0.019955244677778428, - "0,1,2,4": 0.009092043882777512, - "0,1,2,5": 0.07181098513756501, - "0,1,2,6": 0.009938479199153027, - "0,1,2,7": 0.0061027552507348926, - "0,1,3,4": -0.004383548843306717, - "0,1,3,5": 0.07420826159609117, - "0,1,3,6": -0.014369391835438727, - "0,1,3,7": -0.03152319644735879, - "0,1,4,5": -0.018207776180018342, - "0,1,4,6": -0.0016137112411539478, - "0,1,4,7": 0.011136610961364535, - "0,1,5,6": -0.013029734698287276, - "0,1,5,7": -0.17078601703917307, - "0,1,6,7": 0.20079440495811463, - "0,2,3,4": 0.005278533343863301, - "0,2,3,5": 0.01574509040077887, - "0,2,3,6": -0.005270183771403647, - "0,2,3,7": -0.0025626839796658585, - "0,2,4,5": 0.028938565136177652, - "0,2,4,6": 0.007715414090033623, - "0,2,4,7": 0.008231113172855076, - "0,2,5,6": -0.07054151531026132, - "0,2,5,7": -0.15490870870358497, - "0,2,6,7": -0.03423413129518127, - "0,3,4,5": -0.006321724966334097, - "0,3,4,6": 0.008280663144013323, - "0,3,4,7": -0.0011277301314207566, - "0,3,5,6": 0.02685764580876948, - "0,3,5,7": 0.06030999014473015, - "0,3,6,7": -0.010772587629845676, - "0,4,5,6": -0.03776838816483585, - "0,4,5,7": -0.0184160205078443, - "0,4,6,7": 0.007662350397146134, - "0,5,6,7": -0.4064306290869213, - "1,2,3,4": -0.001977815112278347, - "1,2,3,5": 0.002338601522094863, - "1,2,3,6": -0.00017976881825443325, - "1,2,3,7": 0.00864171786670076, - "1,2,4,5": 0.001561155373870915, - "1,2,4,6": -0.0010394056308075106, - "1,2,4,7": -1.9830361935979646e-05, - "1,2,5,6": -0.00190960025886866, - "1,2,5,7": 0.0005194104833342594, - "1,2,6,7": 0.0020982191653892146, - "1,3,4,5": -0.009239946732786275, - "1,3,4,6": 0.0004367484917590092, - "1,3,4,7": -0.0006620866738703546, - "1,3,5,6": 0.030111903498860504, - "1,3,5,7": 0.05045989200692669, - "1,3,6,7": -0.008255250250247648, - "1,4,5,6": -0.011743851697420093, - "1,4,5,7": -0.0070995646809189905, - "1,4,6,7": 0.000350206361501626, - "1,5,6,7": -0.18275146303322853, - "2,3,4,5": -0.003737647661951171, - "2,3,4,6": -0.00012933656421842965, - "2,3,4,7": 8.055674370777144e-05, - "2,3,5,6": -0.0001754566164225979, - "2,3,5,7": -0.011511195887209724, - "2,3,6,7": 0.005928652546784874, - "2,4,5,6": -0.00805092708520283, - "2,4,5,7": -0.014289651466241282, - "2,4,6,7": 0.001619507875127435, - "2,5,6,7": 0.0012539172754658656, - "3,4,5,6": 0.007069758889350575, - "3,4,5,7": -0.0011819021579521083, - "3,4,6,7": 0.0028787495962846466, - "3,5,6,7": 0.07520826805354297, - "4,5,6,7": -0.023243504974219675, - "0,1,2,3,4": 0.0043109476294724836, - "0,1,2,3,5": -0.0037398328268727354, - "0,1,2,3,6": 0.0029842280082932326, - "0,1,2,3,7": -0.012210987057918121, - "0,1,2,4,5": 0.010903243343854285, - "0,1,2,4,6": -0.0005383068391533463, - "0,1,2,4,7": 0.004163262908381871, - "0,1,2,5,6": 8.822737021985105e-05, - "0,1,2,5,7": -0.02854763177331332, - "0,1,2,6,7": 0.02729266600222857, - "0,1,3,4,5": -0.006757393277884383, - "0,1,3,4,6": 0.0020273880737033956, - "0,1,3,4,7": -0.0025010909165885664, - "0,1,3,5,6": 0.026005976423050026, - "0,1,3,5,7": 0.020461915058676006, - "0,1,3,6,7": -0.026442082706637393, - "0,1,4,5,6": -0.01847230608480377, - "0,1,4,5,7": -0.007080005340538431, - "0,1,4,6,7": -0.0013493158123898397, - "0,1,5,6,7": -0.26911752782564546, - "0,2,3,4,5": 0.00843404468971043, - "0,2,3,4,6": 0.0003788852440558266, - "0,2,3,4,7": 0.00017880012496274134, - "0,2,3,5,6": -0.007999296285578605, - "0,2,3,5,7": 0.011052654571517717, - "0,2,3,6,7": -0.009702279171197148, - "0,2,4,5,6": 0.005669061116536422, - "0,2,4,5,7": 0.009963070409873875, - "0,2,4,6,7": 0.005245130883162252, - "0,2,5,6,7": -0.0944638088629075, - "0,3,4,5,6": 0.010332879999694233, - "0,3,4,5,7": -0.0008837515185522449, - "0,3,4,6,7": 0.0031095862629686444, - "0,3,5,6,7": 0.08172369641102262, - "0,4,5,6,7": -0.03314511492183714, - "1,2,3,4,5": -0.0018415018412487605, - "1,2,3,4,6": 0.0002848753492941114, - "1,2,3,4,7": -0.00044629193774659015, - "1,2,3,5,6": -0.004715941773637766, - "1,2,3,5,7": -0.003731357092481513, - "1,2,3,6,7": 0.0034424024422539112, - "1,2,4,5,6": -0.001160180817689982, - "1,2,4,5,7": 0.0009907812929410564, - "1,2,4,6,7": -0.001998726469862877, - "1,2,5,6,7": -0.01132643844761616, - "1,3,4,5,6": 0.0011584641265134366, - "1,3,4,5,7": -0.0017522546485015944, - "1,3,4,6,7": 0.00043824277806070455, - "1,3,5,6,7": 0.058972118588555666, - "1,4,5,6,7": -0.0026466130488662643, - "2,3,4,5,6": -0.0007641369446038659, - "2,3,4,5,7": 0.00041997454677389356, - "2,3,4,6,7": 0.0001597202838858891, - "2,3,5,6,7": -0.00203398045596348, - "2,4,5,6,7": -0.005587080187909432, - "3,4,5,6,7": 0.0027909279366715722, - "0,1,2,3,4,5": 0.004497247182012387, - "0,1,2,3,4,6": -0.0005252748052164691, - "0,1,2,3,4,7": -0.00043459992988914564, - "0,1,2,3,5,6": -0.0059829282951078255, - "0,1,2,3,5,7": -0.009316422483857778, - "0,1,2,3,6,7": -0.002952722453532175, - "0,1,2,4,5,6": 0.0009958793488569206, - "0,1,2,4,5,7": 0.002960340607792933, - "0,1,2,4,6,7": -0.001902335465107985, - "0,1,2,5,6,7": -0.025537119995397095, - "0,1,3,4,5,6": 0.0023112756596617157, - "0,1,3,4,5,7": -0.003182110281861883, - "0,1,3,4,6,7": 0.0006675506327218361, - "0,1,3,5,6,7": 0.06866897603842959, - "0,1,4,5,6,7": -0.006223221733959283, - "0,2,3,4,5,6": 0.0016667845710240936, - "0,2,3,4,5,7": 1.702120835900267e-05, - "0,2,3,4,6,7": -0.00026143548218438006, - "0,2,3,5,6,7": -0.0021620924436958067, - "0,2,4,5,6,7": -0.003904573318612714, - "0,3,4,5,6,7": 0.0033092502031490945, - "1,2,3,4,5,6": -0.00011430822262381568, - "1,2,3,4,5,7": -0.000573156838571176, - "1,2,3,4,6,7": 5.088523883545193e-05, - "1,2,3,5,6,7": -0.0020553411749708594, - "1,2,4,5,6,7": 0.0021038271140310094, - "1,3,4,5,6,7": -5.763886646636962e-06, - "2,3,4,5,6,7": -0.00023281866517299576, - "0,1,2,3,4,5,6": 0.00013502016098154712, - "0,1,2,3,4,5,7": -0.0006438128514369978, - "0,1,2,3,4,6,7": -0.00011356627163738864, - "0,1,2,3,5,6,7": -0.008425710075442794, - "0,1,2,4,5,6,7": 0.004137675103688565, - "0,1,3,4,5,6,7": -0.00017309091617701, - "0,2,3,4,5,6,7": 0.00045544107505257614, - "1,2,3,4,5,6,7": 3.5387381914109284e-05 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=SII_order=8.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=SII_order=8.json deleted file mode 100644 index 59aa6fa74..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=SII_order=8.json +++ /dev/null @@ -1,275 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.205123+00:00Z", - "metadata": { - "n_players": 8, - "index": "SII", - "max_order": 8, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.072184995821221 - }, - "data": { - "0": 0.25171782460956404, - "1": 0.49724787386124647, - "2": 0.06500520944389898, - "3": 0.05833923465868318, - "4": 0.022194402466152785, - "5": 1.130942443361428, - "6": 0.21431031163344444, - "7": 0.6057811263686717, - "0,1": 0.31792824855247537, - "0,2": -0.01136626832778509, - "0,3": -0.0011318219780405148, - "0,4": 0.03546966075328439, - "0,5": 0.3214991189685559, - "0,6": 0.14395103309364898, - "0,7": 0.025680921090524, - "1,2": -0.04679993437970997, - "1,3": 0.015075530383837354, - "1,4": -0.01028346570188543, - "1,5": 0.10407560569961094, - "1,6": 0.14535778179023118, - "1,7": 0.14693615268848426, - "2,3": -0.0049436241892806265, - "2,4": -0.004888611421182798, - "2,5": 0.07819297464559072, - "2,6": -0.003490945945392454, - "2,7": 0.04734995671216602, - "3,4": -0.009113704183641547, - "3,5": 0.09440254198546572, - "3,6": -0.0065878947478539285, - "3,7": -0.019139397295857785, - "4,5": -0.004731958997510555, - "4,6": -0.0010225603174927045, - "4,7": 0.00849463996186306, - "5,6": 0.028575133095404937, - "5,7": -0.33610667530458416, - "6,7": 0.31846102828503464, - "0,1,2": -0.01831571120936748, - "0,1,3": 0.010521120947223128, - "0,1,4": 0.010361172532846297, - "0,1,5": 0.1040135055520307, - "0,1,6": 0.14181636540842402, - "0,1,7": 0.18944715371489163, - "0,2,3": 0.010347990377784777, - "0,2,4": 0.017673539389719606, - "0,2,5": -0.13408842583411595, - "0,2,6": 0.021309279112123214, - "0,2,7": -0.0826422961652864, - "0,3,4": -0.004812551869708859, - "0,3,5": 0.13146709376709176, - "0,3,6": -0.01479002618880032, - "0,3,7": -0.030256428783335343, - "0,4,5": 0.01453426978784822, - "0,4,6": -0.0059457654625518774, - "0,4,7": 0.025926716137407935, - "0,5,6": -0.0771906178902444, - "0,5,7": -0.46892131723201547, - "0,6,7": 0.1125816721480346, - "1,2,3": -0.012078836273108351, - "1,2,4": 0.003714938017095104, - "1,2,5": 0.08310784164704299, - "1,2,6": -0.007572114955466613, - "1,2,7": 0.007653971586732533, - "1,3,4": -0.005890133081621007, - "1,3,5": 0.035753261068938835, - "1,3,6": -0.005704389939261478, - "1,3,7": -0.01808841451260501, - "1,4,5": -0.04900046155184756, - "1,4,6": 0.003706866958111066, - "1,4,7": 0.00503310312702987, - "1,5,6": 0.014402390691089506, - "1,5,7": -0.1444801239758966, - "1,6,7": 0.15257477333632607, - "2,3,4": -0.0016140825821560068, - "2,3,5": -0.0031416930376553243, - "2,3,6": 0.0027769014296976646, - "2,3,7": 0.0015669582877777533, - "2,4,5": -0.020819056254380852, - "2,4,6": -0.00011268776717221485, - "2,4,7": 0.00013674919042094835, - "2,5,6": 0.009133627332542193, - "2,5,7": 0.05141740871485578, - "2,6,7": 0.029578054846731705, - "3,4,5": -0.01447948633555507, - "3,4,6": 0.006144712079016124, - "3,4,7": -0.00019582347285251878, - "3,5,6": 0.04327751955427184, - "3,5,7": 0.027535737005543348, - "3,6,7": -0.0035321148600515606, - "4,5,6": -0.03169870725787849, - "4,5,7": -0.03139068607029771, - "4,6,7": 0.009240019234687313, - "5,6,7": -0.32023949350378533, - "0,1,2,3": 0.019955244677778428, - "0,1,2,4": 0.009092043882777512, - "0,1,2,5": 0.07181098513756501, - "0,1,2,6": 0.009938479199153027, - "0,1,2,7": 0.0061027552507348926, - "0,1,3,4": -0.004383548843306717, - "0,1,3,5": 0.07420826159609117, - "0,1,3,6": -0.014369391835438727, - "0,1,3,7": -0.03152319644735879, - "0,1,4,5": -0.018207776180018342, - "0,1,4,6": -0.0016137112411539478, - "0,1,4,7": 0.011136610961364535, - "0,1,5,6": -0.013029734698287276, - "0,1,5,7": -0.17078601703917307, - "0,1,6,7": 0.20079440495811463, - "0,2,3,4": 0.005278533343863301, - "0,2,3,5": 0.01574509040077887, - "0,2,3,6": -0.005270183771403647, - "0,2,3,7": -0.0025626839796658585, - "0,2,4,5": 0.028938565136177652, - "0,2,4,6": 0.007715414090033623, - "0,2,4,7": 0.008231113172855076, - "0,2,5,6": -0.07054151531026132, - "0,2,5,7": -0.15490870870358497, - "0,2,6,7": -0.03423413129518127, - "0,3,4,5": -0.006321724966334097, - "0,3,4,6": 0.008280663144013323, - "0,3,4,7": -0.0011277301314207566, - "0,3,5,6": 0.02685764580876948, - "0,3,5,7": 0.06030999014473015, - "0,3,6,7": -0.010772587629845676, - "0,4,5,6": -0.03776838816483585, - "0,4,5,7": -0.0184160205078443, - "0,4,6,7": 0.007662350397146134, - "0,5,6,7": -0.4064306290869213, - "1,2,3,4": -0.001977815112278347, - "1,2,3,5": 0.002338601522094863, - "1,2,3,6": -0.00017976881825443325, - "1,2,3,7": 0.00864171786670076, - "1,2,4,5": 0.001561155373870915, - "1,2,4,6": -0.0010394056308075106, - "1,2,4,7": -1.9830361935979646e-05, - "1,2,5,6": -0.00190960025886866, - "1,2,5,7": 0.0005194104833342594, - "1,2,6,7": 0.0020982191653892146, - "1,3,4,5": -0.009239946732786275, - "1,3,4,6": 0.0004367484917590092, - "1,3,4,7": -0.0006620866738703546, - "1,3,5,6": 0.030111903498860504, - "1,3,5,7": 0.05045989200692669, - "1,3,6,7": -0.008255250250247648, - "1,4,5,6": -0.011743851697420093, - "1,4,5,7": -0.0070995646809189905, - "1,4,6,7": 0.000350206361501626, - "1,5,6,7": -0.18275146303322853, - "2,3,4,5": -0.003737647661951171, - "2,3,4,6": -0.00012933656421842965, - "2,3,4,7": 8.055674370777144e-05, - "2,3,5,6": -0.0001754566164225979, - "2,3,5,7": -0.011511195887209724, - "2,3,6,7": 0.005928652546784874, - "2,4,5,6": -0.00805092708520283, - "2,4,5,7": -0.014289651466241282, - "2,4,6,7": 0.001619507875127435, - "2,5,6,7": 0.0012539172754658656, - "3,4,5,6": 0.007069758889350575, - "3,4,5,7": -0.0011819021579521083, - "3,4,6,7": 0.0028787495962846466, - "3,5,6,7": 0.07520826805354297, - "4,5,6,7": -0.023243504974219675, - "0,1,2,3,4": 0.0043109476294724836, - "0,1,2,3,5": -0.0037398328268727354, - "0,1,2,3,6": 0.0029842280082932326, - "0,1,2,3,7": -0.012210987057918121, - "0,1,2,4,5": 0.010903243343854285, - "0,1,2,4,6": -0.0005383068391533463, - "0,1,2,4,7": 0.004163262908381871, - "0,1,2,5,6": 8.822737021985105e-05, - "0,1,2,5,7": -0.02854763177331332, - "0,1,2,6,7": 0.02729266600222857, - "0,1,3,4,5": -0.006757393277884383, - "0,1,3,4,6": 0.0020273880737033956, - "0,1,3,4,7": -0.0025010909165885664, - "0,1,3,5,6": 0.026005976423050026, - "0,1,3,5,7": 0.020461915058676006, - "0,1,3,6,7": -0.026442082706637393, - "0,1,4,5,6": -0.01847230608480377, - "0,1,4,5,7": -0.007080005340538431, - "0,1,4,6,7": -0.0013493158123898397, - "0,1,5,6,7": -0.26911752782564546, - "0,2,3,4,5": 0.00843404468971043, - "0,2,3,4,6": 0.0003788852440558266, - "0,2,3,4,7": 0.00017880012496274134, - "0,2,3,5,6": -0.007999296285578605, - "0,2,3,5,7": 0.011052654571517717, - "0,2,3,6,7": -0.009702279171197148, - "0,2,4,5,6": 0.005669061116536422, - "0,2,4,5,7": 0.009963070409873875, - "0,2,4,6,7": 0.005245130883162252, - "0,2,5,6,7": -0.0944638088629075, - "0,3,4,5,6": 0.010332879999694233, - "0,3,4,5,7": -0.0008837515185522449, - "0,3,4,6,7": 0.0031095862629686444, - "0,3,5,6,7": 0.08172369641102262, - "0,4,5,6,7": -0.03314511492183714, - "1,2,3,4,5": -0.0018415018412487605, - "1,2,3,4,6": 0.0002848753492941114, - "1,2,3,4,7": -0.00044629193774659015, - "1,2,3,5,6": -0.004715941773637766, - "1,2,3,5,7": -0.003731357092481513, - "1,2,3,6,7": 0.0034424024422539112, - "1,2,4,5,6": -0.001160180817689982, - "1,2,4,5,7": 0.0009907812929410564, - "1,2,4,6,7": -0.001998726469862877, - "1,2,5,6,7": -0.01132643844761616, - "1,3,4,5,6": 0.0011584641265134366, - "1,3,4,5,7": -0.0017522546485015944, - "1,3,4,6,7": 0.00043824277806070455, - "1,3,5,6,7": 0.058972118588555666, - "1,4,5,6,7": -0.0026466130488662643, - "2,3,4,5,6": -0.0007641369446038659, - "2,3,4,5,7": 0.00041997454677389356, - "2,3,4,6,7": 0.0001597202838858891, - "2,3,5,6,7": -0.00203398045596348, - "2,4,5,6,7": -0.005587080187909432, - "3,4,5,6,7": 0.0027909279366715722, - "0,1,2,3,4,5": 0.004497247182012387, - "0,1,2,3,4,6": -0.0005252748052164691, - "0,1,2,3,4,7": -0.00043459992988914564, - "0,1,2,3,5,6": -0.0059829282951078255, - "0,1,2,3,5,7": -0.009316422483857778, - "0,1,2,3,6,7": -0.002952722453532175, - "0,1,2,4,5,6": 0.0009958793488569206, - "0,1,2,4,5,7": 0.002960340607792933, - "0,1,2,4,6,7": -0.001902335465107985, - "0,1,2,5,6,7": -0.025537119995397095, - "0,1,3,4,5,6": 0.0023112756596617157, - "0,1,3,4,5,7": -0.003182110281861883, - "0,1,3,4,6,7": 0.0006675506327218361, - "0,1,3,5,6,7": 0.06866897603842959, - "0,1,4,5,6,7": -0.006223221733959283, - "0,2,3,4,5,6": 0.0016667845710240936, - "0,2,3,4,5,7": 1.702120835900267e-05, - "0,2,3,4,6,7": -0.00026143548218438006, - "0,2,3,5,6,7": -0.0021620924436958067, - "0,2,4,5,6,7": -0.003904573318612714, - "0,3,4,5,6,7": 0.0033092502031490945, - "1,2,3,4,5,6": -0.00011430822262381568, - "1,2,3,4,5,7": -0.000573156838571176, - "1,2,3,4,6,7": 5.088523883545193e-05, - "1,2,3,5,6,7": -0.0020553411749708594, - "1,2,4,5,6,7": 0.0021038271140310094, - "1,3,4,5,6,7": -5.763886646636962e-06, - "2,3,4,5,6,7": -0.00023281866517299576, - "0,1,2,3,4,5,6": 0.00013502016098154712, - "0,1,2,3,4,5,7": -0.0006438128514369978, - "0,1,2,3,4,6,7": -0.00011356627163738864, - "0,1,2,3,5,6,7": -0.008425710075442794, - "0,1,2,4,5,6,7": 0.004137675103688565, - "0,1,3,4,5,6,7": -0.00017309091617701, - "0,2,3,4,5,6,7": 0.00045544107505257614, - "1,2,3,4,5,6,7": 3.5387381914109284e-05, - "0,1,2,3,4,5,6,7": -7.077476389305559e-05 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=STII_order=1.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=STII_order=1.json deleted file mode 100644 index 2e0d80f41..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=STII_order=1.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.244632+00:00Z", - "metadata": { - "n_players": 8, - "index": "SV", - "max_order": 1, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 0.0 - }, - "data": { - "0": 0.25171782460956393, - "1": 0.49724787386124636, - "2": 0.06500520944389904, - "3": 0.05833923465868357, - "4": 0.022194402466153063, - "5": 1.1309424433614286, - "6": 0.2143103116334446, - "7": 0.6057811263686718 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=STII_order=2.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=STII_order=2.json deleted file mode 100644 index 0a52e6da6..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=STII_order=2.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.243482+00:00Z", - "metadata": { - "n_players": 8, - "index": "STII", - "max_order": 2, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 0.0 - }, - "data": { - "0": -0.16261418772220537, - "1": 0.25257380296742893, - "2": 0.03404012754182517, - "3": 0.044546921896047476, - "4": 0.004274599180631888, - "5": 0.866307829944895, - "6": -0.07646749671482511, - "7": 0.4381398989545833, - "0,1": 0.24035268208526045, - "0,2": 0.018512727153881567, - "0,3": -0.016462381010035, - "0,4": 0.02571644072486759, - "0,5": 0.388472998474595, - "0,6": 0.1094129642409101, - "0,7": 0.06265859299405911, - "1,2": -0.056442868029184856, - "1,3": 0.015328795712468077, - "1,4": -0.005335632843636515, - "1,5": 0.09277689543046713, - "1,6": 0.09193754033577362, - "1,7": 0.11073072909648692, - "2,3": -0.004777567156838844, - "2,4": -0.004104213338760362, - "2,5": 0.07865236331493664, - "2,6": -0.014225572647060217, - "2,7": 0.044315294507173836, - "3,4": -0.005318753743490293, - "3,5": 0.06085441043540374, - "3,6": -0.008849955131085593, - "3,7": -0.013189923581150162, - "4,5": 0.01688860838275616, - "4,6": 0.0014850590471526676, - "4,7": 0.0065080983421526295, - "5,6": 0.0845799340881507, - "5,7": -0.19295598329324354, - "6,7": 0.317215646762698 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=STII_order=3.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=STII_order=3.json deleted file mode 100644 index d705b7e1e..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=STII_order=3.json +++ /dev/null @@ -1,112 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.244093+00:00Z", - "metadata": { - "n_players": 8, - "index": "STII", - "max_order": 3, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 0.0 - }, - "data": { - "0": -0.16261418772220537, - "1": 0.25257380296742893, - "2": 0.03404012754182517, - "3": 0.044546921896047476, - "4": 0.004274599180631888, - "5": 0.866307829944895, - "6": -0.07646749671482511, - "7": 0.4381398989545833, - "0,1": 0.12305751039498114, - "0,2": 0.06879976665378207, - "0,3": -0.03186539327538562, - "0,4": 0.006348957784406473, - "0,5": 0.43256290683208176, - "0,6": -0.001343591904652719, - "0,7": 0.06253252257449615, - "1,2": -0.05260843083096711, - "1,3": 0.030375991777427558, - "1,4": 0.0001627696826771441, - "1,5": 0.050597850652254195, - "1,6": -0.0037661976376257567, - "1,7": 0.029956244518440034, - "2,3": 0.0021427617976605973, - "2,4": 0.0010206000064738596, - "2,5": 0.06281486401814362, - "2,6": -0.04518473112286059, - "2,7": 0.014457807951902879, - "3,4": 0.0002791536757293933, - "3,5": 0.03399004342480172, - "3,6": -0.003151879705281191, - "3,7": 0.01327791906929221, - "4,5": 0.041283992819152626, - "4,6": 0.00044805721857854586, - "4,7": -0.001308578845925279, - "5,6": 0.10611256477907083, - "5,7": -0.027675879294393635, - "6,7": 0.2660569037436613, - "0,1,2": -0.0483928809892164, - "0,1,3": 0.001006790757527229, - "0,1,4": 0.011064420928203436, - "0,1,5": 0.11416462700258673, - "0,1,6": 0.09285432208153607, - "0,1,7": 0.18118823529020067, - "0,2,3": 0.0016116755514771278, - "0,2,4": 0.0037310848454143175, - "0,2,5": -0.10922449856769062, - "0,2,6": 0.04222801722578661, - "0,2,7": -0.040814516565472525, - "0,3,4": -0.00472949069769054, - "0,3,5": 0.09261551122586167, - "0,3,6": -0.012939910023170825, - "0,3,7": -0.03135554001795263, - "0,4,5": 0.027170916408026293, - "0,4,6": -0.00257750924057331, - "0,4,7": 0.02344302657800348, - "0,5,6": 0.04389573063897786, - "0,5,7": -0.3008920117802221, - "0,6,7": 0.16880901775413215, - "1,2,3": -0.019925794414961173, - "1,2,4": 0.002215766406608921, - "1,2,5": 0.06300765955269146, - "1,2,6": -0.010436877325492588, - "1,2,7": 0.0020288151757166667, - "1,3,4": -0.0019463589211049792, - "1,3,5": 0.0015848165399171554, - "1,3,6": -0.005028111748770825, - "1,3,7": -0.020832930407486183, - "1,4,5": -0.03820879355836526, - "1,4,6": 0.006654084833405405, - "1,4,7": 0.003725672732311419, - "1,5,6": 0.05642147996696542, - "1,5,7": -0.07043265516915728, - "1,6,7": 0.14664631611255452, - "2,3,4": -0.001203672484828583, - "2,3,5": -0.004203880383304617, - "2,3,6": 0.002158293599772265, - "2,3,7": 0.0008023912683458867, - "2,4,5": -0.021307344274494378, - "2,4,6": -0.00018773125140950087, - "2,4,7": 0.0013774567230065565, - "2,5,6": 0.026089010838852778, - "2,5,7": 0.09315155072432436, - "2,6,7": 0.03302676233989141, - "3,4,5": -0.010746911927289382, - "3,4,6": 0.0020133943987368785, - "3,4,7": -0.00018068262548262548, - "3,5,6": 0.012941219620696151, - "3,5,7": -0.01159765404407459, - "3,6,7": -0.01623911212467688, - "4,5,6": -0.013984905683949223, - "4,5,7": -0.016109114273116454, - "4,6,7": 0.01119367242951197, - "5,6,7": -0.18996042745430297 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=STII_order=4.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=STII_order=4.json deleted file mode 100644 index ad0f4ff8e..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=STII_order=4.json +++ /dev/null @@ -1,182 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.246842+00:00Z", - "metadata": { - "n_players": 8, - "index": "STII", - "max_order": 4, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 0.0 - }, - "data": { - "0": -0.16261418772220537, - "1": 0.25257380296742893, - "2": 0.03404012754182517, - "3": 0.044546921896047476, - "4": 0.004274599180631888, - "5": 0.866307829944895, - "6": -0.07646749671482511, - "7": 0.4381398989545833, - "0,1": 0.12305751039498114, - "0,2": 0.06879976665378207, - "0,3": -0.03186539327538562, - "0,4": 0.006348957784406473, - "0,5": 0.43256290683208176, - "0,6": -0.001343591904652719, - "0,7": 0.06253252257449615, - "1,2": -0.05260843083096711, - "1,3": 0.030375991777427558, - "1,4": 0.0001627696826771441, - "1,5": 0.050597850652254195, - "1,6": -0.0037661976376257567, - "1,7": 0.029956244518440034, - "2,3": 0.0021427617976605973, - "2,4": 0.0010206000064738596, - "2,5": 0.06281486401814362, - "2,6": -0.04518473112286059, - "2,7": 0.014457807951902879, - "3,4": 0.0002791536757293933, - "3,5": 0.03399004342480172, - "3,6": -0.003151879705281191, - "3,7": 0.01327791906929221, - "4,5": 0.041283992819152626, - "4,6": 0.00044805721857854586, - "4,7": -0.001308578845925279, - "5,6": 0.10611256477907083, - "5,7": -0.027675879294393635, - "6,7": 0.2660569037436613, - "0,1,2": -0.07581748269137689, - "0,1,3": -0.010425346893652376, - "0,1,4": 0.009689026349510854, - "0,1,5": 0.08613875427434481, - "0,1,6": 0.008184155718661046, - "0,1,7": 0.1325370254627951, - "0,2,3": -0.0069907282047319, - "0,2,4": -0.003968630745211588, - "0,2,5": -0.09423929931937414, - "0,2,6": 0.05579137023380776, - "0,2,7": -0.00830832294807271, - "0,3,4": -0.0025592651310846204, - "0,3,5": 0.06946101623610557, - "0,3,6": -0.0031458718027115307, - "0,3,7": -0.02632388995052337, - "0,4,5": 0.03678552244621436, - "0,4,6": -0.0026889975598956006, - "0,4,7": 0.018344894666615374, - "0,5,6": 0.12349834621387856, - "0,5,7": -0.17532339201209135, - "0,6,7": 0.18140110188899028, - "1,2,3": -0.028777980136038384, - "1,2,4": 0.0022331909268724637, - "1,2,5": 0.038926174766415134, - "1,2,6": -0.009492902856367058, - "1,2,7": -0.004578883747135887, - "1,3,4": 0.0012020909926775403, - "1,3,5": -0.02387365587728807, - "1,3,6": 0.0014008333929862449, - "1,3,7": -0.021069823921308295, - "1,4,5": -0.031194803271882066, - "1,4,6": 0.006668413176678767, - "1,4,7": 0.0010420137098954285, - "1,5,6": 0.06733775081541027, - "1,5,7": -0.030111770005249117, - "1,6,7": 0.10948547914483142, - "2,3,4": 0.00048570925087920713, - "2,3,5": -0.005009828674734429, - "2,3,6": -4.0524918107243124e-05, - "2,3,7": -0.0005770472903154911, - "2,4,5": -0.018662581163675362, - "2,4,6": -4.377242168751572e-05, - "2,4,7": 0.004378304036486647, - "2,5,6": 0.02858522866045443, - "2,5,7": 0.12048958750966543, - "2,6,7": 0.02654659882516408, - "3,4,5": -0.005911177670971046, - "3,4,6": 0.00018458610445581947, - "3,4,7": 7.734804350212343e-05, - "3,5,6": 0.0015856761539627673, - "3,5,7": -0.03097840566198906, - "3,6,7": -0.017008920996498533, - "4,5,6": -0.001953948306280706, - "4,5,7": -0.005557428416471222, - "4,6,7": 0.008964429344984426, - "5,6,7": -0.09793108117582316, - "0,1,2,3": 0.021803605712853256, - "0,1,2,4": 0.003727786650706902, - "0,1,2,5": 0.07698397167532563, - "0,1,2,6": -0.0003276101567773332, - "0,1,2,7": 0.007510652926533065, - "0,1,3,4": -0.0034184211080137694, - "0,1,3,5": 0.06505738699333508, - "0,1,3,6": -0.013913541897091625, - "0,1,3,7": -0.023800479096364194, - "0,1,4,5": -0.0116411131341696, - "0,1,4,6": 0.0038447409264374816, - "0,1,4,7": 0.012988584979809637, - "0,1,5,6": 0.06643712072888343, - "0,1,5,7": -0.08473387535040568, - "0,1,6,7": 0.28263995585004903, - "0,2,3,4": 0.0014489597584211727, - "0,2,3,5": 0.012803221487353949, - "0,2,3,6": -0.0015356690315022348, - "0,2,3,7": -0.00011050290228911686, - "0,2,4,5": 0.01877286492367716, - "0,2,4,6": 0.004490470034737931, - "0,2,4,7": 0.0023587809949607297, - "0,2,5,6": -0.04279887623468058, - "0,2,5,7": -0.1257019788449419, - "0,2,6,7": -0.014081726643862133, - "0,3,4,5": -0.009377939057392828, - "0,3,4,6": 0.0037743337902260005, - "0,3,4,7": -0.0011078356496640185, - "0,3,5,6": -0.0041290912931702395, - "0,3,5,7": 0.028264401828899454, - "0,3,6,7": -0.02337218445029901, - "0,4,5,6": -0.027014412839712842, - "0,4,5,7": -0.009197824045154276, - "0,4,6,7": 0.015350821365600894, - "0,5,6,7": -0.3109052026609208, - "1,2,3,4": -0.00258962735593124, - "1,2,3,5": 0.005842108193756135, - "1,2,3,6": -0.001402864175095303, - "1,2,3,7": 0.01175552050872608, - "1,2,4,5": -0.0006721854450150166, - "1,2,4,6": 0.00012510247974482913, - "1,2,4,7": -0.0006607744105600888, - "1,2,5,6": 0.002088061014976633, - "1,2,5,7": 0.012083983706061854, - "1,2,6,7": -0.004258587039350878, - "1,3,4,5": -0.006402165528718445, - "1,3,4,6": -0.0006591111590099896, - "1,3,4,7": 0.0004755254965439909, - "1,3,5,6": 0.0075396447641182945, - "1,3,5,7": 0.029796915246331324, - "1,3,6,7": -0.017279908099949115, - "1,4,5,6": -0.005319921341083278, - "1,4,5,7": -0.004020575696947082, - "1,4,6,7": 0.0019518757208176057, - "1,5,6,7": -0.11440998856067398, - "2,3,4,5": -0.005436642041083503, - "2,3,4,6": -0.0001123679723499943, - "2,3,4,7": -6.784933188773434e-05, - "2,3,5,6": 0.0039603474080322915, - "2,3,5,7": -0.013945241882338241, - "2,3,6,7": 0.007885827842434107, - "2,4,5,6": -0.007344291617721238, - "2,4,5,7": -0.015898798263134492, - "2,4,6,7": 0.002265251756700809, - "2,5,6,7": 0.034109888142987266, - "3,4,5,6": 0.003259075655555735, - "3,4,5,7": -0.001385266053634579, - "3,4,6,7": 0.0010533028627031787, - "3,5,6,7": 0.03479219733239833, - "4,5,6,7": -0.011704279367711831 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=STII_order=5.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=STII_order=5.json deleted file mode 100644 index cd5109123..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=STII_order=5.json +++ /dev/null @@ -1,238 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.247569+00:00Z", - "metadata": { - "n_players": 8, - "index": "STII", - "max_order": 5, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 0.0 - }, - "data": { - "0": -0.16261418772220537, - "1": 0.25257380296742893, - "2": 0.03404012754182517, - "3": 0.044546921896047476, - "4": 0.004274599180631888, - "5": 0.866307829944895, - "6": -0.07646749671482511, - "7": 0.4381398989545833, - "0,1": 0.12305751039498114, - "0,2": 0.06879976665378207, - "0,3": -0.03186539327538562, - "0,4": 0.006348957784406473, - "0,5": 0.43256290683208176, - "0,6": -0.001343591904652719, - "0,7": 0.06253252257449615, - "1,2": -0.05260843083096711, - "1,3": 0.030375991777427558, - "1,4": 0.0001627696826771441, - "1,5": 0.050597850652254195, - "1,6": -0.0037661976376257567, - "1,7": 0.029956244518440034, - "2,3": 0.0021427617976605973, - "2,4": 0.0010206000064738596, - "2,5": 0.06281486401814362, - "2,6": -0.04518473112286059, - "2,7": 0.014457807951902879, - "3,4": 0.0002791536757293933, - "3,5": 0.03399004342480172, - "3,6": -0.003151879705281191, - "3,7": 0.01327791906929221, - "4,5": 0.041283992819152626, - "4,6": 0.00044805721857854586, - "4,7": -0.001308578845925279, - "5,6": 0.10611256477907083, - "5,7": -0.027675879294393635, - "6,7": 0.2660569037436613, - "0,1,2": -0.07581748269137689, - "0,1,3": -0.010425346893652376, - "0,1,4": 0.009689026349510854, - "0,1,5": 0.08613875427434481, - "0,1,6": 0.008184155718661046, - "0,1,7": 0.1325370254627951, - "0,2,3": -0.0069907282047319, - "0,2,4": -0.003968630745211588, - "0,2,5": -0.09423929931937414, - "0,2,6": 0.05579137023380776, - "0,2,7": -0.00830832294807271, - "0,3,4": -0.0025592651310846204, - "0,3,5": 0.06946101623610557, - "0,3,6": -0.0031458718027115307, - "0,3,7": -0.02632388995052337, - "0,4,5": 0.03678552244621436, - "0,4,6": -0.0026889975598956006, - "0,4,7": 0.018344894666615374, - "0,5,6": 0.12349834621387856, - "0,5,7": -0.17532339201209135, - "0,6,7": 0.18140110188899028, - "1,2,3": -0.028777980136038384, - "1,2,4": 0.0022331909268724637, - "1,2,5": 0.038926174766415134, - "1,2,6": -0.009492902856367058, - "1,2,7": -0.004578883747135887, - "1,3,4": 0.0012020909926775403, - "1,3,5": -0.02387365587728807, - "1,3,6": 0.0014008333929862449, - "1,3,7": -0.021069823921308295, - "1,4,5": -0.031194803271882066, - "1,4,6": 0.006668413176678767, - "1,4,7": 0.0010420137098954285, - "1,5,6": 0.06733775081541027, - "1,5,7": -0.030111770005249117, - "1,6,7": 0.10948547914483142, - "2,3,4": 0.00048570925087920713, - "2,3,5": -0.005009828674734429, - "2,3,6": -4.0524918107243124e-05, - "2,3,7": -0.0005770472903154911, - "2,4,5": -0.018662581163675362, - "2,4,6": -4.377242168751572e-05, - "2,4,7": 0.004378304036486647, - "2,5,6": 0.02858522866045443, - "2,5,7": 0.12048958750966543, - "2,6,7": 0.02654659882516408, - "3,4,5": -0.005911177670971046, - "3,4,6": 0.00018458610445581947, - "3,4,7": 7.734804350212343e-05, - "3,5,6": 0.0015856761539627673, - "3,5,7": -0.03097840566198906, - "3,6,7": -0.017008920996498533, - "4,5,6": -0.001953948306280706, - "4,5,7": -0.005557428416471222, - "4,6,7": 0.008964429344984426, - "5,6,7": -0.09793108117582316, - "0,1,2,3": 0.021832975829153556, - "0,1,2,4": 0.0006067056767027346, - "0,1,2,5": 0.07706417396680187, - "0,1,2,6": -0.010956652523762322, - "0,1,2,7": 0.004559316083175613, - "0,1,3,4": -0.002365434029293345, - "0,1,3,5": 0.06572462770294862, - "0,1,3,6": -0.006290308113023224, - "0,1,3,7": -0.012266269223661697, - "0,1,4,5": -0.007275617877784413, - "0,1,4,6": 0.0067755638551236785, - "0,1,4,7": 0.013170148672343007, - "0,1,5,6": 0.1234259163561795, - "0,1,5,7": -0.024080292581441398, - "0,1,6,7": 0.341058415458658, - "0,2,3,4": -0.0005438225507596872, - "0,2,3,5": 0.00999359944164091, - "0,2,3,6": 0.00019846167148585003, - "0,2,3,7": 0.000262205681313743, - "0,2,4,5": 0.012494997781556716, - "0,2,4,6": 0.0016852288546567173, - "0,2,4,7": -0.002129256894812581, - "0,2,5,6": -0.02800692284275641, - "0,2,5,7": -0.11023229945494384, - "0,2,6,7": -0.00453767308844899, - "0,3,4,5": -0.01044567766363258, - "0,3,4,6": 0.0015533443091240162, - "0,3,4,7": -0.0010578635573030848, - "0,3,5,6": -0.016869745684285897, - "0,3,5,7": 0.013690862415615346, - "0,3,6,7": -0.023903101119979953, - "0,4,5,6": -0.02026572327248166, - "0,4,5,7": -0.004011309549377451, - "0,4,6,7": 0.0193487721559924, - "0,5,6,7": -0.2432350225367892, - "1,2,3,4": -0.0026460051159427067, - "1,2,3,5": 0.007097792475822651, - "1,2,3,6": -0.003105139957997105, - "1,2,3,7": 0.012570300908113285, - "1,2,4,5": -0.0012376849243458388, - "1,2,4,6": 0.0007705684514915934, - "1,2,4,7": -0.0010044906454771407, - "1,2,5,6": 0.001551593863418077, - "1,2,5,7": 0.01642611385720416, - "1,2,6,7": -0.011653174562006319, - "1,3,4,5": -0.004152380818100099, - "1,3,4,6": -0.0011179834104424469, - "1,3,4,7": 0.0008914373364143913, - "1,3,5,6": -0.00012572767146323827, - "1,3,5,7": 0.022409737108020078, - "1,3,6,7": -0.015729300910097832, - "1,4,5,6": -0.001336559912982871, - "1,4,5,7": -0.0026731738195082677, - "1,4,6,7": 0.0022459287801390726, - "1,5,6,7": -0.0645313141140691, - "2,3,4,5": -0.005982683855967341, - "2,3,4,6": -5.934393262996274e-05, - "2,3,4,7": -0.00031220301786749616, - "2,3,5,6": 0.006103462900506562, - "2,3,5,7": -0.016749617579650433, - "2,3,6,7": 0.00872915932597107, - "2,4,5,6": -0.007041601038325629, - "2,4,5,7": -0.01711889198697758, - "2,4,6,7": 0.00202126968291938, - "2,5,6,7": 0.052663910664157765, - "3,4,5,6": 0.001468787098906299, - "3,4,5,7": -0.0015782542008047074, - "3,4,6,7": 0.00021981479773791612, - "3,5,6,7": 0.015737947650711792, - "4,5,6,7": -0.004772755752322944, - "0,1,2,3,4": 0.0031000809476706553, - "0,1,2,3,5": -0.0005666905323329502, - "0,1,2,3,6": 0.005735560792269126, - "0,1,2,3,7": -0.008415801789109015, - "0,1,2,4,5": 0.008256118496955928, - "0,1,2,4,6": 0.00013488417112593465, - "0,1,2,4,7": 0.0041143212542679025, - "0,1,2,5,6": 0.010063081348948913, - "0,1,2,5,7": -0.018153520770952877, - "0,1,2,6,7": 0.03721168552258115, - "0,1,3,4,5": -0.008000774504204805, - "0,1,3,4,6": 0.0012002103753996768, - "0,1,3,4,7": -0.0015644522124678706, - "0,1,3,5,6": 0.003935058381197676, - "0,1,3,5,7": 0.0012962031072727698, - "0,1,3,6,7": -0.04898699846920759, - "0,1,4,5,6": -0.01730717098008372, - "0,1,4,5,7": -0.004775649294595119, - "0,1,4,6,7": 0.0013179617901263596, - "0,1,5,6,7": -0.28163494688654417, - "0,2,3,4,5": 0.006369046757683912, - "0,2,3,4,6": 0.0001061300417526459, - "0,2,3,4,7": 0.00038865379879683, - "0,2,3,5,6": -0.0062150977090237244, - "0,2,3,5,7": 0.014460851712236975, - "0,2,3,6,7": -0.008297246639938798, - "0,2,4,5,6": 0.0063060738738439995, - "0,2,4,5,7": 0.010458096582118152, - "0,2,4,6,7": 0.007479117813683871, - "0,2,5,6,7": -0.08411382447339047, - "0,3,4,5,6": 0.007921544907104665, - "0,3,4,5,7": -0.0009511241293860342, - "0,3,4,6,7": 0.0018770620812530378, - "0,3,5,6,7": 0.0580617663762995, - "0,4,5,6,7": -0.030663895637020572, - "1,2,3,4,5": -0.003136078716566973, - "1,2,3,4,6": 0.0004817082810487511, - "1,2,3,4,7": -0.00016382171209662622, - "1,2,3,5,6": -0.0023936319122567634, - "1,2,3,5,7": -0.0001820202491767814, - "1,2,3,6,7": 0.004687741753447924, - "1,2,4,5,6": -0.0019522731635274043, - "1,2,4,5,7": -0.0003402692202057328, - "1,2,4,6,7": -0.0018916491473798674, - "1,2,5,6,7": -0.0030348405153717978, - "1,3,4,5,6": 0.00042582877159004495, - "1,3,4,5,7": -0.0005378991039129005, - "1,3,4,6,7": 0.00018661382912342483, - "1,3,5,6,7": 0.03635960693737851, - "1,4,5,6,7": -0.00108319176847875, - "2,3,4,5,6": -0.0011763269156486317, - "2,3,4,5,7": 0.000673567948950779, - "2,3,4,6,7": 0.00032336839424788877, - "2,3,5,6,7": -0.0009305209254428376, - "2,4,5,6,7": -0.00469092669164696, - "3,4,5,6,7": 0.0017803960202022878 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=STII_order=6.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=STII_order=6.json deleted file mode 100644 index 4a3d7e41e..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=STII_order=6.json +++ /dev/null @@ -1,266 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.250025+00:00Z", - "metadata": { - "n_players": 8, - "index": "STII", - "max_order": 6, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 0.0 - }, - "data": { - "0": -0.16261418772220537, - "1": 0.25257380296742893, - "2": 0.03404012754182517, - "3": 0.044546921896047476, - "4": 0.004274599180631888, - "5": 0.866307829944895, - "6": -0.07646749671482511, - "7": 0.4381398989545833, - "0,1": 0.12305751039498114, - "0,2": 0.06879976665378207, - "0,3": -0.03186539327538562, - "0,4": 0.006348957784406473, - "0,5": 0.43256290683208176, - "0,6": -0.001343591904652719, - "0,7": 0.06253252257449615, - "1,2": -0.05260843083096711, - "1,3": 0.030375991777427558, - "1,4": 0.0001627696826771441, - "1,5": 0.050597850652254195, - "1,6": -0.0037661976376257567, - "1,7": 0.029956244518440034, - "2,3": 0.0021427617976605973, - "2,4": 0.0010206000064738596, - "2,5": 0.06281486401814362, - "2,6": -0.04518473112286059, - "2,7": 0.014457807951902879, - "3,4": 0.0002791536757293933, - "3,5": 0.03399004342480172, - "3,6": -0.003151879705281191, - "3,7": 0.01327791906929221, - "4,5": 0.041283992819152626, - "4,6": 0.00044805721857854586, - "4,7": -0.001308578845925279, - "5,6": 0.10611256477907083, - "5,7": -0.027675879294393635, - "6,7": 0.2660569037436613, - "0,1,2": -0.07581748269137689, - "0,1,3": -0.010425346893652376, - "0,1,4": 0.009689026349510854, - "0,1,5": 0.08613875427434481, - "0,1,6": 0.008184155718661046, - "0,1,7": 0.1325370254627951, - "0,2,3": -0.0069907282047319, - "0,2,4": -0.003968630745211588, - "0,2,5": -0.09423929931937414, - "0,2,6": 0.05579137023380776, - "0,2,7": -0.00830832294807271, - "0,3,4": -0.0025592651310846204, - "0,3,5": 0.06946101623610557, - "0,3,6": -0.0031458718027115307, - "0,3,7": -0.02632388995052337, - "0,4,5": 0.03678552244621436, - "0,4,6": -0.0026889975598956006, - "0,4,7": 0.018344894666615374, - "0,5,6": 0.12349834621387856, - "0,5,7": -0.17532339201209135, - "0,6,7": 0.18140110188899028, - "1,2,3": -0.028777980136038384, - "1,2,4": 0.0022331909268724637, - "1,2,5": 0.038926174766415134, - "1,2,6": -0.009492902856367058, - "1,2,7": -0.004578883747135887, - "1,3,4": 0.0012020909926775403, - "1,3,5": -0.02387365587728807, - "1,3,6": 0.0014008333929862449, - "1,3,7": -0.021069823921308295, - "1,4,5": -0.031194803271882066, - "1,4,6": 0.006668413176678767, - "1,4,7": 0.0010420137098954285, - "1,5,6": 0.06733775081541027, - "1,5,7": -0.030111770005249117, - "1,6,7": 0.10948547914483142, - "2,3,4": 0.00048570925087920713, - "2,3,5": -0.005009828674734429, - "2,3,6": -4.0524918107243124e-05, - "2,3,7": -0.0005770472903154911, - "2,4,5": -0.018662581163675362, - "2,4,6": -4.377242168751572e-05, - "2,4,7": 0.004378304036486647, - "2,5,6": 0.02858522866045443, - "2,5,7": 0.12048958750966543, - "2,6,7": 0.02654659882516408, - "3,4,5": -0.005911177670971046, - "3,4,6": 0.00018458610445581947, - "3,4,7": 7.734804350212343e-05, - "3,5,6": 0.0015856761539627673, - "3,5,7": -0.03097840566198906, - "3,6,7": -0.017008920996498533, - "4,5,6": -0.001953948306280706, - "4,5,7": -0.005557428416471222, - "4,6,7": 0.008964429344984426, - "5,6,7": -0.09793108117582316, - "0,1,2,3": 0.021832975829153556, - "0,1,2,4": 0.0006067056767027346, - "0,1,2,5": 0.07706417396680187, - "0,1,2,6": -0.010956652523762322, - "0,1,2,7": 0.004559316083175613, - "0,1,3,4": -0.002365434029293345, - "0,1,3,5": 0.06572462770294862, - "0,1,3,6": -0.006290308113023224, - "0,1,3,7": -0.012266269223661697, - "0,1,4,5": -0.007275617877784413, - "0,1,4,6": 0.0067755638551236785, - "0,1,4,7": 0.013170148672343007, - "0,1,5,6": 0.1234259163561795, - "0,1,5,7": -0.024080292581441398, - "0,1,6,7": 0.341058415458658, - "0,2,3,4": -0.0005438225507596872, - "0,2,3,5": 0.00999359944164091, - "0,2,3,6": 0.00019846167148585003, - "0,2,3,7": 0.000262205681313743, - "0,2,4,5": 0.012494997781556716, - "0,2,4,6": 0.0016852288546567173, - "0,2,4,7": -0.002129256894812581, - "0,2,5,6": -0.02800692284275641, - "0,2,5,7": -0.11023229945494384, - "0,2,6,7": -0.00453767308844899, - "0,3,4,5": -0.01044567766363258, - "0,3,4,6": 0.0015533443091240162, - "0,3,4,7": -0.0010578635573030848, - "0,3,5,6": -0.016869745684285897, - "0,3,5,7": 0.013690862415615346, - "0,3,6,7": -0.023903101119979953, - "0,4,5,6": -0.02026572327248166, - "0,4,5,7": -0.004011309549377451, - "0,4,6,7": 0.0193487721559924, - "0,5,6,7": -0.2432350225367892, - "1,2,3,4": -0.0026460051159427067, - "1,2,3,5": 0.007097792475822651, - "1,2,3,6": -0.003105139957997105, - "1,2,3,7": 0.012570300908113285, - "1,2,4,5": -0.0012376849243458388, - "1,2,4,6": 0.0007705684514915934, - "1,2,4,7": -0.0010044906454771407, - "1,2,5,6": 0.001551593863418077, - "1,2,5,7": 0.01642611385720416, - "1,2,6,7": -0.011653174562006319, - "1,3,4,5": -0.004152380818100099, - "1,3,4,6": -0.0011179834104424469, - "1,3,4,7": 0.0008914373364143913, - "1,3,5,6": -0.00012572767146323827, - "1,3,5,7": 0.022409737108020078, - "1,3,6,7": -0.015729300910097832, - "1,4,5,6": -0.001336559912982871, - "1,4,5,7": -0.0026731738195082677, - "1,4,6,7": 0.0022459287801390726, - "1,5,6,7": -0.0645313141140691, - "2,3,4,5": -0.005982683855967341, - "2,3,4,6": -5.934393262996274e-05, - "2,3,4,7": -0.00031220301786749616, - "2,3,5,6": 0.006103462900506562, - "2,3,5,7": -0.016749617579650433, - "2,3,6,7": 0.00872915932597107, - "2,4,5,6": -0.007041601038325629, - "2,4,5,7": -0.01711889198697758, - "2,4,6,7": 0.00202126968291938, - "2,5,6,7": 0.052663910664157765, - "3,4,5,6": 0.001468787098906299, - "3,4,5,7": -0.0015782542008047074, - "3,4,6,7": 0.00021981479773791612, - "3,5,6,7": 0.015737947650711792, - "4,5,6,7": -0.004772755752322944, - "0,1,2,3,4": 0.002438534912335255, - "0,1,2,3,5": 0.00017213517728498218, - "0,1,2,3,6": 0.006313981420871029, - "0,1,2,3,7": -0.007389629490702543, - "0,1,2,4,5": 0.007281323510058169, - "0,1,2,4,6": 0.0008707467870823216, - "0,1,2,4,7": 0.004414942965414781, - "0,1,2,5,6": 0.014658142705912258, - "0,1,2,5,7": -0.013423005474787697, - "0,1,2,6,7": 0.04175515475200964, - "0,1,3,4,5": -0.008684246825562347, - "0,1,3,4,6": 0.0007753394923153412, - "0,1,3,4,7": -0.0011815894669515714, - "0,1,3,5,6": -0.00790331541688083, - "0,1,3,5,7": -0.009163742218192716, - "0,1,3,6,7": -0.06108604602599055, - "0,1,4,5,6": -0.016331005330670667, - "0,1,4,5,7": -0.0033040477471826257, - "0,1,4,6,7": 0.0030215237900912406, - "0,1,5,6,7": -0.28831536596150764, - "0,2,3,4,5": 0.005334626273114207, - "0,2,3,4,6": 1.833059631017875e-05, - "0,2,3,4,7": 0.00046798421881111274, - "0,2,3,5,6": -0.006066053008254801, - "0,2,3,5,7": 0.01534772112247218, - "0,2,3,6,7": -0.008361459860165565, - "0,2,4,5,6": 0.0070780385391917555, - "0,2,4,5,7": 0.011084893382321326, - "0,2,4,6,7": 0.009025894667293421, - "0,2,5,6,7": -0.0793006816335069, - "0,3,4,5,6": 0.006758786502754965, - "0,3,4,5,7": -0.0010160758654724766, - "0,3,4,6,7": 0.001280034233994476, - "0,3,5,6,7": 0.04545840285931568, - "0,4,5,6,7": -0.028999171620032627, - "1,2,3,4,5": -0.0038252937864147185, - "1,2,3,4,6": 0.0005886977890046108, - "1,2,3,4,7": -8.818812980315727e-05, - "1,2,3,5,6": -0.0020155366827085963, - "1,2,3,5,7": 0.000735413898718118, - "1,2,3,6,7": 0.004503676809557877, - "1,2,4,5,6": -0.0019348661633880049, - "1,2,4,5,7": -0.0006665158763299317, - "1,2,4,6,7": -0.0014483322114204888, - "1,2,5,6,7": 0.000709103982243775, - "1,3,4,5,6": 6.241512244109515e-05, - "1,3,4,5,7": -1.991875915319241e-06, - "1,3,4,6,7": 4.002848462292263e-05, - "1,3,5,6,7": 0.024240947498535004, - "1,4,5,6,7": 8.262813266401992e-05, - "2,3,4,5,6": -0.0013196576832190665, - "2,3,4,5,7": 0.0007889542953827267, - "2,3,4,6,7": 0.0004442817690362144, - "2,3,5,6,7": -0.0011313345837922206, - "2,4,5,6,7": -0.0037988804929214304, - "3,4,5,6,7": 0.0013085503678089694, - "0,1,2,3,4,5": 0.004674746073615538, - "0,1,2,3,4,6": -0.0005371496921144636, - "0,1,2,3,4,7": -0.00016832016948917228, - "0,1,2,3,5,6": -0.0030261803949356014, - "0,1,2,3,5,7": -0.006081519936386587, - "0,1,2,3,6,7": 9.280631543917561e-05, - "0,1,2,4,5,6": -0.0005342960292302468, - "0,1,2,4,5,7": 0.0017083198770049823, - "0,1,2,4,6,7": -0.003343729974394666, - "0,1,2,5,6,7": -0.024009891717612336, - "0,1,3,4,5,6": 0.0023206595743812952, - "0,1,3,4,5,7": -0.002894571719844946, - "0,1,3,4,6,7": 0.000765715416238294, - "0,1,3,5,6,7": 0.07173576360902165, - "0,1,4,5,6,7": -0.0076433574416304995, - "0,2,3,4,5,6": 0.0014516927745854419, - "0,2,3,4,5,7": 8.008405922065032e-05, - "0,2,3,4,6,7": -0.0003877464098185762, - "0,2,3,5,6,7": 0.0006802194157426583, - "0,2,4,5,6,7": -0.005549184737444188, - "0,3,4,5,6,7": 0.0032041980771304185, - "1,2,3,4,5,6": -0.00017938084294069623, - "1,2,3,4,5,7": -0.0003600748115825947, - "1,2,3,4,6,7": 7.459348731972404e-05, - "1,2,3,5,6,7": 0.0009369898605871285, - "1,2,4,5,6,7": 0.0006092348713268303, - "1,3,4,5,6,7": 3.920316344671604e-05, - "2,3,4,5,6,7": -0.0004123273262303384 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=STII_order=7.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=STII_order=7.json deleted file mode 100644 index 4cf9db86d..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=STII_order=7.json +++ /dev/null @@ -1,274 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.248438+00:00Z", - "metadata": { - "n_players": 8, - "index": "STII", - "max_order": 7, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 0.0 - }, - "data": { - "0": -0.16261418772220537, - "1": 0.25257380296742893, - "2": 0.03404012754182517, - "3": 0.044546921896047476, - "4": 0.004274599180631888, - "5": 0.866307829944895, - "6": -0.07646749671482511, - "7": 0.4381398989545833, - "0,1": 0.12305751039498114, - "0,2": 0.06879976665378207, - "0,3": -0.03186539327538562, - "0,4": 0.006348957784406473, - "0,5": 0.43256290683208176, - "0,6": -0.001343591904652719, - "0,7": 0.06253252257449615, - "1,2": -0.05260843083096711, - "1,3": 0.030375991777427558, - "1,4": 0.0001627696826771441, - "1,5": 0.050597850652254195, - "1,6": -0.0037661976376257567, - "1,7": 0.029956244518440034, - "2,3": 0.0021427617976605973, - "2,4": 0.0010206000064738596, - "2,5": 0.06281486401814362, - "2,6": -0.04518473112286059, - "2,7": 0.014457807951902879, - "3,4": 0.0002791536757293933, - "3,5": 0.03399004342480172, - "3,6": -0.003151879705281191, - "3,7": 0.01327791906929221, - "4,5": 0.041283992819152626, - "4,6": 0.00044805721857854586, - "4,7": -0.001308578845925279, - "5,6": 0.10611256477907083, - "5,7": -0.027675879294393635, - "6,7": 0.2660569037436613, - "0,1,2": -0.07581748269137689, - "0,1,3": -0.010425346893652376, - "0,1,4": 0.009689026349510854, - "0,1,5": 0.08613875427434481, - "0,1,6": 0.008184155718661046, - "0,1,7": 0.1325370254627951, - "0,2,3": -0.0069907282047319, - "0,2,4": -0.003968630745211588, - "0,2,5": -0.09423929931937414, - "0,2,6": 0.05579137023380776, - "0,2,7": -0.00830832294807271, - "0,3,4": -0.0025592651310846204, - "0,3,5": 0.06946101623610557, - "0,3,6": -0.0031458718027115307, - "0,3,7": -0.02632388995052337, - "0,4,5": 0.03678552244621436, - "0,4,6": -0.0026889975598956006, - "0,4,7": 0.018344894666615374, - "0,5,6": 0.12349834621387856, - "0,5,7": -0.17532339201209135, - "0,6,7": 0.18140110188899028, - "1,2,3": -0.028777980136038384, - "1,2,4": 0.0022331909268724637, - "1,2,5": 0.038926174766415134, - "1,2,6": -0.009492902856367058, - "1,2,7": -0.004578883747135887, - "1,3,4": 0.0012020909926775403, - "1,3,5": -0.02387365587728807, - "1,3,6": 0.0014008333929862449, - "1,3,7": -0.021069823921308295, - "1,4,5": -0.031194803271882066, - "1,4,6": 0.006668413176678767, - "1,4,7": 0.0010420137098954285, - "1,5,6": 0.06733775081541027, - "1,5,7": -0.030111770005249117, - "1,6,7": 0.10948547914483142, - "2,3,4": 0.00048570925087920713, - "2,3,5": -0.005009828674734429, - "2,3,6": -4.0524918107243124e-05, - "2,3,7": -0.0005770472903154911, - "2,4,5": -0.018662581163675362, - "2,4,6": -4.377242168751572e-05, - "2,4,7": 0.004378304036486647, - "2,5,6": 0.02858522866045443, - "2,5,7": 0.12048958750966543, - "2,6,7": 0.02654659882516408, - "3,4,5": -0.005911177670971046, - "3,4,6": 0.00018458610445581947, - "3,4,7": 7.734804350212343e-05, - "3,5,6": 0.0015856761539627673, - "3,5,7": -0.03097840566198906, - "3,6,7": -0.017008920996498533, - "4,5,6": -0.001953948306280706, - "4,5,7": -0.005557428416471222, - "4,6,7": 0.008964429344984426, - "5,6,7": -0.09793108117582316, - "0,1,2,3": 0.021832975829153556, - "0,1,2,4": 0.0006067056767027346, - "0,1,2,5": 0.07706417396680187, - "0,1,2,6": -0.010956652523762322, - "0,1,2,7": 0.004559316083175613, - "0,1,3,4": -0.002365434029293345, - "0,1,3,5": 0.06572462770294862, - "0,1,3,6": -0.006290308113023224, - "0,1,3,7": -0.012266269223661697, - "0,1,4,5": -0.007275617877784413, - "0,1,4,6": 0.0067755638551236785, - "0,1,4,7": 0.013170148672343007, - "0,1,5,6": 0.1234259163561795, - "0,1,5,7": -0.024080292581441398, - "0,1,6,7": 0.341058415458658, - "0,2,3,4": -0.0005438225507596872, - "0,2,3,5": 0.00999359944164091, - "0,2,3,6": 0.00019846167148585003, - "0,2,3,7": 0.000262205681313743, - "0,2,4,5": 0.012494997781556716, - "0,2,4,6": 0.0016852288546567173, - "0,2,4,7": -0.002129256894812581, - "0,2,5,6": -0.02800692284275641, - "0,2,5,7": -0.11023229945494384, - "0,2,6,7": -0.00453767308844899, - "0,3,4,5": -0.01044567766363258, - "0,3,4,6": 0.0015533443091240162, - "0,3,4,7": -0.0010578635573030848, - "0,3,5,6": -0.016869745684285897, - "0,3,5,7": 0.013690862415615346, - "0,3,6,7": -0.023903101119979953, - "0,4,5,6": -0.02026572327248166, - "0,4,5,7": -0.004011309549377451, - "0,4,6,7": 0.0193487721559924, - "0,5,6,7": -0.2432350225367892, - "1,2,3,4": -0.0026460051159427067, - "1,2,3,5": 0.007097792475822651, - "1,2,3,6": -0.003105139957997105, - "1,2,3,7": 0.012570300908113285, - "1,2,4,5": -0.0012376849243458388, - "1,2,4,6": 0.0007705684514915934, - "1,2,4,7": -0.0010044906454771407, - "1,2,5,6": 0.001551593863418077, - "1,2,5,7": 0.01642611385720416, - "1,2,6,7": -0.011653174562006319, - "1,3,4,5": -0.004152380818100099, - "1,3,4,6": -0.0011179834104424469, - "1,3,4,7": 0.0008914373364143913, - "1,3,5,6": -0.00012572767146323827, - "1,3,5,7": 0.022409737108020078, - "1,3,6,7": -0.015729300910097832, - "1,4,5,6": -0.001336559912982871, - "1,4,5,7": -0.0026731738195082677, - "1,4,6,7": 0.0022459287801390726, - "1,5,6,7": -0.0645313141140691, - "2,3,4,5": -0.005982683855967341, - "2,3,4,6": -5.934393262996274e-05, - "2,3,4,7": -0.00031220301786749616, - "2,3,5,6": 0.006103462900506562, - "2,3,5,7": -0.016749617579650433, - "2,3,6,7": 0.00872915932597107, - "2,4,5,6": -0.007041601038325629, - "2,4,5,7": -0.01711889198697758, - "2,4,6,7": 0.00202126968291938, - "2,5,6,7": 0.052663910664157765, - "3,4,5,6": 0.001468787098906299, - "3,4,5,7": -0.0015782542008047074, - "3,4,6,7": 0.00021981479773791612, - "3,5,6,7": 0.015737947650711792, - "4,5,6,7": -0.004772755752322944, - "0,1,2,3,4": 0.002438534912335255, - "0,1,2,3,5": 0.00017213517728498218, - "0,1,2,3,6": 0.006313981420871029, - "0,1,2,3,7": -0.007389629490702543, - "0,1,2,4,5": 0.007281323510058169, - "0,1,2,4,6": 0.0008707467870823216, - "0,1,2,4,7": 0.004414942965414781, - "0,1,2,5,6": 0.014658142705912258, - "0,1,2,5,7": -0.013423005474787697, - "0,1,2,6,7": 0.04175515475200964, - "0,1,3,4,5": -0.008684246825562347, - "0,1,3,4,6": 0.0007753394923153412, - "0,1,3,4,7": -0.0011815894669515714, - "0,1,3,5,6": -0.00790331541688083, - "0,1,3,5,7": -0.009163742218192716, - "0,1,3,6,7": -0.06108604602599055, - "0,1,4,5,6": -0.016331005330670667, - "0,1,4,5,7": -0.0033040477471826257, - "0,1,4,6,7": 0.0030215237900912406, - "0,1,5,6,7": -0.28831536596150764, - "0,2,3,4,5": 0.005334626273114207, - "0,2,3,4,6": 1.833059631017875e-05, - "0,2,3,4,7": 0.00046798421881111274, - "0,2,3,5,6": -0.006066053008254801, - "0,2,3,5,7": 0.01534772112247218, - "0,2,3,6,7": -0.008361459860165565, - "0,2,4,5,6": 0.0070780385391917555, - "0,2,4,5,7": 0.011084893382321326, - "0,2,4,6,7": 0.009025894667293421, - "0,2,5,6,7": -0.0793006816335069, - "0,3,4,5,6": 0.006758786502754965, - "0,3,4,5,7": -0.0010160758654724766, - "0,3,4,6,7": 0.001280034233994476, - "0,3,5,6,7": 0.04545840285931568, - "0,4,5,6,7": -0.028999171620032627, - "1,2,3,4,5": -0.0038252937864147185, - "1,2,3,4,6": 0.0005886977890046108, - "1,2,3,4,7": -8.818812980315727e-05, - "1,2,3,5,6": -0.0020155366827085963, - "1,2,3,5,7": 0.000735413898718118, - "1,2,3,6,7": 0.004503676809557877, - "1,2,4,5,6": -0.0019348661633880049, - "1,2,4,5,7": -0.0006665158763299317, - "1,2,4,6,7": -0.0014483322114204888, - "1,2,5,6,7": 0.000709103982243775, - "1,3,4,5,6": 6.241512244109515e-05, - "1,3,4,5,7": -1.991875915319241e-06, - "1,3,4,6,7": 4.002848462292263e-05, - "1,3,5,6,7": 0.024240947498535004, - "1,4,5,6,7": 8.262813266401992e-05, - "2,3,4,5,6": -0.0013196576832190665, - "2,3,4,5,7": 0.0007889542953827267, - "2,3,4,6,7": 0.0004442817690362144, - "2,3,5,6,7": -0.0011313345837922206, - "2,4,5,6,7": -0.0037988804929214304, - "3,4,5,6,7": 0.0013085503678089694, - "0,1,2,3,4,5": 0.004739847733266966, - "0,1,2,3,4,6": -0.0005477975438612503, - "0,1,2,3,4,7": -6.770616231843718e-05, - "0,1,2,3,5,6": -0.0018493791318521247, - "0,1,2,3,5,7": -0.0047934568143865874, - "0,1,2,3,6,7": 0.001305119926039211, - "0,1,2,4,5,6": -0.001152264077453058, - "0,1,2,4,5,7": 0.0012016136877011085, - "0,1,2,4,6,7": -0.00392618567509917, - "0,1,2,5,6,7": -0.02340489830348691, - "0,1,3,4,5,6": 0.00231851524328075, - "0,1,3,4,5,7": -0.0027854541920260267, - "0,1,3,4,6,7": 0.0007990834326583318, - "0,1,3,5,6,7": 0.07295658074026701, - "0,1,4,5,6,7": -0.008217309621684876, - "0,2,3,4,5,6": 0.001359758159024338, - "0,2,3,4,5,7": 9.941130258228625e-05, - "0,2,3,4,6,7": -0.0004441686778609011, - "0,2,3,5,6,7": 0.0018112462625299308, - "0,2,4,5,6,7": -0.006212927201959317, - "0,3,4,5,6,7": 0.003156279329737277, - "1,2,3,4,5,6": -0.0002113077880507852, - "1,2,3,4,5,7": -0.00028073989777865904, - "1,2,3,4,6,7": 7.81788897254998e-05, - "1,2,3,5,6,7": 0.0021280243778147856, - "1,2,4,5,6,7": 5.500077253195457e-06, - "1,3,4,5,6,7": 5.1292086500343004e-05, - "2,3,4,5,6,7": -0.000490028687636368, - "0,1,2,3,4,5,6": 0.00016156069743894497, - "0,1,2,3,4,5,7": -0.0006172723150031367, - "0,1,2,3,4,6,7": -8.70257352024173e-05, - "0,1,2,3,5,6,7": -0.008399169538999829, - "0,1,2,4,5,6,7": 0.0041642156401190955, - "0,1,3,4,5,6,7": -0.0001465503797392631, - "0,2,3,4,5,6,7": 0.0004819816114965958, - "1,2,3,4,5,6,7": 6.192791836068245e-05 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=STII_order=8.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=STII_order=8.json deleted file mode 100644 index d9b27dd6a..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=STII_order=8.json +++ /dev/null @@ -1,275 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.180107+00:00Z", - "metadata": { - "n_players": 8, - "index": "STII", - "max_order": 8, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 0.0 - }, - "data": { - "0": -0.16261418772220537, - "1": 0.25257380296742893, - "2": 0.03404012754182517, - "3": 0.044546921896047476, - "4": 0.004274599180631888, - "5": 0.866307829944895, - "6": -0.07646749671482511, - "7": 0.4381398989545833, - "0,1": 0.12305751039498114, - "0,2": 0.06879976665378207, - "0,3": -0.03186539327538562, - "0,4": 0.006348957784406473, - "0,5": 0.43256290683208176, - "0,6": -0.001343591904652719, - "0,7": 0.06253252257449615, - "1,2": -0.05260843083096711, - "1,3": 0.030375991777427558, - "1,4": 0.0001627696826771441, - "1,5": 0.050597850652254195, - "1,6": -0.0037661976376257567, - "1,7": 0.029956244518440034, - "2,3": 0.0021427617976605973, - "2,4": 0.0010206000064738596, - "2,5": 0.06281486401814362, - "2,6": -0.04518473112286059, - "2,7": 0.014457807951902879, - "3,4": 0.0002791536757293933, - "3,5": 0.03399004342480172, - "3,6": -0.003151879705281191, - "3,7": 0.01327791906929221, - "4,5": 0.041283992819152626, - "4,6": 0.00044805721857854586, - "4,7": -0.001308578845925279, - "5,6": 0.10611256477907083, - "5,7": -0.027675879294393635, - "6,7": 0.2660569037436613, - "0,1,2": -0.07581748269137689, - "0,1,3": -0.010425346893652376, - "0,1,4": 0.009689026349510854, - "0,1,5": 0.08613875427434481, - "0,1,6": 0.008184155718661046, - "0,1,7": 0.1325370254627951, - "0,2,3": -0.0069907282047319, - "0,2,4": -0.003968630745211588, - "0,2,5": -0.09423929931937414, - "0,2,6": 0.05579137023380776, - "0,2,7": -0.00830832294807271, - "0,3,4": -0.0025592651310846204, - "0,3,5": 0.06946101623610557, - "0,3,6": -0.0031458718027115307, - "0,3,7": -0.02632388995052337, - "0,4,5": 0.03678552244621436, - "0,4,6": -0.0026889975598956006, - "0,4,7": 0.018344894666615374, - "0,5,6": 0.12349834621387856, - "0,5,7": -0.17532339201209135, - "0,6,7": 0.18140110188899028, - "1,2,3": -0.028777980136038384, - "1,2,4": 0.0022331909268724637, - "1,2,5": 0.038926174766415134, - "1,2,6": -0.009492902856367058, - "1,2,7": -0.004578883747135887, - "1,3,4": 0.0012020909926775403, - "1,3,5": -0.02387365587728807, - "1,3,6": 0.0014008333929862449, - "1,3,7": -0.021069823921308295, - "1,4,5": -0.031194803271882066, - "1,4,6": 0.006668413176678767, - "1,4,7": 0.0010420137098954285, - "1,5,6": 0.06733775081541027, - "1,5,7": -0.030111770005249117, - "1,6,7": 0.10948547914483142, - "2,3,4": 0.00048570925087920713, - "2,3,5": -0.005009828674734429, - "2,3,6": -4.0524918107243124e-05, - "2,3,7": -0.0005770472903154911, - "2,4,5": -0.018662581163675362, - "2,4,6": -4.377242168751572e-05, - "2,4,7": 0.004378304036486647, - "2,5,6": 0.02858522866045443, - "2,5,7": 0.12048958750966543, - "2,6,7": 0.02654659882516408, - "3,4,5": -0.005911177670971046, - "3,4,6": 0.00018458610445581947, - "3,4,7": 7.734804350212343e-05, - "3,5,6": 0.0015856761539627673, - "3,5,7": -0.03097840566198906, - "3,6,7": -0.017008920996498533, - "4,5,6": -0.001953948306280706, - "4,5,7": -0.005557428416471222, - "4,6,7": 0.008964429344984426, - "5,6,7": -0.09793108117582316, - "0,1,2,3": 0.021832975829153556, - "0,1,2,4": 0.0006067056767027346, - "0,1,2,5": 0.07706417396680187, - "0,1,2,6": -0.010956652523762322, - "0,1,2,7": 0.004559316083175613, - "0,1,3,4": -0.002365434029293345, - "0,1,3,5": 0.06572462770294862, - "0,1,3,6": -0.006290308113023224, - "0,1,3,7": -0.012266269223661697, - "0,1,4,5": -0.007275617877784413, - "0,1,4,6": 0.0067755638551236785, - "0,1,4,7": 0.013170148672343007, - "0,1,5,6": 0.1234259163561795, - "0,1,5,7": -0.024080292581441398, - "0,1,6,7": 0.341058415458658, - "0,2,3,4": -0.0005438225507596872, - "0,2,3,5": 0.00999359944164091, - "0,2,3,6": 0.00019846167148585003, - "0,2,3,7": 0.000262205681313743, - "0,2,4,5": 0.012494997781556716, - "0,2,4,6": 0.0016852288546567173, - "0,2,4,7": -0.002129256894812581, - "0,2,5,6": -0.02800692284275641, - "0,2,5,7": -0.11023229945494384, - "0,2,6,7": -0.00453767308844899, - "0,3,4,5": -0.01044567766363258, - "0,3,4,6": 0.0015533443091240162, - "0,3,4,7": -0.0010578635573030848, - "0,3,5,6": -0.016869745684285897, - "0,3,5,7": 0.013690862415615346, - "0,3,6,7": -0.023903101119979953, - "0,4,5,6": -0.02026572327248166, - "0,4,5,7": -0.004011309549377451, - "0,4,6,7": 0.0193487721559924, - "0,5,6,7": -0.2432350225367892, - "1,2,3,4": -0.0026460051159427067, - "1,2,3,5": 0.007097792475822651, - "1,2,3,6": -0.003105139957997105, - "1,2,3,7": 0.012570300908113285, - "1,2,4,5": -0.0012376849243458388, - "1,2,4,6": 0.0007705684514915934, - "1,2,4,7": -0.0010044906454771407, - "1,2,5,6": 0.001551593863418077, - "1,2,5,7": 0.01642611385720416, - "1,2,6,7": -0.011653174562006319, - "1,3,4,5": -0.004152380818100099, - "1,3,4,6": -0.0011179834104424469, - "1,3,4,7": 0.0008914373364143913, - "1,3,5,6": -0.00012572767146323827, - "1,3,5,7": 0.022409737108020078, - "1,3,6,7": -0.015729300910097832, - "1,4,5,6": -0.001336559912982871, - "1,4,5,7": -0.0026731738195082677, - "1,4,6,7": 0.0022459287801390726, - "1,5,6,7": -0.0645313141140691, - "2,3,4,5": -0.005982683855967341, - "2,3,4,6": -5.934393262996274e-05, - "2,3,4,7": -0.00031220301786749616, - "2,3,5,6": 0.006103462900506562, - "2,3,5,7": -0.016749617579650433, - "2,3,6,7": 0.00872915932597107, - "2,4,5,6": -0.007041601038325629, - "2,4,5,7": -0.01711889198697758, - "2,4,6,7": 0.00202126968291938, - "2,5,6,7": 0.052663910664157765, - "3,4,5,6": 0.001468787098906299, - "3,4,5,7": -0.0015782542008047074, - "3,4,6,7": 0.00021981479773791612, - "3,5,6,7": 0.015737947650711792, - "4,5,6,7": -0.004772755752322944, - "0,1,2,3,4": 0.002438534912335255, - "0,1,2,3,5": 0.00017213517728498218, - "0,1,2,3,6": 0.006313981420871029, - "0,1,2,3,7": -0.007389629490702543, - "0,1,2,4,5": 0.007281323510058169, - "0,1,2,4,6": 0.0008707467870823216, - "0,1,2,4,7": 0.004414942965414781, - "0,1,2,5,6": 0.014658142705912258, - "0,1,2,5,7": -0.013423005474787697, - "0,1,2,6,7": 0.04175515475200964, - "0,1,3,4,5": -0.008684246825562347, - "0,1,3,4,6": 0.0007753394923153412, - "0,1,3,4,7": -0.0011815894669515714, - "0,1,3,5,6": -0.00790331541688083, - "0,1,3,5,7": -0.009163742218192716, - "0,1,3,6,7": -0.06108604602599055, - "0,1,4,5,6": -0.016331005330670667, - "0,1,4,5,7": -0.0033040477471826257, - "0,1,4,6,7": 0.0030215237900912406, - "0,1,5,6,7": -0.28831536596150764, - "0,2,3,4,5": 0.005334626273114207, - "0,2,3,4,6": 1.833059631017875e-05, - "0,2,3,4,7": 0.00046798421881111274, - "0,2,3,5,6": -0.006066053008254801, - "0,2,3,5,7": 0.01534772112247218, - "0,2,3,6,7": -0.008361459860165565, - "0,2,4,5,6": 0.0070780385391917555, - "0,2,4,5,7": 0.011084893382321326, - "0,2,4,6,7": 0.009025894667293421, - "0,2,5,6,7": -0.0793006816335069, - "0,3,4,5,6": 0.006758786502754965, - "0,3,4,5,7": -0.0010160758654724766, - "0,3,4,6,7": 0.001280034233994476, - "0,3,5,6,7": 0.04545840285931568, - "0,4,5,6,7": -0.028999171620032627, - "1,2,3,4,5": -0.0038252937864147185, - "1,2,3,4,6": 0.0005886977890046108, - "1,2,3,4,7": -8.818812980315727e-05, - "1,2,3,5,6": -0.0020155366827085963, - "1,2,3,5,7": 0.000735413898718118, - "1,2,3,6,7": 0.004503676809557877, - "1,2,4,5,6": -0.0019348661633880049, - "1,2,4,5,7": -0.0006665158763299317, - "1,2,4,6,7": -0.0014483322114204888, - "1,2,5,6,7": 0.000709103982243775, - "1,3,4,5,6": 6.241512244109515e-05, - "1,3,4,5,7": -1.991875915319241e-06, - "1,3,4,6,7": 4.002848462292263e-05, - "1,3,5,6,7": 0.024240947498535004, - "1,4,5,6,7": 8.262813266401992e-05, - "2,3,4,5,6": -0.0013196576832190665, - "2,3,4,5,7": 0.0007889542953827267, - "2,3,4,6,7": 0.0004442817690362144, - "2,3,5,6,7": -0.0011313345837922206, - "2,4,5,6,7": -0.0037988804929214304, - "3,4,5,6,7": 0.0013085503678089694, - "0,1,2,3,4,5": 0.004739847733266966, - "0,1,2,3,4,6": -0.0005477975438612503, - "0,1,2,3,4,7": -6.770616231843718e-05, - "0,1,2,3,5,6": -0.0018493791318521247, - "0,1,2,3,5,7": -0.0047934568143865874, - "0,1,2,3,6,7": 0.001305119926039211, - "0,1,2,4,5,6": -0.001152264077453058, - "0,1,2,4,5,7": 0.0012016136877011085, - "0,1,2,4,6,7": -0.00392618567509917, - "0,1,2,5,6,7": -0.02340489830348691, - "0,1,3,4,5,6": 0.00231851524328075, - "0,1,3,4,5,7": -0.0027854541920260267, - "0,1,3,4,6,7": 0.0007990834326583318, - "0,1,3,5,6,7": 0.07295658074026701, - "0,1,4,5,6,7": -0.008217309621684876, - "0,2,3,4,5,6": 0.001359758159024338, - "0,2,3,4,5,7": 9.941130258228625e-05, - "0,2,3,4,6,7": -0.0004441686778609011, - "0,2,3,5,6,7": 0.0018112462625299308, - "0,2,4,5,6,7": -0.006212927201959317, - "0,3,4,5,6,7": 0.003156279329737277, - "1,2,3,4,5,6": -0.0002113077880507852, - "1,2,3,4,5,7": -0.00028073989777865904, - "1,2,3,4,6,7": 7.81788897254998e-05, - "1,2,3,5,6,7": 0.0021280243778147856, - "1,2,4,5,6,7": 5.500077253195457e-06, - "1,3,4,5,6,7": 5.1292086500343004e-05, - "2,3,4,5,6,7": -0.000490028687636368, - "0,1,2,3,4,5,6": 0.00017040754291519633, - "0,1,2,3,4,5,7": -0.0006084254695237767, - "0,1,2,3,4,6,7": -7.817888972239118e-05, - "0,1,2,3,5,6,7": -0.008390322693524244, - "0,1,2,4,5,6,7": 0.004173062485612888, - "0,1,3,4,5,6,7": -0.0001377035342553512, - "0,2,3,4,5,6,7": 0.0004908284569813404, - "1,2,3,4,5,6,7": 7.077476384420578e-05, - "0,1,2,3,4,5,6,7": -7.077476384909076e-05 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=SV_order=1.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=SV_order=1.json deleted file mode 100644 index a44f15db6..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=SV_order=1.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.210736+00:00Z", - "metadata": { - "n_players": 8, - "index": "SV", - "max_order": 1, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.072184995821221 - }, - "data": { - "0": 0.25171782460956404, - "1": 0.49724787386124647, - "2": 0.06500520944389898, - "3": 0.05833923465868318, - "4": 0.022194402466152785, - "5": 1.130942443361428, - "6": 0.21431031163344444, - "7": 0.6057811263686717 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=k-SII_order=1.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=k-SII_order=1.json deleted file mode 100644 index c72e1ad88..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=k-SII_order=1.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.235132+00:00Z", - "metadata": { - "n_players": 8, - "index": "SV", - "max_order": 1, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.072184995821221 - }, - "data": { - "0": 0.25171782460956404, - "1": 0.49724787386124647, - "2": 0.06500520944389898, - "3": 0.05833923465868318, - "4": 0.022194402466152785, - "5": 1.130942443361428, - "6": 0.21431031163344444, - "7": 0.6057811263686717 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=k-SII_order=2.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=k-SII_order=2.json deleted file mode 100644 index 2625c2284..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=k-SII_order=2.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.227064+00:00Z", - "metadata": { - "n_players": 8, - "index": "k-SII", - "max_order": 2, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.072184995821221 - }, - "data": { - "0": -0.16429762146676746, - "1": 0.16110291434472462, - "2": 0.03797843589669608, - "3": 0.024058419671368847, - "4": 0.015232402419435576, - "5": 0.9879890733151611, - "6": -0.09831147599334589, - "7": 0.5099428132998566, - "0,1": 0.31792824855247537, - "0,2": -0.01136626832778509, - "0,3": -0.0011318219780405148, - "0,4": 0.03546966075328439, - "0,5": 0.3214991189685559, - "0,6": 0.14395103309364898, - "0,7": 0.025680921090524, - "1,2": -0.04679993437970997, - "1,3": 0.015075530383837354, - "1,4": -0.01028346570188543, - "1,5": 0.10407560569961094, - "1,6": 0.14535778179023118, - "1,7": 0.14693615268848426, - "2,3": -0.0049436241892806265, - "2,4": -0.004888611421182798, - "2,5": 0.07819297464559072, - "2,6": -0.003490945945392454, - "2,7": 0.04734995671216602, - "3,4": -0.009113704183641547, - "3,5": 0.09440254198546572, - "3,6": -0.0065878947478539285, - "3,7": -0.019139397295857785, - "4,5": -0.004731958997510555, - "4,6": -0.0010225603174927045, - "4,7": 0.00849463996186306, - "5,6": 0.028575133095404937, - "5,7": -0.33610667530458416, - "6,7": 0.31846102828503464 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=k-SII_order=3.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=k-SII_order=3.json deleted file mode 100644 index f6de9444e..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=k-SII_order=3.json +++ /dev/null @@ -1,112 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.233712+00:00Z", - "metadata": { - "n_players": 8, - "index": "k-SII", - "max_order": 3, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.072184995821221 - }, - "data": { - "0": -0.17212483176010082, - "1": 0.24459896085949254, - "2": 0.0309838285389986, - "3": 0.04985963860147456, - "4": 0.0036511765441289636, - "5": 0.857854504344758, - "6": -0.08501876527570541, - "7": 0.42876708309224243, - "0,1": 0.09900644507945122, - "0,2": 0.08149154383678603, - "0,3": -0.052370421103168086, - "0,4": 0.006600970495503733, - "0,5": 0.5365918648932584, - "0,6": 0.05506057953015636, - "0,7": 0.15261317118067552, - "1,2": -0.07505497878617406, - "1,3": 0.012819226279054297, - "1,4": 0.005753791297307687, - "1,5": 0.082177398983932, - "1,6": -0.004254163959380108, - "1,7": 0.05086592105024501, - "2,3": -0.003872243290450883, - "2,4": -0.00437831141794609, - "2,5": 0.0853881233614463, - "2,6": -0.03104747594462043, - "2,7": 0.04349453348154986, - "3,4": 0.0013099784477971221, - "3,5": -0.015803674025851977, - "3,6": -0.02067419578529006, - "3,7": -0.007654354128096119, - "4,5": 0.06169510484354518, - "4,6": 0.008310220790401335, - "4,7": 0.0041196008886651425, - "5,6": 0.20973277363240728, - "5,7": 0.10693256222621383, - "6,7": 0.32835957268406324, - "0,1,2": -0.01831571120936748, - "0,1,3": 0.010521120947223128, - "0,1,4": 0.010361172532846297, - "0,1,5": 0.1040135055520307, - "0,1,6": 0.14181636540842402, - "0,1,7": 0.18944715371489163, - "0,2,3": 0.010347990377784777, - "0,2,4": 0.017673539389719606, - "0,2,5": -0.13408842583411595, - "0,2,6": 0.021309279112123214, - "0,2,7": -0.0826422961652864, - "0,3,4": -0.004812551869708859, - "0,3,5": 0.13146709376709176, - "0,3,6": -0.01479002618880032, - "0,3,7": -0.030256428783335343, - "0,4,5": 0.01453426978784822, - "0,4,6": -0.0059457654625518774, - "0,4,7": 0.025926716137407935, - "0,5,6": -0.0771906178902444, - "0,5,7": -0.46892131723201547, - "0,6,7": 0.1125816721480346, - "1,2,3": -0.012078836273108351, - "1,2,4": 0.003714938017095104, - "1,2,5": 0.08310784164704299, - "1,2,6": -0.007572114955466613, - "1,2,7": 0.007653971586732533, - "1,3,4": -0.005890133081621007, - "1,3,5": 0.035753261068938835, - "1,3,6": -0.005704389939261478, - "1,3,7": -0.01808841451260501, - "1,4,5": -0.04900046155184756, - "1,4,6": 0.003706866958111066, - "1,4,7": 0.00503310312702987, - "1,5,6": 0.014402390691089506, - "1,5,7": -0.1444801239758966, - "1,6,7": 0.15257477333632607, - "2,3,4": -0.0016140825821560068, - "2,3,5": -0.0031416930376553243, - "2,3,6": 0.0027769014296976646, - "2,3,7": 0.0015669582877777533, - "2,4,5": -0.020819056254380852, - "2,4,6": -0.00011268776717221485, - "2,4,7": 0.00013674919042094835, - "2,5,6": 0.009133627332542193, - "2,5,7": 0.05141740871485578, - "2,6,7": 0.029578054846731705, - "3,4,5": -0.01447948633555507, - "3,4,6": 0.006144712079016124, - "3,4,7": -0.00019582347285251878, - "3,5,6": 0.04327751955427184, - "3,5,7": 0.027535737005543348, - "3,6,7": -0.0035321148600515606, - "4,5,6": -0.03169870725787849, - "4,5,7": -0.03139068607029771, - "4,6,7": 0.009240019234687313, - "5,6,7": -0.32023949350378533 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=k-SII_order=4.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=k-SII_order=4.json deleted file mode 100644 index afea53c05..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=k-SII_order=4.json +++ /dev/null @@ -1,182 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.218645+00:00Z", - "metadata": { - "n_players": 8, - "index": "k-SII", - "max_order": 4, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.072184995821221 - }, - "data": { - "0": -0.17212483176010082, - "1": 0.24459896085949254, - "2": 0.0309838285389986, - "3": 0.04985963860147456, - "4": 0.0036511765441289636, - "5": 0.857854504344758, - "6": -0.08501876527570541, - "7": 0.42876708309224243, - "0,1": 0.12386067997592498, - "0,2": 0.06737337737538941, - "0,3": -0.02998635751795968, - "0,4": 0.006350369511056589, - "0,5": 0.4335018688210669, - "0,6": -0.00040297304252678856, - "0,7": 0.06319242452466708, - "1,2": -0.053899613389965066, - "1,3": 0.03207945377016598, - "1,4": 0.00018532928343719296, - "1,5": 0.05155110820027238, - "1,6": -0.002781199924201585, - "1,7": 0.03070022247813389, - "2,3": 0.0015318081579332268, - "2,4": 0.0011670678713501977, - "2,5": 0.06156196041803711, - "2,6": -0.04654349847773154, - "2,7": 0.012986141595930034, - "3,4": 0.0005205236752738508, - "3,5": 0.03588658229056291, - "3,6": -0.0010707933613676966, - "3,7": 0.014997511505421703, - "4,5": 0.04140653369749086, - "4,6": 0.0003809330382943416, - "4,7": -0.001560598419070895, - "5,6": 0.10720884406579416, - "5,7": -0.026878634369335158, - "6,7": 0.2670440243440155, - "0,1,2": -0.07676546528337191, - "0,1,3": -0.011422563626659554, - "0,1,4": 0.012349363243014777, - "0,1,5": 0.13201564614394196, - "0,1,6": 0.050956342217230166, - "0,1,7": 0.18158487487305053, - "0,2,3": -0.00622500995789077, - "0,2,4": -0.011954295423133976, - "0,2,5": -0.07961063416445358, - "0,2,6": 0.067505247655953, - "0,2,7": 0.006043531612134667, - "0,3,4": -0.005675648143116385, - "0,3,5": 0.04606746227507397, - "0,3,6": -0.017153099046847697, - "0,3,7": -0.03741832476155488, - "0,4,5": 0.04042194212927569, - "0,4,6": 0.0019160704248464833, - "0,4,7": 0.02218355419135759, - "0,5,6": 0.17326569283552373, - "0,5,7": -0.12380562463561873, - "0,6,7": 0.23407196847637834, - "1,2,3": -0.026467826341128986, - "1,2,4": -9.313605871819064e-05, - "1,2,5": 0.0459475655180448, - "1,2,6": -0.012026076783772432, - "1,2,7": -0.0010171646153790403, - "1,3,4": 0.002023191353620335, - "1,3,5": -0.03818609487665464, - "1,3,6": -0.00957651048260083, - "1,3,7": -0.027418952763680338, - "1,4,5": -0.02663546959321117, - "1,4,6": 0.010511873816171524, - "1,4,7": 0.003180435323959452, - "1,5,6": 0.10406376378556154, - "1,5,7": 0.01034874715563322, - "1,6,7": 0.14645671473556143, - "2,3,4": -0.001371227956717569, - "2,3,5": -0.004471388916300445, - "2,3,6": 0.0026899480414547816, - "2,3,7": 0.001278434642618842, - "2,4,5": -0.023029803402707494, - "2,4,6": -0.0001703141096383587, - "2,4,7": 0.002325901208664438, - "2,5,6": 0.04884541833018696, - "2,5,7": 0.1408855228639737, - "2,6,7": 0.041244972062938645, - "3,4,5": -0.007773755020718531, - "3,4,6": -0.003123579699578438, - "3,4,7": -0.00018961716122711803, - "3,5,6": -0.02625854026277863, - "3,5,7": -0.05910678907447564, - "3,6,7": -0.036026031018311144, - "4,5,6": 0.00516974925828545, - "4,5,7": 0.0007246358232904648, - "4,6,7": 0.01460636460676723, - "5,6,7": -0.052257787621105, - "0,1,2,3": 0.019955244677778428, - "0,1,2,4": 0.009092043882777512, - "0,1,2,5": 0.07181098513756501, - "0,1,2,6": 0.009938479199153027, - "0,1,2,7": 0.0061027552507348926, - "0,1,3,4": -0.004383548843306717, - "0,1,3,5": 0.07420826159609117, - "0,1,3,6": -0.014369391835438727, - "0,1,3,7": -0.03152319644735879, - "0,1,4,5": -0.018207776180018342, - "0,1,4,6": -0.0016137112411539478, - "0,1,4,7": 0.011136610961364535, - "0,1,5,6": -0.013029734698287276, - "0,1,5,7": -0.17078601703917307, - "0,1,6,7": 0.20079440495811463, - "0,2,3,4": 0.005278533343863301, - "0,2,3,5": 0.01574509040077887, - "0,2,3,6": -0.005270183771403647, - "0,2,3,7": -0.0025626839796658585, - "0,2,4,5": 0.028938565136177652, - "0,2,4,6": 0.007715414090033623, - "0,2,4,7": 0.008231113172855076, - "0,2,5,6": -0.07054151531026132, - "0,2,5,7": -0.15490870870358497, - "0,2,6,7": -0.03423413129518127, - "0,3,4,5": -0.006321724966334097, - "0,3,4,6": 0.008280663144013323, - "0,3,4,7": -0.0011277301314207566, - "0,3,5,6": 0.02685764580876948, - "0,3,5,7": 0.06030999014473015, - "0,3,6,7": -0.010772587629845676, - "0,4,5,6": -0.03776838816483585, - "0,4,5,7": -0.0184160205078443, - "0,4,6,7": 0.007662350397146134, - "0,5,6,7": -0.4064306290869213, - "1,2,3,4": -0.001977815112278347, - "1,2,3,5": 0.002338601522094863, - "1,2,3,6": -0.00017976881825443325, - "1,2,3,7": 0.00864171786670076, - "1,2,4,5": 0.001561155373870915, - "1,2,4,6": -0.0010394056308075106, - "1,2,4,7": -1.9830361935979646e-05, - "1,2,5,6": -0.00190960025886866, - "1,2,5,7": 0.0005194104833342594, - "1,2,6,7": 0.0020982191653892146, - "1,3,4,5": -0.009239946732786275, - "1,3,4,6": 0.0004367484917590092, - "1,3,4,7": -0.0006620866738703546, - "1,3,5,6": 0.030111903498860504, - "1,3,5,7": 0.05045989200692669, - "1,3,6,7": -0.008255250250247648, - "1,4,5,6": -0.011743851697420093, - "1,4,5,7": -0.0070995646809189905, - "1,4,6,7": 0.000350206361501626, - "1,5,6,7": -0.18275146303322853, - "2,3,4,5": -0.003737647661951171, - "2,3,4,6": -0.00012933656421842965, - "2,3,4,7": 8.055674370777144e-05, - "2,3,5,6": -0.0001754566164225979, - "2,3,5,7": -0.011511195887209724, - "2,3,6,7": 0.005928652546784874, - "2,4,5,6": -0.00805092708520283, - "2,4,5,7": -0.014289651466241282, - "2,4,6,7": 0.001619507875127435, - "2,5,6,7": 0.0012539172754658656, - "3,4,5,6": 0.007069758889350575, - "3,4,5,7": -0.0011819021579521083, - "3,4,6,7": 0.0028787495962846466, - "3,5,6,7": 0.07520826805354297, - "4,5,6,7": -0.023243504974219675 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=k-SII_order=5.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=k-SII_order=5.json deleted file mode 100644 index 29996c063..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=k-SII_order=5.json +++ /dev/null @@ -1,238 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.222279+00:00Z", - "metadata": { - "n_players": 8, - "index": "k-SII", - "max_order": 5, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.072184995821221 - }, - "data": { - "0": -0.16250399620376957, - "1": 0.2526939957642752, - "2": 0.034145355291269254, - "3": 0.04475478693169256, - "4": 0.004183335997716712, - "5": 0.8664144749477715, - "6": -0.076373476630516, - "7": 0.43825246268204404, - "0,1": 0.12386067997592498, - "0,2": 0.06737337737538941, - "0,3": -0.02998635751795968, - "0,4": 0.006350369511056589, - "0,5": 0.4335018688210669, - "0,6": -0.00040297304252678856, - "0,7": 0.06319242452466708, - "1,2": -0.053899613389965066, - "1,3": 0.03207945377016598, - "1,4": 0.00018532928343719296, - "1,5": 0.05155110820027238, - "1,6": -0.002781199924201585, - "1,7": 0.03070022247813389, - "2,3": 0.0015318081579332268, - "2,4": 0.0011670678713501977, - "2,5": 0.06156196041803711, - "2,6": -0.04654349847773154, - "2,7": 0.012986141595930034, - "3,4": 0.0005205236752738508, - "3,5": 0.03588658229056291, - "3,6": -0.0010707933613676966, - "3,7": 0.014997511505421703, - "4,5": 0.04140653369749086, - "4,6": 0.0003809330382943416, - "4,7": -0.001560598419070895, - "5,6": 0.10720884406579416, - "5,7": -0.026878634369335158, - "6,7": 0.2670440243440155, - "0,1,2": -0.07598116248917312, - "0,1,3": -0.010732718892110565, - "0,1,4": 0.009800433857023729, - "0,1,5": 0.08597309032173234, - "0,1,6": 0.00803616665204105, - "0,1,7": 0.13236307529575977, - "0,2,3": -0.007277149136816465, - "0,2,4": -0.003836272171324501, - "0,2,5": -0.0943840122056135, - "0,2,6": 0.05566433223356296, - "0,2,7": -0.008461322048733507, - "0,3,4": -0.002570598757859291, - "0,3,5": 0.06917261114920449, - "0,3,6": -0.0034166020036185563, - "0,3,7": -0.026620581251845847, - "0,4,5": 0.03691589686528457, - "0,4,6": -0.0025409482548307363, - "0,4,7": 0.01846698287126479, - "0,5,6": 0.12336932405881552, - "0,5,7": -0.1754783752675694, - "0,6,7": 0.18126379351950625, - "1,2,3": -0.029078402857894276, - "1,2,4": 0.002351547710988851, - "1,2,5": 0.03876746009040396, - "1,2,6": -0.009633942646384175, - "1,2,7": -0.004745884637567902, - "1,3,4": 0.001176755576132708, - "1,3,5": -0.02417606275395991, - "1,3,6": 0.0011161014023073866, - "1,3,7": -0.02138051701240159, - "1,4,5": -0.031078430642581905, - "1,4,6": 0.006802460691972453, - "1,4,7": 0.001150100124774363, - "1,5,6": 0.0671947268705748, - "1,5,7": -0.030280755050498445, - "1,6,7": 0.10933416898557494, - "2,3,4": 0.0004813249007084574, - "2,3,5": -0.005291284485031226, - "2,3,6": -0.0003043058424115342, - "2,3,7": -0.0008667893150332748, - "2,4,5": -0.018525257468001172, - "2,4,6": 0.00011122615998080765, - "2,4,7": 0.004507341517741551, - "2,5,6": 0.0284631557819952, - "2,5,7": 0.1203415535307929, - "2,6,7": 0.02641623973228431, - "3,4,5": -0.005917546175956412, - "3,4,6": 0.0001958924854622195, - "3,4,7": 6.269332409529027e-05, - "3,5,6": 0.0013199110748420035, - "3,5,7": -0.03127013184152253, - "3,6,7": -0.01728297229004099, - "4,5,6": -0.001800933879430348, - "4,5,7": -0.005430375090033653, - "4,6,7": 0.009109157557414486, - "5,6,7": -0.09806342442352092, - "0,1,2,3": 0.024283066801290998, - "0,1,2,4": -0.0003275296385001347, - "0,1,2,5": 0.08245898208062097, - "0,1,2,6": -0.004974928071641127, - "0,1,2,7": 0.010754100211045392, - "0,1,3,4": -0.002923474597658182, - "0,1,3,5": 0.05622292890760672, - "0,1,3,6": -0.016657146734643358, - "0,1,3,7": -0.021177073636124755, - "0,1,4,5": -0.007504545500332194, - "0,1,4,6": 0.007552559090167832, - "0,1,4,7": 0.014520185541932018, - "0,1,5,6": 0.1177180803603024, - "0,1,5,7": -0.02864439209876246, - "0,1,6,7": 0.3356025351293367, - "0,2,3,4": -0.0013728055002374395, - "0,2,3,5": 0.011871305326390469, - "0,2,3,6": 0.0018990473308097, - "0,2,3,7": 0.002778221786651547, - "0,2,4,5": 0.011453855356190146, - "0,2,4,6": 0.0023380288877330457, - "0,2,4,7": -0.001544018990335294, - "0,2,5,6": -0.022188606979396397, - "0,2,5,7": -0.10391085087617036, - "0,2,6,7": 0.0015800142791756455, - "0,3,4,5": -0.011884614912818114, - "0,3,4,6": 0.0003562933538022728, - "0,3,4,7": -0.0010795021078160438, - "0,3,5,6": -0.028173982465324654, - "0,3,5,7": 0.004132732883398105, - "0,3,6,7": -0.035117048027924036, - "0,4,5,6": -0.019960648219630728, - "0,4,5,7": -0.0028431198223173304, - "0,4,6,7": 0.020732207191194174, - "0,5,6,7": -0.24892925148723755, - "1,2,3,4": -0.0031318297121639693, - "1,2,3,5": 0.00935291828921525, - "1,2,3,6": -0.0011775508313561778, - "1,2,3,7": 0.015114834689646917, - "1,2,4,5": -0.0028850156150573847, - "1,2,4,6": 0.0006667637578985364, - "1,2,4,7": -0.0013743432587927096, - "1,2,5,6": 0.006647566575493369, - "1,2,5,7": 0.021826733493569228, - "1,2,6,7": -0.006606732598112508, - "1,3,4,5": -0.0046436039122256245, - "1,3,4,6": -0.0015177366720268148, - "1,3,4,7": 0.0014686106885176686, - "1,3,5,6": -0.010598405183380177, - "1,3,5,7": 0.013484681053802405, - "1,3,6,7": -0.026460590801364092, - "1,4,5,6": -0.0011835337849968042, - "1,4,5,7": -0.0018555188084363738, - "1,4,6,7": 0.003128412638030764, - "1,5,6,7": -0.07069223266644242, - "2,3,4,5": -0.006861837887267019, - "2,3,4,6": -0.00015900853053441022, - "2,3,4,7": -7.554476523019549e-05, - "2,3,5,6": 0.007581221113469261, - "2,3,5,7": -0.014364841672133033, - "2,3,6,7": 0.009995720997295288, - "2,4,5,6": -0.007129758668369401, - "2,4,5,7": -0.01718302449708098, - "2,4,6,7": 0.002709985620489519, - "2,5,6,7": 0.057959571252664155, - "3,4,5,6": 0.00031069133021288664, - "3,4,5,7": -0.0014693503161479216, - "3,4,6,7": -0.0003704890345087586, - "3,5,6,7": 0.0044818868133997825, - "4,5,6,7": -0.003949564863249044, - "0,1,2,3,4": 0.0043109476294724836, - "0,1,2,3,5": -0.0037398328268727354, - "0,1,2,3,6": 0.0029842280082932326, - "0,1,2,3,7": -0.012210987057918121, - "0,1,2,4,5": 0.010903243343854285, - "0,1,2,4,6": -0.0005383068391533463, - "0,1,2,4,7": 0.004163262908381871, - "0,1,2,5,6": 8.822737021985105e-05, - "0,1,2,5,7": -0.02854763177331332, - "0,1,2,6,7": 0.02729266600222857, - "0,1,3,4,5": -0.006757393277884383, - "0,1,3,4,6": 0.0020273880737033956, - "0,1,3,4,7": -0.0025010909165885664, - "0,1,3,5,6": 0.026005976423050026, - "0,1,3,5,7": 0.020461915058676006, - "0,1,3,6,7": -0.026442082706637393, - "0,1,4,5,6": -0.01847230608480377, - "0,1,4,5,7": -0.007080005340538431, - "0,1,4,6,7": -0.0013493158123898397, - "0,1,5,6,7": -0.26911752782564546, - "0,2,3,4,5": 0.00843404468971043, - "0,2,3,4,6": 0.0003788852440558266, - "0,2,3,4,7": 0.00017880012496274134, - "0,2,3,5,6": -0.007999296285578605, - "0,2,3,5,7": 0.011052654571517717, - "0,2,3,6,7": -0.009702279171197148, - "0,2,4,5,6": 0.005669061116536422, - "0,2,4,5,7": 0.009963070409873875, - "0,2,4,6,7": 0.005245130883162252, - "0,2,5,6,7": -0.0944638088629075, - "0,3,4,5,6": 0.010332879999694233, - "0,3,4,5,7": -0.0008837515185522449, - "0,3,4,6,7": 0.0031095862629686444, - "0,3,5,6,7": 0.08172369641102262, - "0,4,5,6,7": -0.03314511492183714, - "1,2,3,4,5": -0.0018415018412487605, - "1,2,3,4,6": 0.0002848753492941114, - "1,2,3,4,7": -0.00044629193774659015, - "1,2,3,5,6": -0.004715941773637766, - "1,2,3,5,7": -0.003731357092481513, - "1,2,3,6,7": 0.0034424024422539112, - "1,2,4,5,6": -0.001160180817689982, - "1,2,4,5,7": 0.0009907812929410564, - "1,2,4,6,7": -0.001998726469862877, - "1,2,5,6,7": -0.01132643844761616, - "1,3,4,5,6": 0.0011584641265134366, - "1,3,4,5,7": -0.0017522546485015944, - "1,3,4,6,7": 0.00043824277806070455, - "1,3,5,6,7": 0.058972118588555666, - "1,4,5,6,7": -0.0026466130488662643, - "2,3,4,5,6": -0.0007641369446038659, - "2,3,4,5,7": 0.00041997454677389356, - "2,3,4,6,7": 0.0001597202838858891, - "2,3,5,6,7": -0.00203398045596348, - "2,4,5,6,7": -0.005587080187909432, - "3,4,5,6,7": 0.0027909279366715722 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=k-SII_order=6.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=k-SII_order=6.json deleted file mode 100644 index 9a8d8cd96..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=k-SII_order=6.json +++ /dev/null @@ -1,266 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.226258+00:00Z", - "metadata": { - "n_players": 8, - "index": "k-SII", - "max_order": 6, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.072184995821221 - }, - "data": { - "0": -0.16250399620376957, - "1": 0.2526939957642752, - "2": 0.034145355291269254, - "3": 0.04475478693169256, - "4": 0.004183335997716712, - "5": 0.8664144749477715, - "6": -0.076373476630516, - "7": 0.43825246268204404, - "0,1": 0.12305919550840819, - "0,2": 0.06880145176720548, - "0,3": -0.031863708161956855, - "0,4": 0.006350642897831716, - "0,5": 0.4325645919455088, - "0,6": -0.0013419067912261548, - "0,7": 0.06253420768792307, - "1,2": -0.05260674571754243, - "1,3": 0.030377676890856135, - "1,4": 0.00016445479610270025, - "1,5": 0.05059953576568108, - "1,6": -0.0037645125241990364, - "1,7": 0.029957929631867934, - "2,3": 0.002144446911085221, - "2,4": 0.0010222851198993432, - "2,5": 0.06281654913156608, - "2,6": -0.045183046009438045, - "2,7": 0.014459493065326621, - "3,4": 0.0002808387891543609, - "3,5": 0.03399172853822861, - "3,6": -0.0031501945918531414, - "3,7": 0.013279604182720924, - "4,5": 0.041285677932576446, - "4,6": 0.0004497423320023615, - "4,7": -0.0013068937325007692, - "5,6": 0.10611424989249721, - "5,7": -0.027674194180967636, - "6,7": 0.26605858885708755, - "0,1,2": -0.07598116248917312, - "0,1,3": -0.010732718892110565, - "0,1,4": 0.009800433857023729, - "0,1,5": 0.08597309032173234, - "0,1,6": 0.00803616665204105, - "0,1,7": 0.13236307529575977, - "0,2,3": -0.007277149136816465, - "0,2,4": -0.003836272171324501, - "0,2,5": -0.0943840122056135, - "0,2,6": 0.05566433223356296, - "0,2,7": -0.008461322048733507, - "0,3,4": -0.002570598757859291, - "0,3,5": 0.06917261114920449, - "0,3,6": -0.0034166020036185563, - "0,3,7": -0.026620581251845847, - "0,4,5": 0.03691589686528457, - "0,4,6": -0.0025409482548307363, - "0,4,7": 0.01846698287126479, - "0,5,6": 0.12336932405881552, - "0,5,7": -0.1754783752675694, - "0,6,7": 0.18126379351950625, - "1,2,3": -0.029078402857894276, - "1,2,4": 0.002351547710988851, - "1,2,5": 0.03876746009040396, - "1,2,6": -0.009633942646384175, - "1,2,7": -0.004745884637567902, - "1,3,4": 0.001176755576132708, - "1,3,5": -0.02417606275395991, - "1,3,6": 0.0011161014023073866, - "1,3,7": -0.02138051701240159, - "1,4,5": -0.031078430642581905, - "1,4,6": 0.006802460691972453, - "1,4,7": 0.001150100124774363, - "1,5,6": 0.0671947268705748, - "1,5,7": -0.030280755050498445, - "1,6,7": 0.10933416898557494, - "2,3,4": 0.0004813249007084574, - "2,3,5": -0.005291284485031226, - "2,3,6": -0.0003043058424115342, - "2,3,7": -0.0008667893150332748, - "2,4,5": -0.018525257468001172, - "2,4,6": 0.00011122615998080765, - "2,4,7": 0.004507341517741551, - "2,5,6": 0.0284631557819952, - "2,5,7": 0.1203415535307929, - "2,6,7": 0.02641623973228431, - "3,4,5": -0.005917546175956412, - "3,4,6": 0.0001958924854622195, - "3,4,7": 6.269332409529027e-05, - "3,5,6": 0.0013199110748420035, - "3,5,7": -0.03127013184152253, - "3,6,7": -0.01728297229004099, - "4,5,6": -0.001800933879430348, - "4,5,7": -0.005430375090033653, - "4,6,7": 0.009109157557414486, - "5,6,7": -0.09806342442352092, - "0,1,2,3": 0.02183061667035916, - "0,1,2,4": 0.000604346517907972, - "0,1,2,5": 0.07706181480800423, - "0,1,2,6": -0.010959011682558566, - "0,1,2,7": 0.004556956924380185, - "0,1,3,4": -0.0023677931880867757, - "0,1,3,5": 0.06572226854415275, - "0,1,3,6": -0.006292667271817249, - "0,1,3,7": -0.01226862838245635, - "0,1,4,5": -0.007277977036581729, - "0,1,4,6": 0.006773204696327287, - "0,1,4,7": 0.013167789513548097, - "0,1,5,6": 0.12342355719738307, - "0,1,5,7": -0.02408265174023805, - "0,1,6,7": 0.34105605629986246, - "0,2,3,4": -0.0005461817095531916, - "0,2,3,5": 0.009991240282846148, - "0,2,3,6": 0.0001961025126909398, - "0,2,3,7": 0.0002598465225181664, - "0,2,4,5": 0.012492638622762248, - "0,2,4,6": 0.0016828696958596234, - "0,2,4,7": -0.002131616053609009, - "0,2,5,6": -0.0280092820015518, - "0,2,5,7": -0.11023465861373892, - "0,2,6,7": -0.004540032247246046, - "0,3,4,5": -0.01044803682242738, - "0,3,4,6": 0.0015509851503282546, - "0,3,4,7": -0.0010602227161002897, - "0,3,5,6": -0.016872104843081177, - "0,3,5,7": 0.013688503256818472, - "0,3,6,7": -0.02390546027877601, - "0,4,5,6": -0.020268082431277423, - "0,4,5,7": -0.004013668708172806, - "0,4,6,7": 0.019346412997195264, - "0,5,6,7": -0.24323738169558523, - "1,2,3,4": -0.002648364274739431, - "1,2,3,5": 0.007095433317028741, - "1,2,3,6": -0.003107499116792127, - "1,2,3,7": 0.01256794174931597, - "1,2,4,5": -0.0012400440831410089, - "1,2,4,6": 0.0007682092926943884, - "1,2,4,7": -0.0010068498042775285, - "1,2,5,6": 0.0015492347046247587, - "1,2,5,7": 0.01642375469840707, - "1,2,6,7": -0.011655533720802786, - "1,3,4,5": -0.004154739976897193, - "1,3,4,6": -0.0011203425692381344, - "1,3,4,7": 0.000889078177615743, - "1,3,5,6": -0.0001280868302564834, - "1,3,5,7": 0.022407377949222613, - "1,3,6,7": -0.015731660068891228, - "1,4,5,6": -0.001338919071776819, - "1,4,5,7": -0.0026755329783055464, - "1,4,6,7": 0.0022435696213431635, - "1,5,6,7": -0.06453367327286129, - "2,3,4,5": -0.005985043014762437, - "2,3,4,6": -6.170309142409608e-05, - "2,3,4,7": -0.0003145621766674026, - "2,3,5,6": 0.006101103741711394, - "2,3,5,7": -0.016751976738451302, - "2,3,6,7": 0.00872680016717516, - "2,4,5,6": -0.0070439601971189845, - "2,4,5,7": -0.017121251145776634, - "2,4,6,7": 0.0020189105241209173, - "2,5,6,7": 0.05266155150536107, - "3,4,5,6": 0.0014664279401114624, - "3,4,5,7": -0.001580613359605354, - "3,4,6,7": 0.00021745563894163636, - "3,5,6,7": 0.015735588491915177, - "4,5,6,7": -0.0047751149111176314, - "0,1,2,3,4": 0.0025422614060190973, - "0,1,2,3,5": 0.0016612189716038728, - "0,1,2,3,6": 0.0077146907852214675, - "0,1,2,3,7": -0.005859114624278572, - "0,1,2,4,5": 0.006676509774523165, - "0,1,2,4,6": 0.00017755862158042035, - "0,1,2,4,7": 0.0038515603019839695, - "0,1,2,5,6": 0.015350311841043851, - "0,1,2,5,7": -0.01260103083758235, - "0,1,2,6,7": 0.0424887549592472, - "0,1,3,4,5": -0.008570599557790493, - "0,1,3,4,6": 0.0008006123301198542, - "0,1,3,4,7": -0.0010265111270739702, - "0,1,3,5,6": -0.006492685278441712, - "0,1,3,5,7": -0.007623306577678957, - "0,1,3,6,7": -0.059633984815447016, - "0,1,4,5,6": -0.017014272722083446, - "0,1,4,5,7": -0.0038575096365243144, - "0,1,4,6,7": 0.0023796874707828763, - "0,1,5,6,7": -0.28757184498018207, - "0,2,3,4,5": 0.005343518209012688, - "0,2,3,4,6": -6.115189775579566e-05, - "0,2,3,4,7": 0.0005183072268200029, - "0,2,3,5,6": -0.004760178201688836, - "0,2,3,5,7": 0.016783401431115008, - "0,2,3,6,7": -0.007014153981490967, - "0,2,4,5,6": 0.006290015815902272, - "0,2,4,5,7": 0.010426676161104265, - "0,2,4,6,7": 0.008279303016114792, - "0,2,5,6,7": -0.0786619159840547, - "0,3,4,5,6": 0.0066892247827767815, - "0,3,4,5,7": -0.000955832083375352, - "0,3,4,6,7": 0.0012519035861253691, - "0,3,5,6,7": 0.04681562951208118, - "0,4,5,6,7": -0.029735842497125686, - "1,2,3,4,5": -0.003746392901657458, - "1,2,3,4,6": 0.0005792242437965278, - "1,2,3,4,7": 3.214382706584473e-05, - "1,2,3,5,6": -0.0006396529272865159, - "1,2,3,5,7": 0.0022411031562183936, - "1,2,3,6,7": 0.0059209916370877025, - "1,2,4,5,6": -0.002652879937822039, - "1,2,4,5,7": -0.0012547241486853267, - "1,2,4,6,7": -0.0021249149137421153, - "1,2,5,6,7": 0.001417878580552312, - "1,3,4,5,6": 6.286235131780504e-05, - "1,3,4,5,7": 0.00012826085503825357, - "1,3,4,6,7": 8.1906785605379e-05, - "1,3,5,6,7": 0.025668183100149622, - "1,4,5,6,7": -0.0005840337955788089, - "2,3,4,5,6": -0.001423965786217507, - "2,3,4,5,7": 0.0008144516944664781, - "2,3,4,6,7": 0.00038140473814685105, - "2,3,5,6,7": 0.00019114568595635095, - "2,4,5,6,7": -0.004570297753032082, - "3,4,5,6,7": 0.0012555941110068414, - "0,1,2,3,4,5": 0.004497247182012387, - "0,1,2,3,4,6": -0.0005252748052164691, - "0,1,2,3,4,7": -0.00043459992988914564, - "0,1,2,3,5,6": -0.0059829282951078255, - "0,1,2,3,5,7": -0.009316422483857778, - "0,1,2,3,6,7": -0.002952722453532175, - "0,1,2,4,5,6": 0.0009958793488569206, - "0,1,2,4,5,7": 0.002960340607792933, - "0,1,2,4,6,7": -0.001902335465107985, - "0,1,2,5,6,7": -0.025537119995397095, - "0,1,3,4,5,6": 0.0023112756596617157, - "0,1,3,4,5,7": -0.003182110281861883, - "0,1,3,4,6,7": 0.0006675506327218361, - "0,1,3,5,6,7": 0.06866897603842959, - "0,1,4,5,6,7": -0.006223221733959283, - "0,2,3,4,5,6": 0.0016667845710240936, - "0,2,3,4,5,7": 1.702120835900267e-05, - "0,2,3,4,6,7": -0.00026143548218438006, - "0,2,3,5,6,7": -0.0021620924436958067, - "0,2,4,5,6,7": -0.003904573318612714, - "0,3,4,5,6,7": 0.0033092502031490945, - "1,2,3,4,5,6": -0.00011430822262381568, - "1,2,3,4,5,7": -0.000573156838571176, - "1,2,3,4,6,7": 5.088523883545193e-05, - "1,2,3,5,6,7": -0.0020553411749708594, - "1,2,4,5,6,7": 0.0021038271140310094, - "1,3,4,5,6,7": -5.763886646636962e-06, - "2,3,4,5,6,7": -0.00023281866517299576 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=k-SII_order=7.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=k-SII_order=7.json deleted file mode 100644 index fca27dfac..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=k-SII_order=7.json +++ /dev/null @@ -1,274 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.223143+00:00Z", - "metadata": { - "n_players": 8, - "index": "k-SII", - "max_order": 7, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.072184995821221 - }, - "data": { - "0": -0.16261418772222128, - "1": 0.25257380296741544, - "2": 0.034040127541819724, - "3": 0.04454692189605576, - "4": 0.004274599180630644, - "5": 0.8663078299448805, - "6": -0.07646749671484028, - "7": 0.4381398989545669, - "0,1": 0.12305919550840819, - "0,2": 0.06880145176720548, - "0,3": -0.031863708161956855, - "0,4": 0.006350642897831716, - "0,5": 0.4325645919455088, - "0,6": -0.0013419067912261548, - "0,7": 0.06253420768792307, - "1,2": -0.05260674571754243, - "1,3": 0.030377676890856135, - "1,4": 0.00016445479610270025, - "1,5": 0.05059953576568108, - "1,6": -0.0037645125241990364, - "1,7": 0.029957929631867934, - "2,3": 0.002144446911085221, - "2,4": 0.0010222851198993432, - "2,5": 0.06281654913156608, - "2,6": -0.045183046009438045, - "2,7": 0.014459493065326621, - "3,4": 0.0002808387891543609, - "3,5": 0.03399172853822861, - "3,6": -0.0031501945918531414, - "3,7": 0.013279604182720924, - "4,5": 0.041285677932576446, - "4,6": 0.0004497423320023615, - "4,7": -0.0013068937325007692, - "5,6": 0.10611424989249721, - "5,7": -0.027674194180967636, - "6,7": 0.26605858885708755, - "0,1,2": -0.07581748269137852, - "0,1,3": -0.010425346893654005, - "0,1,4": 0.009689026349509964, - "0,1,5": 0.08613875427434493, - "0,1,6": 0.008184155718660366, - "0,1,7": 0.13253702546279303, - "0,2,3": -0.006990728204734191, - "0,2,4": -0.0039686307452125496, - "0,2,5": -0.09423929931937519, - "0,2,6": 0.05579137023380799, - "0,2,7": -0.00830832294807457, - "0,3,4": -0.002559265131085401, - "0,3,5": 0.06946101623610475, - "0,3,6": -0.003145871802711587, - "0,3,7": -0.02632388995052497, - "0,4,5": 0.03678552244621451, - "0,4,6": -0.002688997559894091, - "0,4,7": 0.018344894666615343, - "0,5,6": 0.12349834621387853, - "0,5,7": -0.17532339201209246, - "0,6,7": 0.18140110188898992, - "1,2,3": -0.028777980136040743, - "1,2,4": 0.0022331909268720604, - "1,2,5": 0.03892617476641354, - "1,2,6": -0.009492902856367886, - "1,2,7": -0.0045788837471377065, - "1,3,4": 0.0012020909926778556, - "1,3,5": -0.023873655877288395, - "1,3,6": 0.0014008333929856139, - "1,3,7": -0.021069823921309454, - "1,4,5": -0.031194803271880713, - "1,4,6": 0.006668413176680356, - "1,4,7": 0.0010420137098961731, - "1,5,6": 0.06733775081540908, - "1,5,7": -0.030111770005250265, - "1,6,7": 0.10948547914482983, - "2,3,4": 0.00048570925087932173, - "2,3,5": -0.0050098286747339935, - "2,3,6": -4.052491810759025e-05, - "2,3,7": -0.0005770472903154241, - "2,4,5": -0.018662581163674263, - "2,4,6": -4.377242168557232e-05, - "2,4,7": 0.004378304036489077, - "2,5,6": 0.02858522866045519, - "2,5,7": 0.12048958750966679, - "2,6,7": 0.02654659882516492, - "3,4,5": -0.005911177670967565, - "3,4,6": 0.00018458610445777783, - "3,4,7": 7.734804350475539e-05, - "3,5,6": 0.0015856761539639313, - "3,5,7": -0.0309784056619867, - "3,6,7": -0.017008920996498443, - "4,5,6": -0.001953948306278744, - "4,5,7": -0.005557428416468143, - "4,6,7": 0.008964429344986707, - "5,6,7": -0.09793108117582233, - "0,1,2,3": 0.02183061667035916, - "0,1,2,4": 0.000604346517907972, - "0,1,2,5": 0.07706181480800423, - "0,1,2,6": -0.010959011682558566, - "0,1,2,7": 0.004556956924380185, - "0,1,3,4": -0.0023677931880867757, - "0,1,3,5": 0.06572226854415275, - "0,1,3,6": -0.006292667271817249, - "0,1,3,7": -0.01226862838245635, - "0,1,4,5": -0.007277977036581729, - "0,1,4,6": 0.006773204696327287, - "0,1,4,7": 0.013167789513548097, - "0,1,5,6": 0.12342355719738307, - "0,1,5,7": -0.02408265174023805, - "0,1,6,7": 0.34105605629986246, - "0,2,3,4": -0.0005461817095531916, - "0,2,3,5": 0.009991240282846148, - "0,2,3,6": 0.0001961025126909398, - "0,2,3,7": 0.0002598465225181664, - "0,2,4,5": 0.012492638622762248, - "0,2,4,6": 0.0016828696958596234, - "0,2,4,7": -0.002131616053609009, - "0,2,5,6": -0.0280092820015518, - "0,2,5,7": -0.11023465861373892, - "0,2,6,7": -0.004540032247246046, - "0,3,4,5": -0.01044803682242738, - "0,3,4,6": 0.0015509851503282546, - "0,3,4,7": -0.0010602227161002897, - "0,3,5,6": -0.016872104843081177, - "0,3,5,7": 0.013688503256818472, - "0,3,6,7": -0.02390546027877601, - "0,4,5,6": -0.020268082431277423, - "0,4,5,7": -0.004013668708172806, - "0,4,6,7": 0.019346412997195264, - "0,5,6,7": -0.24323738169558523, - "1,2,3,4": -0.002648364274739431, - "1,2,3,5": 0.007095433317028741, - "1,2,3,6": -0.003107499116792127, - "1,2,3,7": 0.01256794174931597, - "1,2,4,5": -0.0012400440831410089, - "1,2,4,6": 0.0007682092926943884, - "1,2,4,7": -0.0010068498042775285, - "1,2,5,6": 0.0015492347046247587, - "1,2,5,7": 0.01642375469840707, - "1,2,6,7": -0.011655533720802786, - "1,3,4,5": -0.004154739976897193, - "1,3,4,6": -0.0011203425692381344, - "1,3,4,7": 0.000889078177615743, - "1,3,5,6": -0.0001280868302564834, - "1,3,5,7": 0.022407377949222613, - "1,3,6,7": -0.015731660068891228, - "1,4,5,6": -0.001338919071776819, - "1,4,5,7": -0.0026755329783055464, - "1,4,6,7": 0.0022435696213431635, - "1,5,6,7": -0.06453367327286129, - "2,3,4,5": -0.005985043014762437, - "2,3,4,6": -6.170309142409608e-05, - "2,3,4,7": -0.0003145621766674026, - "2,3,5,6": 0.006101103741711394, - "2,3,5,7": -0.016751976738451302, - "2,3,6,7": 0.00872680016717516, - "2,4,5,6": -0.0070439601971189845, - "2,4,5,7": -0.017121251145776634, - "2,4,6,7": 0.0020189105241209173, - "2,5,6,7": 0.05266155150536107, - "3,4,5,6": 0.0014664279401114624, - "3,4,5,7": -0.001580613359605354, - "3,4,6,7": 0.00021745563894163636, - "3,5,6,7": 0.015735588491915177, - "4,5,6,7": -0.0047751149111176314, - "0,1,2,3,4": 0.0024385349123369577, - "0,1,2,3,5": 0.0001721351772874986, - "0,1,2,3,6": 0.006313981420871695, - "0,1,2,3,7": -0.007389629490698102, - "0,1,2,4,5": 0.007281323510062017, - "0,1,2,4,6": 0.0008707467870858743, - "0,1,2,4,7": 0.004414942965419666, - "0,1,2,5,6": 0.01465814270591507, - "0,1,2,5,7": -0.013423005474780888, - "0,1,2,6,7": 0.04175515475201526, - "0,1,3,4,5": -0.008684246825562568, - "0,1,3,4,6": 0.000775339492314379, - "0,1,3,4,7": -0.001181589466949203, - "0,1,3,5,6": -0.007903315416881421, - "0,1,3,5,7": -0.009163742218188423, - "0,1,3,6,7": -0.06108604602598988, - "0,1,4,5,6": -0.01633100533066793, - "0,1,4,5,7": -0.003304047747178555, - "0,1,4,6,7": 0.0030215237900952374, - "0,1,5,6,7": -0.2883153659615039, - "0,2,3,4,5": 0.005334626273112208, - "0,2,3,4,6": 1.833059631032677e-05, - "0,2,3,4,7": 0.0004679842188163678, - "0,2,3,5,6": -0.006066053008256948, - "0,2,3,5,7": 0.015347721122477138, - "0,2,3,6,7": -0.008361459860162235, - "0,2,4,5,6": 0.007078038539189387, - "0,2,4,5,7": 0.011084893382321622, - "0,2,4,6,7": 0.00902589466729875, - "0,2,5,6,7": -0.07930068163350497, - "0,3,4,5,6": 0.006758786502752966, - "0,3,4,5,7": -0.0010160758654689241, - "0,3,4,6,7": 0.0012800342339983986, - "0,3,5,6,7": 0.04545840285931998, - "0,4,5,6,7": -0.028999171620031666, - "1,2,3,4,5": -0.003825293786414348, - "1,2,3,4,6": 0.0005886977890062391, - "1,2,3,4,7": -8.818812979420146e-05, - "1,2,3,5,6": -0.002015536682711039, - "1,2,3,5,7": 0.0007354138987241134, - "1,2,3,6,7": 0.004503676809560024, - "1,2,4,5,6": -0.0019348661633913355, - "1,2,4,5,7": -0.0006665158763243807, - "1,2,4,6,7": -0.0014483322114145678, - "1,2,5,6,7": 0.0007091039822456254, - "1,3,4,5,6": 6.241512243757943e-05, - "1,3,4,5,7": -1.9918759117295087e-06, - "1,3,4,6,7": 4.002848462199745e-05, - "1,3,5,6,7": 0.024240947498532006, - "1,4,5,6,7": 8.262813265880184e-05, - "2,3,4,5,6": -0.001319657683226135, - "2,3,4,5,7": 0.0007889542953880928, - "2,3,4,6,7": 0.00044428176903506716, - "2,3,5,6,7": -0.0011313345837896671, - "2,4,5,6,7": -0.0037988804929228737, - "3,4,5,6,7": 0.0013085503678051205, - "0,1,2,3,4,5": 0.0047516435272401125, - "0,1,2,3,4,6": -0.0005360017498885483, - "0,1,2,3,4,7": -5.59103683519524e-05, - "0,1,2,3,5,6": -0.0018375833378772022, - "0,1,2,3,5,7": -0.004781661020417882, - "0,1,2,3,6,7": 0.0013169157200079162, - "0,1,2,4,5,6": -0.0011404682834781354, - "0,1,2,4,5,7": 0.0012134094816671492, - "0,1,2,4,6,7": -0.003914389881133573, - "0,1,2,5,6,7": -0.02339310250951998, - "0,1,3,4,5,6": 0.002330311037259447, - "0,1,3,4,5,7": -0.002773658398054879, - "0,1,3,4,6,7": 0.0008108792266290354, - "0,1,3,5,6,7": 0.07296837653423949, - "0,1,4,5,6,7": -0.00820551382771506, - "0,2,3,4,5,6": 0.001371553953007032, - "0,2,3,4,5,7": 0.00011120709655121352, - "0,2,3,4,6,7": -0.0004323728838919738, - "0,2,3,5,6,7": 0.0018230420564993022, - "0,2,4,5,6,7": -0.006201131407983285, - "0,3,4,5,6,7": 0.0031680751237113114, - "1,2,3,4,5,6": -0.00019951199407164388, - "1,2,3,4,5,7": -0.00026894410380973177, - "1,2,3,4,6,7": 8.99746836970916e-05, - "1,2,3,5,6,7": 0.002139820171793483, - "1,2,4,5,6,7": 1.7295871229672244e-05, - "1,3,4,5,6,7": 6.30878804848134e-05, - "2,3,4,5,6,7": -0.0004782328936563385, - "0,1,2,3,4,5,6": 0.00013502016098154712, - "0,1,2,3,4,5,7": -0.0006438128514369978, - "0,1,2,3,4,6,7": -0.00011356627163738864, - "0,1,2,3,5,6,7": -0.008425710075442794, - "0,1,2,4,5,6,7": 0.004137675103688565, - "0,1,3,4,5,6,7": -0.00017309091617701, - "0,2,3,4,5,6,7": 0.00045544107505257614, - "1,2,3,4,5,6,7": 3.5387381914109284e-05 - } -} diff --git a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=k-SII_order=8.json b/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=k-SII_order=8.json deleted file mode 100644 index b431bcd1d..000000000 --- a/tests/shapiq/data/interaction_values/california_housing/iv_california_housing_tree_index=k-SII_order=8.json +++ /dev/null @@ -1,275 +0,0 @@ -{ - "object_name": "InteractionValues", - "data_type": "interaction_values", - "version": "1.3.0", - "created_from": null, - "description": null, - "parameters": {}, - "timestamp": "2025-07-10T20:46:06.215489+00:00Z", - "metadata": { - "n_players": 8, - "index": "k-SII", - "max_order": 8, - "min_order": 1, - "estimated": false, - "estimation_budget": null, - "baseline_value": 2.072184995821221 - }, - "data": { - "0": -0.16261418772222128, - "1": 0.25257380296741544, - "2": 0.034040127541819724, - "3": 0.04454692189605576, - "4": 0.004274599180630644, - "5": 0.8663078299448805, - "6": -0.07646749671484028, - "7": 0.4381398989545669, - "0,1": 0.12305751039498217, - "0,2": 0.06879976665377946, - "0,3": -0.03186539327538288, - "0,4": 0.006348957784405691, - "0,5": 0.43256290683208276, - "0,6": -0.0013435919046521799, - "0,7": 0.06253252257449705, - "1,2": -0.05260843083096846, - "1,3": 0.03037599177743011, - "1,4": 0.00016276968267667523, - "1,5": 0.050597850652255055, - "1,6": -0.0037661976376250615, - "1,7": 0.02995624451844191, - "2,3": 0.002142761797659196, - "2,4": 0.0010206000064733182, - "2,5": 0.06281486401814006, - "2,6": -0.04518473112286407, - "2,7": 0.014457807951900596, - "3,4": 0.00027915367572833584, - "3,5": 0.033990043424802587, - "3,6": -0.0031518797052791665, - "3,7": 0.013277919069294899, - "4,5": 0.04128399281915042, - "4,6": 0.00044805721857633647, - "4,7": -0.0013085788459267942, - "5,6": 0.10611256477907119, - "5,7": -0.02767587929439366, - "6,7": 0.26605690374366153, - "0,1,2": -0.07581748269137852, - "0,1,3": -0.010425346893654005, - "0,1,4": 0.009689026349509964, - "0,1,5": 0.08613875427434493, - "0,1,6": 0.008184155718660366, - "0,1,7": 0.13253702546279303, - "0,2,3": -0.006990728204734191, - "0,2,4": -0.0039686307452125496, - "0,2,5": -0.09423929931937519, - "0,2,6": 0.05579137023380799, - "0,2,7": -0.00830832294807457, - "0,3,4": -0.002559265131085401, - "0,3,5": 0.06946101623610475, - "0,3,6": -0.003145871802711587, - "0,3,7": -0.02632388995052497, - "0,4,5": 0.03678552244621451, - "0,4,6": -0.002688997559894091, - "0,4,7": 0.018344894666615343, - "0,5,6": 0.12349834621387853, - "0,5,7": -0.17532339201209246, - "0,6,7": 0.18140110188898992, - "1,2,3": -0.028777980136040743, - "1,2,4": 0.0022331909268720604, - "1,2,5": 0.03892617476641354, - "1,2,6": -0.009492902856367886, - "1,2,7": -0.0045788837471377065, - "1,3,4": 0.0012020909926778556, - "1,3,5": -0.023873655877288395, - "1,3,6": 0.0014008333929856139, - "1,3,7": -0.021069823921309454, - "1,4,5": -0.031194803271880713, - "1,4,6": 0.006668413176680356, - "1,4,7": 0.0010420137098961731, - "1,5,6": 0.06733775081540908, - "1,5,7": -0.030111770005250265, - "1,6,7": 0.10948547914482983, - "2,3,4": 0.00048570925087932173, - "2,3,5": -0.0050098286747339935, - "2,3,6": -4.052491810759025e-05, - "2,3,7": -0.0005770472903154241, - "2,4,5": -0.018662581163674263, - "2,4,6": -4.377242168557232e-05, - "2,4,7": 0.004378304036489077, - "2,5,6": 0.02858522866045519, - "2,5,7": 0.12048958750966679, - "2,6,7": 0.02654659882516492, - "3,4,5": -0.005911177670967565, - "3,4,6": 0.00018458610445777783, - "3,4,7": 7.734804350475539e-05, - "3,5,6": 0.0015856761539639313, - "3,5,7": -0.0309784056619867, - "3,6,7": -0.017008920996498443, - "4,5,6": -0.001953948306278744, - "4,5,7": -0.005557428416468143, - "4,6,7": 0.008964429344986707, - "5,6,7": -0.09793108117582233, - "0,1,2,3": 0.021832975829155592, - "0,1,2,4": 0.0006067056767044032, - "0,1,2,5": 0.07706417396680065, - "0,1,2,6": -0.010956652523762135, - "0,1,2,7": 0.0045593160831766165, - "0,1,3,4": -0.0023654340292903445, - "0,1,3,5": 0.06572462770294918, - "0,1,3,6": -0.006290308113020818, - "0,1,3,7": -0.012266269223659918, - "0,1,4,5": -0.007275617877785297, - "0,1,4,6": 0.0067755638551237184, - "0,1,4,7": 0.013170148672344529, - "0,1,5,6": 0.1234259163561795, - "0,1,5,7": -0.02408029258144162, - "0,1,6,7": 0.3410584154586589, - "0,2,3,4": -0.0005438225507567604, - "0,2,3,5": 0.009993599441642579, - "0,2,3,6": 0.00019846167148737092, - "0,2,3,7": 0.00026220568131459757, - "0,2,4,5": 0.01249499778155868, - "0,2,4,6": 0.0016852288546560545, - "0,2,4,7": -0.0021292568948125777, - "0,2,5,6": -0.02800692284275537, - "0,2,5,7": -0.11023229945494249, - "0,2,6,7": -0.004537673088449615, - "0,3,4,5": -0.01044567766363095, - "0,3,4,6": 0.0015533443091246856, - "0,3,4,7": -0.0010578635573038587, - "0,3,5,6": -0.016869745684284745, - "0,3,5,7": 0.013690862415614903, - "0,3,6,7": -0.023903101119979578, - "0,4,5,6": -0.020265723272480992, - "0,4,5,7": -0.0040113095493763745, - "0,4,6,7": 0.019348772155991695, - "0,5,6,7": -0.2432350225367888, - "1,2,3,4": -0.002646005115943, - "1,2,3,5": 0.007097792475825172, - "1,2,3,6": -0.0031051399579956956, - "1,2,3,7": 0.0125703009081124, - "1,2,4,5": -0.0012376849243445778, - "1,2,4,6": 0.0007705684514908196, - "1,2,4,7": -0.0010044906454810974, - "1,2,5,6": 0.0015515938634211898, - "1,2,5,7": 0.016426113857203502, - "1,2,6,7": -0.011653174562006355, - "1,3,4,5": -0.004152380818100761, - "1,3,4,6": -0.0011179834104417033, - "1,3,4,7": 0.0008914373364121742, - "1,3,5,6": -0.00012572767146005228, - "1,3,5,7": 0.022409737108019044, - "1,3,6,7": -0.015729300910094796, - "1,4,5,6": -0.0013365599129803879, - "1,4,5,7": -0.002673173819509115, - "1,4,6,7": 0.0022459287801395948, - "1,5,6,7": -0.06453131411406486, - "2,3,4,5": -0.0059826838559660055, - "2,3,4,6": -5.934393262766495e-05, - "2,3,4,7": -0.00031220301787097146, - "2,3,5,6": 0.006103462900507825, - "2,3,5,7": -0.01674961757965487, - "2,3,6,7": 0.008729159325971592, - "2,4,5,6": -0.007041601038322553, - "2,4,5,7": -0.017118891986980203, - "2,4,6,7": 0.0020212696829173486, - "2,5,6,7": 0.0526639106641575, - "3,4,5,6": 0.0014687870989078934, - "3,4,5,7": -0.001578254200808923, - "3,4,6,7": 0.00021981479773806748, - "3,5,6,7": 0.015737947650711608, - "4,5,6,7": -0.0047727557523212, - "0,1,2,3,4": 0.0024385349123369577, - "0,1,2,3,5": 0.0001721351772874986, - "0,1,2,3,6": 0.006313981420871695, - "0,1,2,3,7": -0.007389629490698102, - "0,1,2,4,5": 0.007281323510062017, - "0,1,2,4,6": 0.0008707467870858743, - "0,1,2,4,7": 0.004414942965419666, - "0,1,2,5,6": 0.01465814270591507, - "0,1,2,5,7": -0.013423005474780888, - "0,1,2,6,7": 0.04175515475201526, - "0,1,3,4,5": -0.008684246825562568, - "0,1,3,4,6": 0.000775339492314379, - "0,1,3,4,7": -0.001181589466949203, - "0,1,3,5,6": -0.007903315416881421, - "0,1,3,5,7": -0.009163742218188423, - "0,1,3,6,7": -0.06108604602598988, - "0,1,4,5,6": -0.01633100533066793, - "0,1,4,5,7": -0.003304047747178555, - "0,1,4,6,7": 0.0030215237900952374, - "0,1,5,6,7": -0.2883153659615039, - "0,2,3,4,5": 0.005334626273112208, - "0,2,3,4,6": 1.833059631032677e-05, - "0,2,3,4,7": 0.0004679842188163678, - "0,2,3,5,6": -0.006066053008256948, - "0,2,3,5,7": 0.015347721122477138, - "0,2,3,6,7": -0.008361459860162235, - "0,2,4,5,6": 0.007078038539189387, - "0,2,4,5,7": 0.011084893382321622, - "0,2,4,6,7": 0.00902589466729875, - "0,2,5,6,7": -0.07930068163350497, - "0,3,4,5,6": 0.006758786502752966, - "0,3,4,5,7": -0.0010160758654689241, - "0,3,4,6,7": 0.0012800342339983986, - "0,3,5,6,7": 0.04545840285931998, - "0,4,5,6,7": -0.028999171620031666, - "1,2,3,4,5": -0.003825293786414348, - "1,2,3,4,6": 0.0005886977890062391, - "1,2,3,4,7": -8.818812979420146e-05, - "1,2,3,5,6": -0.002015536682711039, - "1,2,3,5,7": 0.0007354138987241134, - "1,2,3,6,7": 0.004503676809560024, - "1,2,4,5,6": -0.0019348661633913355, - "1,2,4,5,7": -0.0006665158763243807, - "1,2,4,6,7": -0.0014483322114145678, - "1,2,5,6,7": 0.0007091039822456254, - "1,3,4,5,6": 6.241512243757943e-05, - "1,3,4,5,7": -1.9918759117295087e-06, - "1,3,4,6,7": 4.002848462199745e-05, - "1,3,5,6,7": 0.024240947498532006, - "1,4,5,6,7": 8.262813265880184e-05, - "2,3,4,5,6": -0.001319657683226135, - "2,3,4,5,7": 0.0007889542953880928, - "2,3,4,6,7": 0.00044428176903506716, - "2,3,5,6,7": -0.0011313345837896671, - "2,4,5,6,7": -0.0037988804929228737, - "3,4,5,6,7": 0.0013085503678051205, - "0,1,2,3,4,5": 0.004739847733257936, - "0,1,2,3,4,6": -0.0005477975438707242, - "0,1,2,3,4,7": -6.770616233412834e-05, - "0,1,2,3,5,6": -0.0018493791318593782, - "0,1,2,3,5,7": -0.0047934568144000584, - "0,1,2,3,6,7": 0.0013051199260257402, - "0,1,2,4,5,6": -0.0011522640774603115, - "0,1,2,4,5,7": 0.0012016136876849732, - "0,1,2,4,6,7": -0.003926185675115749, - "0,1,2,5,6,7": -0.023404898303502158, - "0,1,3,4,5,6": 0.0023185152432772713, - "0,1,3,4,5,7": -0.002785454192037055, - "0,1,3,4,6,7": 0.0007990834326468595, - "0,1,3,5,6,7": 0.0729565807402573, - "0,1,4,5,6,7": -0.008217309621697236, - "0,2,3,4,5,6": 0.001359758159024856, - "0,2,3,4,5,7": 9.941130256903759e-05, - "0,2,3,4,6,7": -0.00044416867787414976, - "0,2,3,5,6,7": 0.0018112462625171262, - "0,2,4,5,6,7": -0.006212927201965461, - "0,3,4,5,6,7": 0.0031562793297291356, - "1,2,3,4,5,6": -0.0002113077880538198, - "1,2,3,4,5,7": -0.0002807398977919077, - "1,2,3,4,6,7": 7.817888971491567e-05, - "1,2,3,5,6,7": 0.002128024377811307, - "1,2,4,5,6,7": 5.500077247496312e-06, - "1,3,4,5,6,7": 5.129208650263747e-05, - "2,3,4,5,6,7": -0.0004900286876385144, - "0,1,2,3,4,5,6": 0.00017040754292807492, - "0,1,2,3,4,5,7": -0.00060842546949047, - "0,1,2,3,4,6,7": -7.817888969086084e-05, - "0,1,2,3,5,6,7": -0.008390322693496266, - "0,1,2,4,5,6,7": 0.004173062485635093, - "0,1,3,4,5,6,7": -0.0001377035342304822, - "0,2,3,4,5,6,7": 0.0004908284569991039, - "1,2,3,4,5,6,7": 7.077476386063708e-05, - "0,1,2,3,4,5,6,7": -7.077476389305559e-05 - } -} diff --git a/tests/shapiq/data/models/california_nn_0.812511_0.076331.weights b/tests/shapiq/data/models/california_nn_0.812511_0.076331.weights deleted file mode 100644 index 48dcfcf20..000000000 Binary files a/tests/shapiq/data/models/california_nn_0.812511_0.076331.weights and /dev/null differ diff --git a/tests/shapiq/data/test_croc.JPEG b/tests/shapiq/data/test_croc.JPEG deleted file mode 100644 index b088f3620..000000000 Binary files a/tests/shapiq/data/test_croc.JPEG and /dev/null differ diff --git a/tests/shapiq/markers.py b/tests/shapiq/markers.py deleted file mode 100644 index 2163a6eb6..000000000 --- a/tests/shapiq/markers.py +++ /dev/null @@ -1,43 +0,0 @@ -"""This module contains all markers for the tests.""" - -from __future__ import annotations - -import importlib.util - -import pytest - -__all__ = [ - "skip_if_no_keras", - "skip_if_no_lightgbm", - "skip_if_no_tabpfn", - "skip_if_no_tensorflow", - "skip_if_no_xgboost", -] - - -def is_installed(pkg_name: str) -> bool: - """Check if a package is installed without importing it.""" - return importlib.util.find_spec(pkg_name) is not None - - -skip_if_no_tabpfn = pytest.mark.skipif( - not is_installed("tabpfn"), - reason="TabPFN is not available.", -) - -skip_if_no_tensorflow = pytest.mark.skipif( - not is_installed("tensorflow"), - reason="tensorflow is not installed", -) - -skip_if_no_xgboost = pytest.mark.skipif( - not is_installed("xgboost"), - reason="xgboost is not installed", -) - -skip_if_no_keras = pytest.mark.skipif(not is_installed("keras"), reason="keras is not installed") - -skip_if_no_lightgbm = pytest.mark.skipif( - not is_installed("lightgbm"), - reason="lightgbm is not installed", -) diff --git a/tests/shapiq/test_approximators.py b/tests/shapiq/test_approximators.py new file mode 100644 index 000000000..17aa75ba5 --- /dev/null +++ b/tests/shapiq/test_approximators.py @@ -0,0 +1,175 @@ +"""Protocol and special-case tests for all approximators.""" + +from __future__ import annotations + +import inspect + +import numpy as np +import pytest + +from shapiq.approximator import ( + SHAPIQ, + SPEX, + SVARM, + SVARMIQ, + InconsistentKernelSHAPIQ, + KernelSHAP, + KernelSHAPIQ, + MSRBiased, + OwenSamplingSV, + PermutationSamplingSII, + PermutationSamplingSTII, + PermutationSamplingSV, + ProxySHAP, + RegressionFBII, + RegressionFSII, + StratifiedSamplingSV, + UnbiasedKernelSHAP, + kADDSHAP, +) +from shapiq.interaction_values import InteractionValues +from shapiq_games.synthetic import DummyGame + +# --------------------------------------------------------------------------- +# Indices where sum(values) == game(N) - game(empty) holds +# --------------------------------------------------------------------------- +EFFICIENT_INDICES = {"SV", "k-SII", "FSII", "STII", "kADD-SHAP"} + +# --------------------------------------------------------------------------- +# Registry: one entry per (approximator, index) combo worth testing. +# Each entry must work with a 7-player DummyGame(interaction=(1,2)). +# --------------------------------------------------------------------------- +ALL_APPROXIMATORS = [ + # --- Permutation --- + {"cls": PermutationSamplingSV, "n": 7, "max_order": 1, "index": "SV", "budget": 80}, + {"cls": PermutationSamplingSII, "n": 7, "max_order": 2, "index": "k-SII", "budget": 100}, + {"cls": PermutationSamplingSTII, "n": 7, "max_order": 2, "index": "STII", "budget": 100}, + # --- Marginals --- + {"cls": OwenSamplingSV, "n": 7, "max_order": 1, "index": "SV", "budget": 80}, + {"cls": StratifiedSamplingSV, "n": 7, "max_order": 1, "index": "SV", "budget": 80}, + # --- Monte Carlo --- + {"cls": SHAPIQ, "n": 7, "max_order": 2, "index": "SII", "budget": 100}, + {"cls": SHAPIQ, "n": 7, "max_order": 2, "index": "k-SII", "budget": 100}, + {"cls": SHAPIQ, "n": 7, "max_order": 2, "index": "FSII", "budget": 100}, + {"cls": SHAPIQ, "n": 7, "max_order": 2, "index": "FBII", "budget": 100}, + {"cls": SHAPIQ, "n": 7, "max_order": 2, "index": "STII", "budget": 100}, + {"cls": UnbiasedKernelSHAP, "n": 7, "max_order": 1, "index": "SV", "budget": 80}, + {"cls": SVARM, "n": 7, "max_order": 1, "index": "SV", "budget": 80}, + {"cls": SVARMIQ, "n": 7, "max_order": 2, "index": "k-SII", "budget": 100}, + {"cls": SVARMIQ, "n": 7, "max_order": 2, "index": "SII", "budget": 100}, + # --- Regression --- + {"cls": KernelSHAP, "n": 7, "max_order": 1, "index": "SV", "budget": 80}, + {"cls": KernelSHAPIQ, "n": 7, "max_order": 2, "index": "k-SII", "budget": 100}, + {"cls": InconsistentKernelSHAPIQ, "n": 7, "max_order": 2, "index": "k-SII", "budget": 100}, + {"cls": kADDSHAP, "n": 7, "max_order": 2, "index": "kADD-SHAP", "budget": 100}, + {"cls": RegressionFSII, "n": 7, "max_order": 2, "index": "FSII", "budget": 100}, + {"cls": RegressionFBII, "n": 7, "max_order": 2, "index": "FBII", "budget": 100}, + # --- Sparse --- + {"cls": SPEX, "n": 7, "max_order": 2, "index": "FSII", "budget": 300}, + # --- Proxy --- + {"cls": MSRBiased, "n": 7, "max_order": 2, "index": "SII", "budget": 100}, + {"cls": MSRBiased, "n": 7, "max_order": 1, "index": "SV", "budget": 80}, +] + + +def _approx_id(config: dict) -> str: + return f"{config['cls'].__name__}-{config['index']}" + + +def _signature_params(cls: type) -> tuple[set[str], bool]: + """Return (named params, accepts_var_kwargs) for cls.__init__.""" + params = inspect.signature(cls.__init__).parameters + named = {name for name in params if name != "self"} + has_var_kw = any(p.kind == inspect.Parameter.VAR_KEYWORD for p in params.values()) + return named, has_var_kw + + +def _make_approximator(config: dict, **overrides): + """Instantiate the approximator, passing only kwargs its signature accepts.""" + cls = config["cls"] + named, has_var_kw = _signature_params(cls) + + candidate: dict = {"n": config["n"]} + if "max_order" in named: + candidate["max_order"] = config["max_order"] + if "index" in named: + candidate["index"] = config["index"] + candidate.update(overrides) + + if not has_var_kw: + candidate = {k: v for k, v in candidate.items() if k in named} + return cls(**candidate) + + +def _class_accepts_index(cls: type) -> bool: + named, _ = _signature_params(cls) + return "index" in named + + +# =================================================================== +# Protocol tests — every approximator must pass these +# =================================================================== + + +@pytest.mark.parametrize("config", ALL_APPROXIMATORS, ids=_approx_id) +class TestApproximatorProtocol: + """Universal contract checks for all approximators.""" + + def test_returns_interaction_values(self, config): + """Approximate returns InteractionValues with correct metadata.""" + game = DummyGame(n=config["n"], interaction=(1, 2)) + approx = _make_approximator(config, random_state=42) + result = approx.approximate(config["budget"], game) + + assert isinstance(result, InteractionValues) + assert result.max_order == config["max_order"] + assert result.n_players == config["n"] + + def test_respects_budget(self, config): + """Game is not called more than budget + 2 times.""" + game = DummyGame(n=config["n"], interaction=(1, 2)) + approx = _make_approximator(config, random_state=42) + approx.approximate(config["budget"], game) + + assert game.access_counter <= config["budget"] + 2 + + def test_reproducible(self, config): + """Same random_state produces identical results. + + SPEX uses a sparse transform whose post-processing is numerically sensitive + to floating-point noise. We therefore allow a small absolute tolerance. + """ + game1 = DummyGame(n=config["n"], interaction=(1, 2)) + game2 = DummyGame(n=config["n"], interaction=(1, 2)) + a1 = _make_approximator(config, random_state=42) + a2 = _make_approximator(config, random_state=42) + r1 = a1.approximate(config["budget"], game1) + r2 = a2.approximate(config["budget"], game2) + + assert np.allclose(r1.values, r2.values, atol=1e-3) + + def test_rejects_invalid_index(self, config): + """Raises error for indices not in valid_indices.""" + if not _class_accepts_index(config["cls"]): + pytest.skip(f"{config['cls'].__name__} does not accept an 'index' parameter") + with pytest.raises((ValueError, TypeError)): + _make_approximator(config, index="NOT_A_REAL_INDEX") + + +# =================================================================== +# Special cases +# =================================================================== + + +class TestProxySHAP: + """ProxySHAP delegates to different adjustment strategies.""" + + def test_default_adjustment_is_msr_biased(self): + proxy = ProxySHAP(n=7, max_order=2, index="SII") + assert proxy.adjustment == "msr-b" + + def test_approximate_runs(self): + game = DummyGame(n=7, interaction=(1, 2)) + proxy = ProxySHAP(n=7, max_order=2, index="SII", random_state=42) + result = proxy.approximate(100, game) + assert isinstance(result, InteractionValues) diff --git a/tests/shapiq/test_explainers.py b/tests/shapiq/test_explainers.py new file mode 100644 index 000000000..098367d1d --- /dev/null +++ b/tests/shapiq/test_explainers.py @@ -0,0 +1,284 @@ +"""Protocol and special-case tests for explainers.""" + +from __future__ import annotations + +import numpy as np +import pytest + +from shapiq.explainer.agnostic import AgnosticExplainer +from shapiq.explainer.product_kernel import ProductKernelExplainer +from shapiq.explainer.tabular import TabularExplainer +from shapiq.interaction_values import InteractionValues +from shapiq_games.synthetic import DummyGame + +# --------------------------------------------------------------------------- +# Helpers +# --------------------------------------------------------------------------- + + +def _linear_model(X: np.ndarray) -> np.ndarray: + """Simple linear model: sum of features.""" + return X.sum(axis=1) + + +def _make_background_data(n_samples: int = 30, n_features: int = 5) -> np.ndarray: + rng = np.random.default_rng(42) + return rng.normal(size=(n_samples, n_features)) + + +# =================================================================== +# TabularExplainer protocol +# =================================================================== + + +TABULAR_CONFIGS = [ + {"index": "SV", "max_order": 1, "approximator": "auto"}, + {"index": "k-SII", "max_order": 2, "approximator": "auto"}, + {"index": "FSII", "max_order": 2, "approximator": "regression"}, + {"index": "SV", "max_order": 1, "approximator": "permutation"}, + {"index": "k-SII", "max_order": 2, "approximator": "montecarlo"}, +] + + +def _tabular_id(config: dict) -> str: + return f"{config['index']}-order{config['max_order']}-{config['approximator']}" + + +@pytest.mark.parametrize("config", TABULAR_CONFIGS, ids=_tabular_id) +class TestTabularExplainerProtocol: + """Contract checks for TabularExplainer.""" + + def test_explain_returns_interaction_values(self, config): + """explain() returns InteractionValues with correct metadata.""" + data = _make_background_data() + explainer = TabularExplainer( + model=_linear_model, + data=data, + index=config["index"], + max_order=config["max_order"], + approximator=config["approximator"], + random_state=42, + ) + x = data[0].reshape(1, -1) + result = explainer.explain(x, budget=2**5) + + assert isinstance(result, InteractionValues) + assert result.index == config["index"] + assert result.max_order == config["max_order"] + + def test_efficiency(self, config): + """sum(values) approximates the prediction for efficient indices.""" + if config["index"] not in {"SV", "k-SII", "FSII"}: + pytest.skip("Efficiency not guaranteed for this index") + data = _make_background_data() + explainer = TabularExplainer( + model=_linear_model, + data=data, + index=config["index"], + max_order=config["max_order"], + approximator=config["approximator"], + random_state=42, + ) + x = data[0].reshape(1, -1) + result = explainer.explain(x, budget=2**5) + prediction = float(_linear_model(x)[0]) + assert float(np.sum(result.values)) == pytest.approx(prediction, abs=0.5) + + def test_reproducible(self, config): + """Same random_state produces identical explanations.""" + data = _make_background_data() + kwargs = { + "model": _linear_model, + "data": data, + "index": config["index"], + "max_order": config["max_order"], + "approximator": config["approximator"], + } + e1 = TabularExplainer(**kwargs, random_state=42) + e2 = TabularExplainer(**kwargs, random_state=42) + x = data[0].reshape(1, -1) + r1 = e1.explain(x, budget=2**5, random_state=42) + r2 = e2.explain(x, budget=2**5, random_state=42) + assert np.allclose(r1.values, r2.values) + + +# =================================================================== +# AgnosticExplainer +# =================================================================== + + +class TestAgnosticExplainer: + """AgnosticExplainer wraps a Game or callable directly.""" + + def test_explain_with_game(self): + game = DummyGame(n=5, interaction=(0, 1)) + explainer = AgnosticExplainer(game=game, index="k-SII", max_order=2, random_state=42) + result = explainer.explain(budget=100) + assert isinstance(result, InteractionValues) + assert result.n_players == 5 + + def test_explain_with_callable(self): + def my_game(coalitions): + return coalitions.sum(axis=1).astype(float) + + explainer = AgnosticExplainer( + game=my_game, n_players=4, index="SV", max_order=1, random_state=42 + ) + result = explainer.explain(budget=50) + assert isinstance(result, InteractionValues) + assert result.n_players == 4 + + +# =================================================================== +# TabularExplainer special cases +# =================================================================== + + +class TestTabularExplainerValidation: + """Input validation and edge cases.""" + + def test_invalid_index_raises(self): + data = _make_background_data() + with pytest.raises(ValueError): + TabularExplainer(model=_linear_model, data=data, index="INVALID", max_order=2) + + def test_invalid_approximator_raises(self): + data = _make_background_data() + with pytest.raises(ValueError): + TabularExplainer(model=_linear_model, data=data, approximator="not_real") + + def test_sv_with_high_order_warns(self): + data = _make_background_data() + with pytest.warns(UserWarning): + TabularExplainer(model=_linear_model, data=data, index="SV", max_order=2) + + def test_explain_X_batch(self): + """explain_X returns a list of InteractionValues.""" + data = _make_background_data() + explainer = TabularExplainer( + model=_linear_model, data=data, index="SV", max_order=1, random_state=42 + ) + results = explainer.explain_X(data[:3], budget=2**5) + assert len(results) == 3 + assert all(isinstance(r, InteractionValues) for r in results) + + +# =================================================================== +# ProductKernelExplainer +# =================================================================== + + +def _pk_regression_data() -> tuple[np.ndarray, np.ndarray]: + rng = np.random.default_rng(42) + X = rng.normal(size=(30, 5)) + y = X[:, 0] + 0.5 * X[:, 1] + rng.normal(0, 0.1, size=30) + return X, y + + +def _pk_classification_data() -> tuple[np.ndarray, np.ndarray]: + X, y_reg = _pk_regression_data() + y = (y_reg > np.median(y_reg)).astype(int) + return X, y + + +def _svr_model(): + from sklearn.svm import SVR + + X, y = _pk_regression_data() + model = SVR(kernel="rbf") + model.fit(X, y) + return model, X + + +def _svc_model(): + from sklearn.svm import SVC + + X, y = _pk_classification_data() + model = SVC(kernel="rbf", probability=True) + model.fit(X, y) + return model, X + + +def _gpr_model(): + from sklearn.gaussian_process import GaussianProcessRegressor + from sklearn.gaussian_process.kernels import RBF + + X, y = _pk_regression_data() + model = GaussianProcessRegressor(kernel=RBF(), random_state=42) + model.fit(X, y) + return model, X + + +PRODUCT_KERNEL_MODELS = [ + ("svr", _svr_model, "regression"), + ("svc", _svc_model, "classification"), + ("gpr", _gpr_model, "regression"), +] + + +@pytest.mark.parametrize( + ("model_name", "model_factory", "task"), + PRODUCT_KERNEL_MODELS, + ids=[m[0] for m in PRODUCT_KERNEL_MODELS], +) +class TestProductKernelExplainerProtocol: + """Contract checks for ProductKernelExplainer across supported model types.""" + + def test_explain_returns_interaction_values(self, model_name, model_factory, task): + model, X = model_factory() + explainer = ProductKernelExplainer(model=model, max_order=1, min_order=0, index="SV") + result = explainer.explain(X[0]) + + assert isinstance(result, InteractionValues) + assert result.n_players == X.shape[1] + assert result.max_order == 1 + assert result.estimated is False + + def test_efficiency_for_regression(self, model_name, model_factory, task): + """For regression SVR/GPR, sum(values) equals the model prediction.""" + if task != "regression": + pytest.skip("Efficiency check only well-defined for regression models") + model, X = model_factory() + explainer = ProductKernelExplainer(model=model, max_order=1, min_order=0, index="SV") + result = explainer.explain(X[0]) + prediction = float(model.predict(X[0].reshape(1, -1))[0]) + assert float(np.sum(result.values)) == pytest.approx(prediction, abs=1e-4) + + def test_explain_X_batch(self, model_name, model_factory, task): + """explain_X returns a list of InteractionValues for each input.""" + model, X = model_factory() + explainer = ProductKernelExplainer(model=model, max_order=1, min_order=0, index="SV") + results = explainer.explain_X(X[:3]) + assert len(results) == 3 + assert all(isinstance(r, InteractionValues) for r in results) + assert all(r.n_players == X.shape[1] for r in results) + + +class TestProductKernelExplainerValidation: + """Input validation and edge cases for ProductKernelExplainer.""" + + def test_max_order_above_one_raises(self): + from sklearn.svm import SVR + + X, y = _pk_regression_data() + model = SVR(kernel="rbf").fit(X, y) + with pytest.raises(ValueError, match="max_order=1"): + ProductKernelExplainer(model=model, max_order=2) + + def test_unsupported_model_raises(self): + from sklearn.linear_model import LinearRegression + + X, y = _pk_regression_data() + model = LinearRegression().fit(X, y) + with pytest.raises(TypeError, match="Unsupported model type"): + ProductKernelExplainer(model=model, max_order=1) + + def test_multiclass_svc_raises(self): + from sklearn.svm import SVC + + rng = np.random.default_rng(42) + X = rng.normal(size=(60, 5)) + y = rng.integers(0, 3, size=60) + model = SVC(kernel="rbf", probability=True).fit(X, y) + with pytest.raises(TypeError, match="binary SVM"): + ProductKernelExplainer(model=model, max_order=1) diff --git a/tests/shapiq/test_game_theory.py b/tests/shapiq/test_game_theory.py new file mode 100644 index 000000000..b82d68bcf --- /dev/null +++ b/tests/shapiq/test_game_theory.py @@ -0,0 +1,129 @@ +"""Tests for game theory module: ExactComputer, indices, Moebius converter.""" + +from __future__ import annotations + +import numpy as np +import pytest + +from shapiq.game_theory.exact import ExactComputer +from shapiq.game_theory.indices import ( + get_computation_index, + index_generalizes_bv, + index_generalizes_sv, + is_index_valid, +) +from shapiq.game_theory.moebius_converter import MoebiusConverter +from shapiq.interaction_values import InteractionValues +from shapiq_games.synthetic import DummyGame + +# =================================================================== +# ExactComputer +# =================================================================== + + +class TestExactComputer: + """Tests for exact computation of interaction indices.""" + + def test_sv_on_dummy_game(self): + game = DummyGame(n=3, interaction=(0, 1)) + computer = ExactComputer(game) + sv = computer("SV", order=1) + + assert isinstance(sv, InteractionValues) + assert sv.index == "SV" + assert sv.n_players == 3 + + # SV satisfies efficiency: sum = game(N) - game(empty) + grand = float(game(np.ones((1, 3), dtype=bool))[0]) + empty = float(game(np.zeros((1, 3), dtype=bool))[0]) + assert float(np.sum(sv.values)) == pytest.approx(grand - empty, abs=1e-10) + + def test_sii_on_dummy_game(self): + game = DummyGame(n=3, interaction=(0, 1)) + computer = ExactComputer(game) + sii = computer("SII", order=2) + + assert isinstance(sii, InteractionValues) + assert sii.index == "SII" + assert sii.max_order == 2 + + def test_k_sii_on_dummy_game(self): + game = DummyGame(n=3, interaction=(0, 1)) + computer = ExactComputer(game) + k_sii = computer("k-SII", order=2) + + assert isinstance(k_sii, InteractionValues) + assert k_sii.index == "k-SII" + + # k-SII satisfies efficiency + grand = float(game(np.ones((1, 3), dtype=bool))[0]) + empty = float(game(np.zeros((1, 3), dtype=bool))[0]) + assert float(np.sum(k_sii.values)) == pytest.approx(grand - empty, abs=1e-10) + + @pytest.mark.parametrize("index", ["SV", "SII", "k-SII", "STII", "FSII", "FBII", "BV", "BII"]) + def test_all_common_indices(self, index): + """ExactComputer should handle all common indices without error.""" + game = DummyGame(n=3, interaction=(0, 1)) + computer = ExactComputer(game) + order = 1 if index in ("SV", "BV") else 2 + result = computer(index, order=order) + assert isinstance(result, InteractionValues) + + def test_moebius_values(self): + game = DummyGame(n=3, interaction=(0, 1)) + computer = ExactComputer(game) + moebius = computer("Moebius", order=3) + assert isinstance(moebius, InteractionValues) + + +# =================================================================== +# Index utilities +# =================================================================== + + +class TestIndices: + def test_is_index_valid_true(self): + assert is_index_valid("SV") + assert is_index_valid("k-SII") + + def test_is_index_valid_false(self): + assert not is_index_valid("NOT_REAL") + + def test_is_index_valid_raises(self): + with pytest.raises(ValueError): + is_index_valid("NOT_REAL", raise_error=True) + + def test_generalizes_sv(self): + assert index_generalizes_sv("SII") + assert index_generalizes_sv("k-SII") + assert not index_generalizes_sv("BV") + assert not index_generalizes_sv("SV") + + def test_generalizes_bv(self): + assert index_generalizes_bv("BII") + assert not index_generalizes_bv("SII") + + def test_get_computation_index(self): + assert get_computation_index("k-SII") == "SII" + assert get_computation_index("SV") == "SII" + assert get_computation_index("BV") == "BII" + assert get_computation_index("STII") == "STII" + + +# =================================================================== +# Moebius converter +# =================================================================== + + +class TestMoebiusConverter: + def test_sii_to_k_sii_roundtrip(self): + """Convert SII -> k-SII and verify it's a valid InteractionValues.""" + game = DummyGame(n=3, interaction=(0, 1)) + computer = ExactComputer(game) + sii = computer("SII", order=2) + + converter = MoebiusConverter(sii) + k_sii = converter("k-SII") + + assert isinstance(k_sii, InteractionValues) + assert k_sii.index == "k-SII" diff --git a/tests/shapiq/test_imputers.py b/tests/shapiq/test_imputers.py new file mode 100644 index 000000000..23c79cf33 --- /dev/null +++ b/tests/shapiq/test_imputers.py @@ -0,0 +1,93 @@ +"""Protocol tests for all imputers.""" + +from __future__ import annotations + +import numpy as np +import pytest + +from shapiq.imputer import ( + BaselineImputer, + GaussianCopulaImputer, + GaussianImputer, + MarginalImputer, +) + +# --------------------------------------------------------------------------- +# Shared helpers +# --------------------------------------------------------------------------- + +_RNG = np.random.default_rng(42) +_DATA = _RNG.normal(size=(30, 5)) +_Y = _DATA[:, 0] + 0.5 * _DATA[:, 1] + + +def _simple_model(X: np.ndarray) -> np.ndarray: + return X.sum(axis=1) + + +# --------------------------------------------------------------------------- +# Registry +# --------------------------------------------------------------------------- + +IMPUTER_CONFIGS = [ + {"cls": MarginalImputer, "kwargs": {"sample_size": 10}}, + {"cls": BaselineImputer, "kwargs": {}}, + {"cls": GaussianImputer, "kwargs": {"sample_size": 10}}, + {"cls": GaussianCopulaImputer, "kwargs": {"sample_size": 10}}, +] + + +def _imputer_id(config: dict) -> str: + return config["cls"].__name__ + + +# =================================================================== +# Protocol +# =================================================================== + + +@pytest.mark.parametrize("config", IMPUTER_CONFIGS, ids=_imputer_id) +class TestImputerProtocol: + """Contract checks for all imputers.""" + + def test_fit_and_call(self, config): + """fit() + __call__() produces array of correct length.""" + imputer = config["cls"]( + model=_simple_model, data=_DATA.copy(), random_state=42, **config["kwargs"] + ) + imputer.fit(_DATA[0]) + + # All features present + coalition_all = np.ones((1, 5), dtype=bool) + result = imputer(coalition_all) + assert result.shape == (1,) + + # No features present + coalition_none = np.zeros((1, 5), dtype=bool) + result = imputer(coalition_none) + assert result.shape == (1,) + + def test_multiple_coalitions(self, config): + """Handles batch of coalitions.""" + imputer = config["cls"]( + model=_simple_model, data=_DATA.copy(), random_state=42, **config["kwargs"] + ) + imputer.fit(_DATA[0]) + + coalitions = np.eye(5, dtype=bool) # one feature at a time + result = imputer(coalitions) + assert result.shape == (5,) + + def test_full_coalition_approximates_prediction(self, config): + """With all features present, result should be close to model prediction.""" + imputer = config["cls"]( + model=_simple_model, data=_DATA.copy(), random_state=42, **config["kwargs"] + ) + x = _DATA[0] + imputer.fit(x) + + coalition_all = np.ones((1, 5), dtype=bool) + result = float(imputer(coalition_all)[0]) + expected = float(_simple_model(x.reshape(1, -1))[0]) + + assert result == pytest.approx(expected, abs=0.5) diff --git a/tests/shapiq/test_interaction_values.py b/tests/shapiq/test_interaction_values.py new file mode 100644 index 000000000..1e6df6311 --- /dev/null +++ b/tests/shapiq/test_interaction_values.py @@ -0,0 +1,157 @@ +"""Tests for the InteractionValues data structure.""" + +from __future__ import annotations + +import numpy as np +import pytest + +from shapiq.interaction_values import InteractionValues, aggregate_interaction_values +from shapiq.utils import powerset + +# --------------------------------------------------------------------------- +# Helpers +# --------------------------------------------------------------------------- + + +def _make_iv( + n_players: int = 5, + max_order: int = 2, + min_order: int = 1, + index: str = "k-SII", + baseline: float = 1.0, +) -> InteractionValues: + """Create a deterministic InteractionValues for testing.""" + interaction_lookup = {} + values = [] + for i, interaction in enumerate( + powerset(range(n_players), min_size=min_order, max_size=max_order) + ): + interaction_lookup[interaction] = i + values.append(float(i) * 0.1) + return InteractionValues( + values=np.array(values), + index=index, + n_players=n_players, + min_order=min_order, + max_order=max_order, + interaction_lookup=interaction_lookup, + baseline_value=baseline, + estimated=True, + estimation_budget=100, + ) + + +# =================================================================== +# Creation & basic access +# =================================================================== + + +class TestCreation: + def test_basic_properties(self): + iv = _make_iv() + assert iv.n_players == 5 + assert iv.max_order == 2 + assert iv.min_order == 1 + assert iv.index == "k-SII" + assert iv.baseline_value == 1.0 + assert iv.estimated is True + assert iv.estimation_budget == 100 + + def test_getitem_single_interaction(self): + iv = _make_iv() + val = iv[(0,)] + assert isinstance(val, float) + + def test_getitem_missing_returns_zero(self): + iv = _make_iv(max_order=1) + assert iv[(0, 1)] == 0.0 + + def test_empty_interaction_is_baseline(self): + iv = _make_iv(min_order=0) + assert iv[()] == pytest.approx(iv.baseline_value) + + @pytest.mark.parametrize( + ("index", "should_warn"), + [("k-SII", False), ("SII", False), ("NOT_VALID", True)], + ) + def test_invalid_index_warns(self, index, should_warn): + if should_warn: + with pytest.warns(UserWarning): + _make_iv(index=index) + else: + _make_iv(index=index) # should not warn + + +# =================================================================== +# Order extraction +# =================================================================== + + +class TestOrderExtraction: + def test_get_n_order_values_shape(self): + iv = _make_iv(n_players=5, max_order=2, min_order=1) + order_1 = iv.get_n_order_values(1) + assert order_1.shape == (5,) + + def test_get_n_order(self): + iv = _make_iv(n_players=5, max_order=2, min_order=1) + iv_order1 = iv.get_n_order(order=1) + assert iv_order1.max_order == 1 + assert iv_order1.min_order == 1 + + +# =================================================================== +# Serialization +# =================================================================== + + +class TestSerialization: + def test_json_roundtrip(self, tmp_path): + iv = _make_iv() + path = tmp_path / "test_iv.json" + iv.to_json_file(path) + loaded = InteractionValues.from_json_file(path) + + assert loaded.n_players == iv.n_players + assert loaded.index == iv.index + assert np.allclose(loaded.values, iv.values) + assert loaded.baseline_value == pytest.approx(iv.baseline_value) + + +# =================================================================== +# Aggregation +# =================================================================== + + +class TestAggregation: + def test_aggregate_mean(self): + iv1 = _make_iv() + iv2_values = iv1.values.copy() + iv2_values[:] = 1.0 + iv2 = InteractionValues( + values=iv2_values, + index=iv1.index, + n_players=iv1.n_players, + min_order=iv1.min_order, + max_order=iv1.max_order, + interaction_lookup=dict(iv1.interaction_lookup), + baseline_value=iv1.baseline_value, + ) + result = aggregate_interaction_values([iv1, iv2]) + assert isinstance(result, InteractionValues) + assert result.n_players == iv1.n_players + + +# =================================================================== +# Copy behavior +# =================================================================== + + +class TestCopy: + def test_deepcopy_independent(self): + from copy import deepcopy + + iv = _make_iv() + iv_copy = deepcopy(iv) + iv_copy.values[0] = 999.0 + assert iv.values[0] != 999.0 diff --git a/tests/shapiq/test_plots.py b/tests/shapiq/test_plots.py new file mode 100644 index 000000000..509894d5c --- /dev/null +++ b/tests/shapiq/test_plots.py @@ -0,0 +1,51 @@ +"""Smoke tests for plotting functions — verify they run without error.""" + +from __future__ import annotations + +import matplotlib as mpl +import numpy as np +import pytest + +mpl.use("Agg") + +import matplotlib.pyplot as plt + +from shapiq.interaction_values import InteractionValues +from shapiq.plot import bar_plot, force_plot, waterfall_plot +from shapiq.utils import powerset + + +@pytest.fixture +def sample_iv(): + """Small InteractionValues for plotting.""" + n = 4 + interaction_lookup = {} + values = [] + for i, interaction in enumerate(powerset(range(n), min_size=1, max_size=2)): + interaction_lookup[interaction] = i + values.append(float(i) * 0.1 - 0.3) + return InteractionValues( + values=np.array(values), + index="k-SII", + n_players=n, + min_order=1, + max_order=2, + interaction_lookup=interaction_lookup, + baseline_value=0.5, + ) + + +class TestPlots: + """Smoke tests: plots run without raising.""" + + def test_bar_plot(self, sample_iv): + bar_plot([sample_iv.get_n_order(order=1)]) + plt.close("all") + + def test_waterfall_plot(self, sample_iv): + waterfall_plot(sample_iv.get_n_order(order=1)) + plt.close("all") + + def test_force_plot(self, sample_iv): + force_plot(sample_iv.get_n_order(order=1)) + plt.close("all") diff --git a/tests/shapiq/test_public_api.py b/tests/shapiq/test_public_api.py new file mode 100644 index 000000000..76aabedfc --- /dev/null +++ b/tests/shapiq/test_public_api.py @@ -0,0 +1,49 @@ +"""Tests that every concrete public subclass is registered in its module's __all__. + +These guard against adding a new subclass without listing it in __all__. +""" + +from __future__ import annotations + +import importlib +import inspect + +import pytest + + +def _find_concrete_subclasses(module: object, base: type) -> set[str]: + """Return names of all concrete, public subclasses of base visible in module.""" + return { + name + for name, obj in inspect.getmembers(module, inspect.isclass) + if issubclass(obj, base) + and obj is not base + and not inspect.isabstract(obj) + and not name.startswith("_") + } + + +@pytest.mark.parametrize( + ("module_path", "base_path"), + [ + ("shapiq.approximator", "shapiq.approximator.base:Approximator"), + ("shapiq.explainer", "shapiq.explainer.base:Explainer"), + ("shapiq.imputer", "shapiq.imputer.base:Imputer"), + ], + ids=["approximator", "explainer", "imputer"], +) +def test_all_concrete_subclasses_in_all(module_path: str, base_path: str) -> None: + """Every concrete public subclass must appear in its module's __all__.""" + module = importlib.import_module(module_path) + base_module_path, base_class_name = base_path.split(":") + base: type = getattr(importlib.import_module(base_module_path), base_class_name) + + concrete = _find_concrete_subclasses(module, base) + exported = set(module.__all__) + missing = concrete - exported + + pkg_init = f"src/shapiq/{module_path.split('.')[-1]}/__init__.py" + assert not missing, ( + f"Concrete subclasses not listed in {module_path}.__all__: {missing}. " + f"Add them to {pkg_init}." + ) diff --git a/tests/shapiq/test_tree.py b/tests/shapiq/test_tree.py new file mode 100644 index 000000000..f76786317 --- /dev/null +++ b/tests/shapiq/test_tree.py @@ -0,0 +1,301 @@ +"""Protocol, SHAP comparison, and edge-case tests for the tree module.""" + +from __future__ import annotations + +import importlib.util + +import numpy as np +import pytest + +from shapiq.interaction_values import InteractionValues +from shapiq.tree import TreeExplainer, TreeModel + +# --------------------------------------------------------------------------- +# Skip markers +# --------------------------------------------------------------------------- +skip_if_no_xgboost = pytest.mark.skipif( + not importlib.util.find_spec("xgboost"), reason="xgboost not installed" +) +skip_if_no_lightgbm = pytest.mark.skipif( + not importlib.util.find_spec("lightgbm"), reason="lightgbm not installed" +) + +# --------------------------------------------------------------------------- +# Shared data (module-level, generated once) +# --------------------------------------------------------------------------- +_RNG = np.random.default_rng(42) +_BG_REG_X = _RNG.normal(size=(100, 7)) +_BG_REG_Y = _BG_REG_X[:, 0] + 0.5 * _BG_REG_X[:, 1] + _RNG.normal(0, 0.1, size=100) +_BG_CLF_Y = (np.median(_BG_REG_Y) < _BG_REG_Y).astype(int) + + +# --------------------------------------------------------------------------- +# Model fixtures +# --------------------------------------------------------------------------- + + +@pytest.fixture(scope="module") +def dt_reg(): + from sklearn.tree import DecisionTreeRegressor + + m = DecisionTreeRegressor(max_depth=3, random_state=42) + m.fit(_BG_REG_X, _BG_REG_Y) + return m + + +@pytest.fixture(scope="module") +def rf_reg(): + from sklearn.ensemble import RandomForestRegressor + + m = RandomForestRegressor(n_estimators=5, max_depth=3, random_state=42) + m.fit(_BG_REG_X, _BG_REG_Y) + return m + + +@pytest.fixture(scope="module") +def rf_clf(): + from sklearn.ensemble import RandomForestClassifier + + m = RandomForestClassifier(n_estimators=5, max_depth=3, random_state=42) + m.fit(_BG_REG_X, _BG_CLF_Y) + return m + + +@pytest.fixture(scope="module") +def et_reg(): + from sklearn.ensemble import ExtraTreesRegressor + + m = ExtraTreesRegressor(n_estimators=5, max_depth=3, random_state=42) + m.fit(_BG_REG_X, _BG_REG_Y) + return m + + +@pytest.fixture(scope="module") +def xgb_reg(): + pytest.importorskip("xgboost") + from xgboost import XGBRegressor + + m = XGBRegressor(n_estimators=3, max_depth=3, random_state=42) + m.fit(_BG_REG_X, _BG_REG_Y) + return m + + +@pytest.fixture(scope="module") +def xgb_clf(): + pytest.importorskip("xgboost") + from xgboost import XGBClassifier + + m = XGBClassifier(n_estimators=3, max_depth=3, random_state=42) + m.fit(_BG_REG_X, _BG_CLF_Y) + return m + + +@pytest.fixture(scope="module") +def lgbm_clf(): + pytest.importorskip("lightgbm") + from lightgbm import LGBMClassifier + + m = LGBMClassifier( + n_estimators=3, max_depth=3, random_state=42, verbose=-1, min_child_samples=5 + ) + m.fit(_BG_REG_X, _BG_CLF_Y) + return m + + +# =================================================================== +# Protocol: every tree model must satisfy these +# =================================================================== + + +# task: "regression" (predict), "proba_clf" (predict_proba[0, class_index]), +# "basic" (only check IV shape, no efficiency) +SKLEARN_TREE_MODELS = [ + ("dt_reg", "regression", None), + ("rf_reg", "regression", None), + ("rf_clf", "proba_clf", 0), + ("et_reg", "regression", None), +] + +OPTIONAL_TREE_MODELS = [ + pytest.param("xgb_reg", "regression", None, marks=skip_if_no_xgboost), + pytest.param("xgb_clf", "basic", 0, marks=skip_if_no_xgboost), + pytest.param("lgbm_clf", "basic", 0, marks=skip_if_no_lightgbm), +] + +ALL_TREE_MODELS = SKLEARN_TREE_MODELS + OPTIONAL_TREE_MODELS + + +def _tree_id(item) -> str: + if hasattr(item, "values"): + return item.values[0] + return item[0] + + +@pytest.mark.parametrize( + ("model_fixture", "task", "class_index"), + ALL_TREE_MODELS, + ids=[_tree_id(t) for t in ALL_TREE_MODELS], +) +class TestTreeProtocol: + """Universal contract checks for tree explainers across model types.""" + + def test_explain_returns_interaction_values(self, model_fixture, task, class_index, request): + model = request.getfixturevalue(model_fixture) + explainer = TreeExplainer(model=model, max_order=2, min_order=1, class_index=class_index) + x = _BG_REG_X[0] + result = explainer.explain(x) + + assert isinstance(result, InteractionValues) + assert result.max_order == 2 + assert result.n_players == _BG_REG_X.shape[1] + + def test_efficiency(self, model_fixture, task, class_index, request): + """sum(values) == prediction for SV (regression / sklearn classifier).""" + if task == "basic": + pytest.skip("Efficiency check not applicable for booster classifiers") + model = request.getfixturevalue(model_fixture) + explainer = TreeExplainer( + model=model, max_order=1, min_order=0, index="SV", class_index=class_index + ) + x = _BG_REG_X[0] + result = explainer.explain(x) + + if task == "regression": + prediction = float(model.predict(x.reshape(1, -1))[0]) + else: # proba_clf + prediction = float(model.predict_proba(x.reshape(1, -1))[0, class_index]) + + assert float(np.sum(result.values)) == pytest.approx(prediction, rel=1e-4, abs=1e-6) + + def test_baseline_matches_empty_prediction(self, model_fixture, task, class_index, request): + model = request.getfixturevalue(model_fixture) + explainer = TreeExplainer( + model=model, max_order=1, min_order=0, index="SV", class_index=class_index + ) + expected_baseline = sum(te.empty_prediction for te in explainer._treeshapiq_explainers) + assert explainer.baseline_value == pytest.approx(expected_baseline) + + +# =================================================================== +# Manual TreeModel test (no sklearn dependency) +# =================================================================== + + +class TestManualTreeModel: + """Test TreeExplainer with a hand-crafted TreeModel.""" + + def test_against_known_values(self): + """Verify SV computation against known SHAP library values.""" + children_left = np.asarray([1, 2, 3, -1, -1, -1, 7, -1, -1]) + children_right = np.asarray([6, 5, 4, -1, -1, -1, 8, -1, -1]) + features = np.asarray([0, 1, 0, -2, -2, -2, 2, -2, -2]) + thresholds = np.asarray([0, 0, -0.5, -2, -2, -2, 0, -2, -2]) + node_sample_weight = np.asarray([100, 50, 38, 15, 23, 12, 50, 20, 30]) + values = [110, 105, 95, 20, 50, 100, 75, 10, 40] + values = np.asarray([v / max(values) for v in values]) + + tree_model = TreeModel( + children_left=children_left, + children_right=children_right, + children_missing=children_left, + features=features, + thresholds=thresholds, + node_sample_weight=node_sample_weight, + values=values, + ) + + x = np.asarray([-1, -0.5, 1, 0]) + explainer = TreeExplainer(model=tree_model, max_order=1, min_order=1, index="SV") + result = explainer.explain(x) + + assert result[(0,)] == pytest.approx(-0.09263158, abs=1e-4) + assert result[(1,)] == pytest.approx(-0.12100478, abs=1e-4) + assert result[(2,)] == pytest.approx(0.02727273, abs=1e-4) + assert result[(3,)] == pytest.approx(0.0, abs=1e-4) + + def test_sv_warning_for_order_2(self): + """SV with max_order > 1 should warn.""" + children_left = np.asarray([1, -1, -1]) + children_right = np.asarray([2, -1, -1]) + features = np.asarray([0, -2, -2]) + thresholds = np.asarray([0.0, -2.0, -2.0]) + node_sample_weight = np.asarray([10, 5, 5]) + values = np.asarray([0.5, 0.3, 0.7]) + + tree_model = TreeModel( + children_left=children_left, + children_right=children_right, + children_missing=children_left, + features=features, + thresholds=thresholds, + node_sample_weight=node_sample_weight, + values=values, + ) + with pytest.warns(UserWarning): + TreeExplainer(model=tree_model, max_order=2, min_order=1, index="SV") + + +# =================================================================== +# Edge cases (regression tests for past bugs) +# =================================================================== + + +class TestTreeEdgeCases: + """Regression tests for specific bugs fixed in the tree module.""" + + def test_high_dimensional_indices_do_not_overflow(self): + """Regression: int64 indices with >127 features (was overflowing to int8).""" + from shapiq.approximator.proxy.proxyshap import MSRBiased + from shapiq.tree.interventional.cext import compute_interactions_sparse + + n_features = 170 + approximator = MSRBiased(n=n_features, max_order=1, index="SV") + coalition_matrix = np.zeros((3, n_features), dtype=np.int64) + coalition_matrix[0, :5] = 1 + coalition_matrix[1, 100:110] = 1 + coalition_matrix[2, 160:] = 1 + + e_matrix, r_matrix, e_counts, r_counts = approximator._coalitions_to_tree_paths( + coalition_matrix + ) + + assert e_matrix.dtype == np.int64 + assert r_matrix.dtype == np.int64 + + coalition_values = np.array([0.1, -0.2, 0.3], dtype=np.float32) + interactions = compute_interactions_sparse( + coalition_values, e_matrix, r_matrix, e_counts, r_counts, "SV", n_features, 1 + ) + assert isinstance(interactions, dict) + assert all(0 <= f < n_features for key in interactions for f in key) + + def test_repeated_flatten_calls_no_segfault(self): + """Regression: refcount corruption in C-extension flatten output.""" + from shapiq.tree.interventional.cext import compute_interactions_flatten + + n_features = 200 + n_iterations = n_features + leaf_predictions = np.ones(n_iterations, dtype=np.float32) + features = np.arange(n_features, dtype=np.int64) + e_sizes = np.ones(n_iterations, dtype=np.int64) + r_sizes = np.zeros(n_iterations, dtype=np.int64) + feature_in_e = np.ones(n_iterations, dtype=np.int64) + leaf_id = np.zeros(n_iterations, dtype=np.int64) + + for _ in range(5): + out = compute_interactions_flatten( + leaf_predictions, + features, + e_sizes, + r_sizes, + feature_in_e, + leaf_id, + "SV", + n_iterations, + n_features, + n_iterations, + 1, + 0, + 1.0, + ) + assert len(out) == n_features diff --git a/tests/shapiq/tests_deprecation/__init__.py b/tests/shapiq/tests_deprecation/__init__.py deleted file mode 100644 index 75eb694f0..000000000 --- a/tests/shapiq/tests_deprecation/__init__.py +++ /dev/null @@ -1,14 +0,0 @@ -"""A test module which contains tests for deprecations. - -This module is used to ensure that deprecated features are properly flagged and that after -they should be removed, that they indeed are no longer present in the codebase. - -Usage: - - Adding Deprecations: If you add a new deprecation, you should add a test here to ensure that - it is raised properly. Ensure that in each deprecation message, you include the version - of future removal, so that users can easily identify when the feature will be removed. - The test should check that the deprecation warning includes a version. - - Removing Deprecations: If you remove a deprecated feature, ensure that the test for that - feature is also removed. This helps keep the test suite clean and focused on current - features. -""" diff --git a/tests/shapiq/tests_deprecation/deprecated_behaviour.py b/tests/shapiq/tests_deprecation/deprecated_behaviour.py deleted file mode 100644 index 78ec747c3..000000000 --- a/tests/shapiq/tests_deprecation/deprecated_behaviour.py +++ /dev/null @@ -1,23 +0,0 @@ -"""Collects all deprecated behavior tests. - -Test functions in this module are registered as deprecated features using the `register_deprecated` -decorator from `features.py`. Each test function should be decorated with `register_deprecated`, -which takes the name of the deprecated feature, the version in which it was deprecated, and the -version in which it will be removed as arguments. - -Example: - >>> from .features import register_deprecated - - >>> @register_deprecated(name="Game(path_to_values=...)", deprecated_in="1.3.1", removed_in="1.4.0") - >>> def deprecated_game_init_with_path(request: pytest.FixtureRequest) -> None: - >>> from shapiq.game import Game - >>> - >>> tmp_path = request.getfixturevalue("tmp_path") - >>> game = request.getfixturevalue("cooking_game_pre_computed") - >>> path = tmp_path / "dummy_game.json" - >>> game.save(path) - >>> Game(path_to_values=path) - -""" - -from __future__ import annotations diff --git a/tests/shapiq/tests_deprecation/features.py b/tests/shapiq/tests_deprecation/features.py deleted file mode 100644 index d454e6f55..000000000 --- a/tests/shapiq/tests_deprecation/features.py +++ /dev/null @@ -1,79 +0,0 @@ -"""A module containing all deprecated features / behaviors in the shapiq package. - -Usage: - To add a new deprecated feature or behavior, create an instance of the `DeprecatedFeature` and - append it to the `DEPRECATED_FEATURES` list. The `call` attribute should be a callable that - triggers the deprecation warning when executed. The `deprecated_in` and `removed_in` attributes - should specify the version in which the feature was deprecated and the version in which it will - be removed, respectively. - -""" - -from __future__ import annotations - -import importlib -import pathlib -import pkgutil -from typing import TYPE_CHECKING, NamedTuple - -if TYPE_CHECKING: - from collections.abc import Callable - - import pytest - - -class DeprecatedFeature(NamedTuple): - """A named tuple to represent a deprecated feature.""" - - name: str - deprecated_in: str - removed_in: str - call: Callable[[pytest.FixtureRequest], None] - - -DEPRECATED_FEATURES: list[DeprecatedFeature] = [] - - -def register_deprecated(name: str, deprecated_in: str, removed_in: str): - def decorator(func: Callable[[pytest.FixtureRequest], None]): - DEPRECATED_FEATURES.append(DeprecatedFeature(name, deprecated_in, removed_in, func)) - return func - - return decorator - - -@register_deprecated( - name="ExampleFeature(NeverRemoveThis)", deprecated_in="1.0.0", removed_in="9.9.9" -) -def example_always_warn(requests: pytest.FixtureRequest): - """An example feature that always raises a deprecation warning using a fixture. - - This "behavior" is just an example of how to handle deprecations in the codebase. This - "feature" needs a fixture (in this case an example game) which is passed via the `request` - fixture. The warning which is raised contains the same version information as the - `DeprecatedFeature` instance in the `DEPRECATED_FEATURES` list. - - Note: - Do not delete this feature, as it is a good example of how to handle deprecations. - - """ - from shapiq.utils.errors import raise_deprecation_warning - - raise_deprecation_warning( - "This is an example of a deprecated feature that always raises a warning.", - deprecated_in="1.0.0", - removed_in="9.9.9", - ) - _ = requests.getfixturevalue("iv_7_all") # This line grabs the fixture as an example of usage - - -# auto-import all deprecated modules in the current package -def _auto_import_deprecated_modules(): - current_path = pathlib.Path(__file__).parent - for module_info in pkgutil.iter_modules([str(current_path)]): - name = module_info.name - if name not in {"__init__", "features"}: - importlib.import_module(f"{__package__}.{name}") - - -_auto_import_deprecated_modules() diff --git a/tests/shapiq/tests_deprecation/test_deprecations.py b/tests/shapiq/tests_deprecation/test_deprecations.py deleted file mode 100644 index 0692d157b..000000000 --- a/tests/shapiq/tests_deprecation/test_deprecations.py +++ /dev/null @@ -1,63 +0,0 @@ -"""This module contains tests for deprecations.""" - -from __future__ import annotations - -import inspect -import re -import warnings -from importlib.metadata import version - -import pytest -from packaging.version import parse - -from .features import DEPRECATED_FEATURES, DeprecatedFeature - - -def feature_should_be_removed(feature: DeprecatedFeature) -> None: - """Fails if the feature is still accessible after its scheduled removal date.""" - source_file = inspect.getsourcefile(feature.call) - source_line = inspect.getsourcelines(feature.call)[1] - if parse(version("shapiq")) >= parse(feature.removed_in): - pytest.fail( - f"{feature.name} was scheduled for removal in {feature.removed_in} " - f"but is still accessible. Remove the deprecated behavior and this test.\n" - f"Feature registered at: {source_file}:{source_line}" - ) - - -def feature_raises_deprecation_warning( - feature: DeprecatedFeature, request: pytest.FixtureRequest -) -> None: - """Fails if the feature does not raise a deprecation warning.""" - expected_msg = ( - f"deprecated in version {feature.deprecated_in} and will be removed in version " - f"{feature.removed_in}." - ) - - with warnings.catch_warnings(record=True) as caught: - warnings.simplefilter("always", DeprecationWarning) - feature.call(request) - - deprecation_warnings = [w for w in caught if issubclass(w.category, DeprecationWarning)] - - # check if any deprecation warning matches the expected regex - if not any(re.search(expected_msg, str(w.message)) for w in deprecation_warnings): - formatted = "\n".join(f"{w.category.__name__}: {w.message}" for w in deprecation_warnings) - source_file = inspect.getsourcefile(feature.call) - source_line = inspect.getsourcelines(feature.call)[1] - pytest.fail( - f"No matching DeprecationWarning for feature '{feature.name}'.\n" - f"Expected regex: {expected_msg}\n" - f"Warnings captured: {formatted or 'None'}\n" - f"Feature registered at: {source_file}:{source_line}\n" - ) - - -@pytest.mark.parametrize("feature", DEPRECATED_FEATURES, ids=lambda f: f.name) -def test_deprecated_features(feature: DeprecatedFeature, request: pytest.FixtureRequest): - """Tests the deprecated initialization with path_to_values.""" - # check if the feature should already be removed - feature_should_be_removed(feature) - - # check if the feature raises a correct deprecation warning - feature_raises_deprecation_warning(feature, request) diff --git a/tests/shapiq/tests_integration_tests/__init__.py b/tests/shapiq/tests_integration_tests/__init__.py deleted file mode 100644 index a916f18f3..000000000 --- a/tests/shapiq/tests_integration_tests/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Integration tests for the package.""" diff --git a/tests/shapiq/tests_integration_tests/compute_test_explanations.py b/tests/shapiq/tests_integration_tests/compute_test_explanations.py deleted file mode 100644 index 3d1fb1ea1..000000000 --- a/tests/shapiq/tests_integration_tests/compute_test_explanations.py +++ /dev/null @@ -1,137 +0,0 @@ -"""Script to compute explanations used in the tests of the ``shapiq`` library. - -A script which uses the ExactComputer to compute a variety of explanations for a couple of -model and datasets to be used for testing in the ``shapiq`` library. -""" - -# flake8: noqa: T201 - -from __future__ import annotations - -from pathlib import Path -from typing import TYPE_CHECKING, get_args - -from shapiq.explainer.tabular import TabularExplainerIndices -from shapiq.game_theory.exact import ExactComputer -from shapiq.tree.treeshapiq import TreeSHAPIQIndices -from shapiq_games.benchmark.treeshapiq_xai import TreeSHAPIQXAI -from tests.shapiq.fixtures.data import get_california_housing_train_test_explain -from tests.shapiq.fixtures.games import get_california_housing_imputer -from tests.shapiq.fixtures.models import get_california_housing_random_forest - -if TYPE_CHECKING: - from shapiq.explainer.custom_types import ExplainerIndices - from shapiq.game import Game - from shapiq.interaction_values import InteractionValues - - -def _compute_values( - game: Game, - interaction_indices: list[ExplainerIndices], - save_name: str, - save_path: Path | None = None, -) -> dict[str, InteractionValues]: - """Compute interaction values for the given game and save them to disk.""" - - ivs = {} - - exact_computer = ExactComputer(game=game, n_players=game.n_players, evaluate_game=True) - value_indices = ["SV", "BV"] - for index in value_indices: - iv = exact_computer(index=index, order=1) - iv = iv.get_n_order(order=1) - name = f"{save_name}_index={index}_order=1.json" - if save_path is not None: - iv.save(path=save_path / name) - ivs[name] = iv - print(f"Interaction values for index {index} (order 1):") - print(iv) - - # compute Moebius as well - iv = exact_computer(index="Moebius", order=game.n_players) - name = f"{save_name}_index=Moebius_order={game.n_players}.json" - if save_path is not None: - iv.save(path=save_path / name) - ivs[name] = iv - print("Moebius interaction values:") - print(iv) - - # compute interaction values for all indices that are in the ExplainerIndices - orders = list(range(1, game.n_players + 1)) - for index in interaction_indices: - if index in value_indices: - continue - for order in orders: - iv = exact_computer(index=index, order=order) - iv = iv.get_n_order(min_order=1, max_order=order) - name = f"{save_name}_index={index}_order={order}.json" - if save_path is not None: - iv.save(path=save_path / name) - ivs[name] = iv - print(f"Interaction values for index {index} (order {order}):") - print(iv) - - return ivs - - -def compute_tabular_explanations(save_path: Path | None = None) -> dict[str, InteractionValues]: - """Compute explanations for the California Housing dataset using the Tabular Explainer.""" - _x_train, _y_train, x_test, y_test, x_explain = get_california_housing_train_test_explain() - model = get_california_housing_random_forest() - print(f"Model score: {model.score(x_test, y_test)}") - print(f"Model prediction for x_explain: {model.predict(x_explain)}") - - # compute explanations - imputer = get_california_housing_imputer() - imputer_hash = hash( - ( - imputer.sample_size, - imputer.joint_marginal_distribution, - imputer.normalize, - imputer.random_state, - ) - ) - print("Imputer hash:", imputer_hash) - assert imputer_hash == 9070456741283270540 - imputer.verbose = True - return _compute_values( - game=imputer, - interaction_indices=list(get_args(TabularExplainerIndices)), - save_name=f"iv_california_housing_imputer_{imputer_hash}", - save_path=save_path, - ) - - -def compute_tree_explanations(save_path: Path | None = None) -> dict[str, InteractionValues]: - """Compute explanations for the California Housing dataset using the TreeSHAPIQ Explainer.""" - _x_train, _y_train, x_test, y_test, x_explain = get_california_housing_train_test_explain() - model = get_california_housing_random_forest() - print(f"Model score: {model.score(x_test, y_test)}") - print(f"Model prediction for x_explain: {model.predict(x_explain)}") - - game = TreeSHAPIQXAI( - x=x_explain, - tree_model=model, - normalize=False, - verbose=False, - ) - - # compute explanations - return _compute_values( - game=game, - interaction_indices=list(get_args(TreeSHAPIQIndices)), - save_name="iv_california_housing_tree", - save_path=save_path, - ) - - -if __name__ == "__main__": - SAVE_PATH = Path(__file__).parent.parent / "data" / "interaction_values" / "california_housing" - SAVE_PATH.mkdir(parents=True, exist_ok=True) - print(f"Creating and saving interaction values to {SAVE_PATH}") - - # compute the TreeSHAPIQ explanations for the California Housing dataset - compute_tree_explanations(save_path=SAVE_PATH) - - # compute the tabular explanations for the California Housing dataset - compute_tabular_explanations(save_path=SAVE_PATH) diff --git a/tests/shapiq/tests_integration_tests/integration_test_product_kernel_explainer.py b/tests/shapiq/tests_integration_tests/integration_test_product_kernel_explainer.py deleted file mode 100644 index 9cd574da0..000000000 --- a/tests/shapiq/tests_integration_tests/integration_test_product_kernel_explainer.py +++ /dev/null @@ -1,91 +0,0 @@ -"""Integration test for the Product Kernel Explainer using the California Housing dataset.""" - -from __future__ import annotations - -from pathlib import Path -from typing import TYPE_CHECKING, get_args - -from shapiq.explainer.product_kernel.conversion import convert_svm -from shapiq.explainer.product_kernel.game import ProductKernelGame -from shapiq.explainer.product_kernel.product_kernel import ProductKernelSHAPIQIndices -from shapiq.game_theory.exact import ExactComputer -from tests.shapiq.fixtures.data import get_california_housing_train_test_explain -from tests.shapiq.fixtures.models import get_california_housing_svr - -if TYPE_CHECKING: - from shapiq.explainer.custom_types import ValidProductKernelExplainerIndices - from shapiq.game import Game - from shapiq.interaction_values import InteractionValues - - -def _compute_values( - game: Game, - interaction_indices: list[ValidProductKernelExplainerIndices], - save_name: str, - save_path: Path | None = None, -) -> dict[str, InteractionValues]: - """Compute interaction values for the given game and save them to disk.""" - - ivs = {} - - exact_computer = ExactComputer(game=game, n_players=game.n_players, evaluate_game=True) - value_indices = ["SV"] - for index in value_indices: - iv = exact_computer(index=index, order=1) - iv = iv.get_n_order(order=1) - name = f"{save_name}_index={index}_order=1.json" - if save_path is not None: - iv.save(path=save_path / name) - ivs[name] = iv - print(iv) # noqa: T201 - - # compute interaction values for all indices that are in the ValidProductKernelExplainerIndices - orders = list(range(1, game.n_players + 1)) - for index in interaction_indices: - if index in value_indices: - continue - for order in orders: - iv = exact_computer(index=index, order=order) - iv = iv.get_n_order(min_order=1, max_order=order) - name = f"{save_name}_index={index}_order={order}.json" - if save_path is not None: - iv.save(path=save_path / name) - ivs[name] = iv - print(iv) # noqa: T201 - - return ivs - - -def compute_product_kernel_explanations( - save_path: Path | None = None, -) -> dict[str, InteractionValues]: - """Compute explanations for the California Housing dataset using the ProductKernel Explainer.""" - x_train, y_train, x_test, y_test, x_explain = get_california_housing_train_test_explain() - model = get_california_housing_svr() - converted_model = convert_svm(model) - print(f"Model score: {model.score(x_test, y_test)}") # noqa: T201 - print(f"Model prediction for x_explain: {model.predict(x_explain)}") # noqa: T201 - - game = ProductKernelGame( - model=converted_model, - n_players=x_explain.shape[1], - explain_point=x_explain.flatten(), - normalize=False, - ) - - # compute explanations - return _compute_values( - game=game, - interaction_indices=list(get_args(ProductKernelSHAPIQIndices)), - save_name="iv_california_housing_product_kernel", - save_path=save_path, - ) - - -if __name__ == "__main__": - SAVE_PATH = Path(__file__).parent.parent / "data" / "interaction_values" / "california_housing" - SAVE_PATH.mkdir(parents=True, exist_ok=True) - print(f"Creating and saving interaction values to {SAVE_PATH}") # noqa: T201 - - # compute the TreeSHAPIQ explanations for the California Housing dataset - compute_product_kernel_explanations(save_path=SAVE_PATH) diff --git a/tests/shapiq/tests_integration_tests/test_explainer_california_housing.py b/tests/shapiq/tests_integration_tests/test_explainer_california_housing.py deleted file mode 100644 index 1ff4f0037..000000000 --- a/tests/shapiq/tests_integration_tests/test_explainer_california_housing.py +++ /dev/null @@ -1,291 +0,0 @@ -"""Tests that check if the explainer gets the correct interaction values on the California Housing dataset.""" - -from __future__ import annotations - -import pathlib -from typing import TYPE_CHECKING, get_args - -import pytest - -from shapiq.explainer.agnostic import AgnosticExplainer -from shapiq.explainer.base import Explainer -from shapiq.explainer.custom_types import ( - ExplainerIndices, - ValidProductKernelExplainerIndices, -) -from shapiq.explainer.product_kernel import ProductKernelExplainer -from shapiq.explainer.tabular import TabularExplainer, TabularExplainerIndices -from shapiq.interaction_values import InteractionValues -from shapiq.tree import TreeExplainer -from shapiq.tree.treeshapiq import TreeSHAPIQIndices -from tests.shapiq.utils import get_expected_index_or_skip - -if TYPE_CHECKING: - import numpy as np - from sklearn.ensemble import RandomForestRegressor - - from shapiq.typing import IndexType - -TABULAR_NAME_START = "iv_california_housing_imputer_9070456741283270540" -TREE_NAME_START = "iv_california_housing_tree" -PRODUCT_KERNEL_NAME_START = "iv_california_housing_product_kernel" - - -@pytest.fixture(scope="module") -def california_interaction_values() -> dict[str, InteractionValues]: - """Computes the gt if it does not exist.""" - from .compute_test_explanations import ( - compute_tabular_explanations, - compute_tree_explanations, - ) - from .integration_test_product_kernel_explainer import ( - compute_product_kernel_explanations, - ) - - print("Computing interaction values for California Housing dataset...") # noqa: T201 - ivs_tabular = compute_tabular_explanations() - ivs_tree = compute_tree_explanations() - ivs_product_kernel = compute_product_kernel_explanations() - return {**ivs_tabular, **ivs_tree, **ivs_product_kernel} - - -def _load_ground_truth_interaction_values_california( - index: IndexType, order: int, *, tabular: bool -) -> InteractionValues: - """Load the ground truth interactions for the California Housing dataset from disk. - - Note to developers: - This function loads the interaction values that were precomputed by - `tests/tests_integration_tests/compute_test_explanations.py`. - - Args: - index: The index of the interaction values to load. - order: The order of the interaction values to load. - tabular: If True, load the interaction values for the Tabular Explainer, otherwise for the - Tree Explainer. - - Returns: - InteractionValues: The interaction values for the given index and order. - - """ - name_part = TABULAR_NAME_START if tabular else TREE_NAME_START - - save_dir = pathlib.Path(__file__).parent.parent - save_dir = save_dir / "data" / "interaction_values" / "california_housing" - - all_files = list(save_dir.glob(f"{name_part}_index={index}_order={order}.json")) - if len(all_files) != 1: - msg = ( - f"Expected exactly one file for index {index} and order {order}, " - f"but found {len(all_files)} files in {save_dir}." - ) - raise ValueError(msg) - file_path = all_files[0] - return InteractionValues.load(file_path) - - -def _compare( - gt: InteractionValues, - iv: InteractionValues, - index: IndexType, - order: int, - tolerance: float = 0.01, -) -> None: - """Compare the ground truth interaction values with the computed interaction values.""" - tolerance = max(abs(gt.get_n_order(min_order=1).values)) * tolerance - - assert isinstance(gt, InteractionValues) - assert isinstance(iv, InteractionValues) - assert gt.index == iv.index - assert gt.max_order == iv.max_order - assert gt.min_order == iv.min_order - - for key in gt.dict_values: - assert key in iv.dict_values, f"Key {key} not found in computed interaction values." - assert gt.dict_values[key] == pytest.approx(iv.dict_values[key], abs=tolerance), ( - f"Interaction value for key {key} does not match ground truth." - ) - - for key in iv.dict_values: - assert key in gt.dict_values, f"Key {key} not found in ground truth interaction values." - assert iv.dict_values[key] == pytest.approx(gt.dict_values[key], abs=tolerance), ( - f"Computed interaction value for key {key} does not match ground truth." - ) - - # check baseline value - if index not in ["BV", "FBII", "BII"]: - assert gt.baseline_value == pytest.approx(iv.baseline_value, abs=tolerance), ( - f"Baseline value for index {index} and order {order} does not match ground truth." - ) - - -@pytest.mark.integration -class TestCaliforniaHousingExactComputer: - """Tests that checks that the ExactComputer yields correct interaction values on California Housing.""" - - @pytest.mark.parametrize("index", get_args(TabularExplainerIndices)) - @pytest.mark.parametrize("order", [1, 2, 3, 4, 5, 6, 7]) - def test_with_recompute(self, california_interaction_values, index, order): - """Computes the ground truth on the test runner and compares it to the old ground truth.""" - - _ = get_expected_index_or_skip(index, order) - - name = f"{TABULAR_NAME_START}_index={index}_order={order}.json" - gt_iv_runner = california_interaction_values[name] - gt_iv_old = _load_ground_truth_interaction_values_california( - index=index, order=order, tabular=True - ) - - _compare(gt=gt_iv_old, iv=gt_iv_runner, index=index, order=order, tolerance=0.05) - - -@pytest.mark.integration -class TestCaliforniaHousingExplainers: - """Tests that check if the Explainer get the correct interaction values on California Housing. - - This class uses the California Housing dataset and precomputed interaction values to check - if the explainers with complete budget can compute the precomputed interaction values. This - test serves as a regression test to ensure that the explainers work correctly in the future and - also as an integration test to check that the explainers work correctly in a "real-world" - scenario. - """ - - @pytest.mark.parametrize("index", get_args(TreeSHAPIQIndices)) - @pytest.mark.parametrize("order", [1, 2, 3, 4, 5, 6, 7]) - def test_tree_explainer( - self, - index: IndexType, - order: int, - california_housing_train_test_explain: tuple[np.ndarray, ...], - california_housing_rf_model: RandomForestRegressor, - california_interaction_values: dict[str, InteractionValues], - ): - """Test the TreeSHAPIQXAI game on the California Housing dataset.""" - expected_index = get_expected_index_or_skip(index, order) - - # get the data and model - _, _, _, _, x_explain = california_housing_train_test_explain - model = california_housing_rf_model - - # get the explainer and explain - explainer = TreeExplainer(model=model, index=index, max_order=order) - iv = explainer.explain(x_explain.flatten()) - iv = iv.get_n_order(min_order=1, max_order=order) - assert iv.index == expected_index - - # load the ground truth interaction values - name = f"{TREE_NAME_START}_index={index}_order={order}.json" - gt_iv = california_interaction_values[name] - - # do the comparison of the interaction values - _compare(gt=gt_iv, iv=iv, index=index, order=order) - - @pytest.mark.parametrize("index", get_args(ExplainerIndices)) - @pytest.mark.parametrize("order", [1, 2, 3, 4, 5, 6, 7]) - def test_agnostic_explainer( - self, - index: IndexType, - order: int, - california_housing_train_test_explain: tuple[np.ndarray, ...], - california_housing_imputer, - california_interaction_values: dict[str, InteractionValues], - ) -> None: - """Test AgnosticExplainer on the California Housing dataset.""" - # prepare the expected index based on the order and index - expected_index = get_expected_index_or_skip(index, order) - - explainer = AgnosticExplainer( - game=california_housing_imputer, - index=index, - max_order=order, - random_state=42, - ) - iv = explainer.explain(budget=2**california_housing_imputer.n_players, x=None) - iv = iv.get_n_order(min_order=1, max_order=order) - assert iv.index == expected_index - - # load the ground truth interaction values - name = f"{TABULAR_NAME_START}_index={index}_order={order}.json" - gt_iv = california_interaction_values[name] - - # do the comparison of the interaction values - _compare(gt=gt_iv, iv=iv, index=index, order=order) - - @pytest.mark.parametrize("explainer", [TabularExplainer, Explainer]) - @pytest.mark.parametrize("index", get_args(TabularExplainerIndices)) - @pytest.mark.parametrize("order", [1, 2, 3, 4, 5, 6, 7]) - def test_tabular_explainer( - self, - explainer: TabularExplainer | Explainer, - index: IndexType, - order: int, - california_housing_train_test_explain: tuple[np.ndarray, ...], - california_housing_rf_model: RandomForestRegressor, - california_interaction_values: dict[str, InteractionValues], - ) -> None: - """Test the explainer on the California Housing dataset.""" - # prepare the expected index based on the order and index - expected_index = get_expected_index_or_skip(index, order) - - # get the data and model - x_train, _y_train, x_test, _y_test, x_explain = california_housing_train_test_explain - n_features = x_train.shape[1] - model = california_housing_rf_model - - # get the explainer and explain - if not issubclass(explainer, TabularExplainer) and not issubclass(explainer, Explainer): - msg = "The explainer must be a subclass of TabularExplainer or Explainer." - raise ValueError(msg) - - explainer = explainer( - model=model.predict, - data=x_test, - index=index, - max_order=order, - random_state=42, - verbose=False, - # imputer params - imputer="marginal", - sample_size=100, - joint_marginal_distribution=True, - ) - iv = explainer.explain(x_explain, budget=2**n_features) - iv = iv.get_n_order(min_order=1, max_order=order) - assert iv.index == expected_index - - # load the ground truth interaction values - name = f"{TABULAR_NAME_START}_index={index}_order={order}.json" - gt_iv = california_interaction_values[name] - - # do the comparison of the interaction values - _compare(gt=gt_iv, iv=iv, index=index, order=order) - - @pytest.mark.parametrize("index", get_args(ValidProductKernelExplainerIndices)) - @pytest.mark.parametrize("order", [1]) - def test_product_kernel_explainer( - self, - index: IndexType, - order: int, - california_housing_train_test_explain: tuple[np.ndarray, ...], - california_housing_svr_model, - california_interaction_values: dict[str, InteractionValues], - ) -> None: - """Test ProductKernelExplainer on the California Housing dataset.""" - expected_index = get_expected_index_or_skip(index, order) - - # get the data and model - _, _, _, _, x_explain = california_housing_train_test_explain - model = california_housing_svr_model - - # get the explainer and explain - explainer = ProductKernelExplainer(model=model, index=index, max_order=order) - iv = explainer.explain(x_explain.flatten()) - iv = iv.get_n_order(min_order=1, max_order=order) - assert iv.index == expected_index - - # load the ground truth interaction values - name = f"{PRODUCT_KERNEL_NAME_START}_index={index}_order={order}.json" - gt_iv = california_interaction_values[name] - - # do the comparison of the interaction values - _compare(gt=gt_iv, iv=iv, index=index, order=order) diff --git a/tests/shapiq/tests_unit/__init__.py b/tests/shapiq/tests_unit/__init__.py deleted file mode 100644 index 082e9e54a..000000000 --- a/tests/shapiq/tests_unit/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Unit test module for ``shapiq``.""" diff --git a/tests/shapiq/tests_unit/test_configuration.py b/tests/shapiq/tests_unit/test_configuration.py deleted file mode 100644 index 60dd5bc7d..000000000 --- a/tests/shapiq/tests_unit/test_configuration.py +++ /dev/null @@ -1,32 +0,0 @@ -"""Tests the indices configuration module.""" - -from __future__ import annotations - -from typing import get_args - -from shapiq.game_theory.indices import ALL_AVAILABLE_CONCEPTS -from shapiq.typing import IndexType - - -def test_configuration(): - """Tests if the fields in the configuration are correct.""" - all_indices_checked = set() - - for index, index_info in ALL_AVAILABLE_CONCEPTS.items(): - assert index_info["name"] != "" - assert index_info["source"] != "" - assert index_info["generalizes"] != "" - all_indices_checked.add(index) - - assert all_indices_checked == set(ALL_AVAILABLE_CONCEPTS.keys()) - - -def test_all_concepts_in_index_type(): - """Checks if all indices in ALL_AVAILABLE_CONCEPTS are in IndexType.""" - index_type_args = set(get_args(IndexType)) - all_indices = set(ALL_AVAILABLE_CONCEPTS.keys()) - - assert index_type_args == all_indices, ( - f"IndexType does not contain all indices from ALL_AVAILABLE_CONCEPTS. " - f"Missing indices: {all_indices - index_type_args}." - ) diff --git a/tests/shapiq/tests_unit/test_interaction_values.py b/tests/shapiq/tests_unit/test_interaction_values.py deleted file mode 100644 index c8a7d79a1..000000000 --- a/tests/shapiq/tests_unit/test_interaction_values.py +++ /dev/null @@ -1,896 +0,0 @@ -"""This test module contains all tests regarding the InteractionValues dataclass.""" - -from __future__ import annotations - -import contextlib -import pathlib -from copy import copy, deepcopy -from typing import TYPE_CHECKING - -import numpy as np -import pytest - -from shapiq.interaction_values import InteractionValues, aggregate_interaction_values -from shapiq.utils import powerset -from tests.shapiq.fixtures.interaction_values import ( - get_mock_interaction_value, -) - -if TYPE_CHECKING: - from pathlib import Path - - -@pytest.mark.parametrize( - ("index", "n", "min_order", "max_order", "estimation_budget", "estimated"), - [ - ("STII", 5, 1, 2, 100, True), - ("FSII", 5, 1, 2, 100, True), - ("k-SII", 5, 1, 2, 100, True), - ("SII", 5, 1, 2, 100, False), - ("something", 5, 1, 2, 100, False), # expected to fail with ValueError - ], -) -def test_initialization(index, n, min_order, max_order, estimation_budget, estimated): - """Tests the initialization of the InteractionValues dataclass.""" - interaction_lookup = {interaction: i for i, interaction in enumerate(powerset(range(n), 1, 2))} - values = np.random.rand(len(interaction_lookup)) - baseline_value = 2.0 - if index == "something": - with pytest.warns(UserWarning): - interaction_values = InteractionValues( - values=values, - index=index, - n_players=n, - min_order=min_order, - max_order=max_order, - interaction_lookup=interaction_lookup, - estimation_budget=estimation_budget, - estimated=estimated, - baseline_value=baseline_value, - ) - else: - interaction_values = InteractionValues( - values=values, - index=index, - n_players=n, - min_order=min_order, - max_order=max_order, - interaction_lookup=interaction_lookup, - estimation_budget=estimation_budget, - estimated=estimated, - baseline_value=baseline_value, - ) - assert interaction_values.index == index - assert interaction_values.n_players == n - assert interaction_values.min_order == min_order - assert interaction_values.max_order == max_order - assert np.all(interaction_values.values == values) - assert interaction_values.estimation_budget == estimation_budget - assert interaction_values.estimated == estimated - assert interaction_values.interaction_lookup == interaction_lookup - - # test dict_values property - assert interaction_values.dict_values == dict(zip(interaction_lookup, values, strict=False)) - - # check that default values are set correctly - interaction_values_2 = InteractionValues( - values=np.random.rand(len(interaction_lookup)), - index=index, - n_players=n, - min_order=min_order, - max_order=max_order, - baseline_value=baseline_value, - ) - assert interaction_values_2.estimation_budget is None # default value is None - assert interaction_values_2.estimated is True # default value is True - assert interaction_values_2.interaction_lookup == interaction_lookup # automatically generated - - # check the string representations (not semantics) - assert isinstance(str(interaction_values), str) - assert isinstance(repr(interaction_values), str) - assert repr(interaction_values) != str(interaction_values) - - # check equality - interaction_values_copy = copy(interaction_values) - assert interaction_values == interaction_values_copy - assert interaction_values != interaction_values_2 - - with contextlib.suppress(TypeError): - assert interaction_values == 1 # expected to fail with TypeError - - # check that the hash is correct - assert hash(interaction_values) == hash(interaction_values_copy) - assert hash(interaction_values) != hash(interaction_values_2) - - # check getitem - assert interaction_values[(0,)] == interaction_values.values[0] - assert interaction_values[(1,)] == interaction_values.values[1] - assert interaction_values[(0, 1)] == interaction_values.values[n] # first 2nd order is at n - assert interaction_values[(1, 0)] == interaction_values.values[n] # order does not matter - - # check getitem with invalid interaction (not in interaction_lookup) - assert interaction_values[(100, 101)] == 0 # invalid interaction is 0 - - # test getitem with integer as input - assert interaction_values[0] == interaction_values.values[0] - assert interaction_values[-1] == interaction_values.values[-1] - - # check setitem - interaction_values[(0,)] = 999_999 - assert interaction_values[(0,)] == 999_999 - - # check setitem with integer as input - interaction_values[0] = 111_111 - assert interaction_values[0] == 111_111 - - # check setitem raises error for invalid interaction - with pytest.raises(KeyError): - interaction_values[(100, 101)] = 0 - - # test __len__ - assert len(interaction_values) == len(interaction_values.values) - - # test baseline value - assert interaction_values.baseline_value == baseline_value - # test baseline value initialization - with pytest.raises(TypeError): - InteractionValues( - values=values, - index=index, - n_players=n, - min_order=min_order, - max_order=max_order, - interaction_lookup=interaction_lookup, - baseline_value="None", - ) - # expected behavior of interactions is 0 for emptyset - assert interaction_values[()] == 0 - - -def test_add(): - """Tests the __add__ method of the InteractionValues dataclass.""" - index = "SII" - n = 5 - min_order = 1 - max_order = 2 - interaction_lookup = { - interaction: i for i, interaction in enumerate(powerset(range(n), min_order, max_order)) - } - values = np.random.rand(len(interaction_lookup)) - values_copy = deepcopy(values) - interaction_values_first = InteractionValues( - values=values, - index=index, - n_players=n, - min_order=min_order, - max_order=max_order, - interaction_lookup=interaction_lookup, - baseline_value=0.0, - ) - - # test adding scalar values - interaction_values_added = interaction_values_first + 1 - assert np.all(interaction_values_added.values == interaction_values_first.values + 1) - interaction_values_added = 1 + interaction_values_first - assert np.all(interaction_values_added.values == interaction_values_first.values + 1) - interaction_values_added = interaction_values_first + 1.0 - assert np.all(interaction_values_added.values == interaction_values_first.values + 1.0) - - # test adding InteractionValues (without modifying the original) - interaction_values_added = interaction_values_first + interaction_values_first - assert np.all(interaction_values_added.values == 2 * interaction_values_first.values) - assert np.all(interaction_values_first.values == values_copy) # original is not modified - - # test adding InteractionValues with different indices - interaction_values_second = InteractionValues( - values=values, - index="STII", - n_players=n, - min_order=min_order, - max_order=max_order, - interaction_lookup=interaction_lookup, - baseline_value=0.0, - ) - with pytest.warns(match="The indices of the InteractionValues objects are different:"): - result = interaction_values_first + interaction_values_second - assert result.index == interaction_values_first.index - assert result.index != interaction_values_second.index - - # test adding InteractionValues with different interactions - n_players_second = n + 1 - interaction_lookup_second = { - interaction: i - for i, interaction in enumerate(powerset(range(n_players_second), min_order, max_order)) - } - values_second = np.random.rand(len(interaction_lookup_second)) - interaction_values_second = InteractionValues( - values=values_second, - index=index, - n_players=n_players_second, - min_order=min_order, - max_order=max_order + 1, - interaction_lookup=interaction_lookup_second, - baseline_value=0.0, - ) - - # test adding InteractionValues with different interactions - interaction_values_added = interaction_values_first + interaction_values_second - assert interaction_values_added.n_players == n + 1 # is the maximum of the two - assert interaction_values_added.min_order == min_order - assert interaction_values_added.max_order == max_order + 1 # is the maximum of the two - # check weather interactions present in both InteractionValues are added - assert ( - interaction_values_added[(0,)] - == interaction_values_first[(0,)] + interaction_values_second[(0,)] - ) - # check weather the interactions that were not present in the first InteractionValues are added - assert interaction_values_added[(5,)] == interaction_values_second[(5,)] - - # raise TypeError - with pytest.raises(TypeError): - interaction_values_first + "string" - - -def test_sub(): - """Tests the __sub__ method of the InteractionValues dataclass.""" - index = "SII" - n = 5 - min_order = 1 - max_order = 2 - interaction_lookup = { - interaction: i for i, interaction in enumerate(powerset(range(n), min_order, max_order)) - } - values = np.random.rand(len(interaction_lookup)) - values_copy = deepcopy(values) - interaction_values_first = InteractionValues( - values=values, - index=index, - n_players=n, - min_order=min_order, - max_order=max_order, - interaction_lookup=interaction_lookup, - baseline_value=0.0, - ) - - # test subtracting scalar values - interaction_values_sub = interaction_values_first - 1 - assert np.all(interaction_values_sub.values == interaction_values_first.values - 1) - interaction_values_sub = 1 - interaction_values_first - assert np.all(interaction_values_sub.values == 1 - interaction_values_first.values) - - # test subtracting InteractionValues (without modifying the original) - interaction_values_sub = interaction_values_first - interaction_values_first - assert np.all(interaction_values_sub.values == 0) - assert np.all(interaction_values_first.values == values_copy) # original is not modified - - -def test_mul(): - """Tests the __mul__ method of the InteractionValues dataclass.""" - index = "SII" - n = 5 - min_order = 1 - max_order = 2 - interaction_lookup = { - interaction: i for i, interaction in enumerate(powerset(range(n), min_order, max_order)) - } - values = np.random.rand(len(interaction_lookup)) - interaction_values_first = InteractionValues( - values=values, - index=index, - n_players=n, - min_order=min_order, - max_order=max_order, - interaction_lookup=interaction_lookup, - baseline_value=0.0, - ) - - # test adding scalar values - interaction_values_mul = interaction_values_first * 2 - assert np.all(interaction_values_mul.values == 2 * interaction_values_first.values) - interaction_values_mul = 2 * interaction_values_first - assert np.all(interaction_values_mul.values == 2 * interaction_values_first.values) - interaction_values_mul = interaction_values_first * 2.0 - assert np.all(interaction_values_mul.values == 2.0 * interaction_values_first.values) - - -def test_sum(): - """Tests the sum method of the InteractionValues dataclass.""" - index = "SII" - n = 5 - min_order = 1 - max_order = 2 - interaction_lookup = { - interaction: i for i, interaction in enumerate(powerset(range(n), min_order, max_order)) - } - values = np.random.rand(len(interaction_lookup)) - interaction_values = InteractionValues( - values=values, - index=index, - n_players=n, - min_order=min_order, - max_order=max_order, - interaction_lookup=interaction_lookup, - baseline_value=0.0, - ) - - assert np.isclose(sum(interaction_values), np.sum(interaction_values.values)) - - -def test_abs(): - """Tests the abs method of the InteractionValues dataclass.""" - index = "SII" - n = 5 - min_order = 1 - max_order = 2 - interaction_lookup = { - interaction: i for i, interaction in enumerate(powerset(range(n), min_order, max_order)) - } - values = (-1) * np.random.rand(len(interaction_lookup)) - interaction_values = InteractionValues( - values=values, - index=index, - n_players=n, - min_order=min_order, - max_order=max_order, - interaction_lookup=interaction_lookup, - baseline_value=0.0, - ) - - assert np.all(abs(interaction_values).values == abs(interaction_values.values)) - - -def test_n_order_transform(): - """Tests the n_order_transform method of the InteractionValues dataclass.""" - index = "SII" - n = 5 - min_order = 1 - max_order = 3 - interaction_lookup = { - interaction: i for i, interaction in enumerate(powerset(range(n), min_order, max_order)) - } - values = np.random.rand(len(interaction_lookup)) - interaction_values = InteractionValues( - values=values, - index=index, - n_players=n, - min_order=min_order, - max_order=max_order, - interaction_lookup=interaction_lookup, - baseline_value=0.0, - ) - - # test n_order_transform order 1 - interaction_values_transformed = interaction_values.get_n_order_values(1) - assert interaction_values_transformed.shape == (n,) - assert interaction_values_transformed[3] == interaction_values[(3,)] - - # test n_order_transform order 2 - interaction_values_transformed = interaction_values.get_n_order_values(2) - assert interaction_values_transformed.shape == (n, n) - assert interaction_values_transformed[3, 4] == interaction_values[(3, 4)] - - # test n_order_transform order 3 - interaction_values_transformed = interaction_values.get_n_order_values(3) - assert interaction_values_transformed.shape == (n, n, n) - assert interaction_values_transformed[0, 3, 4] == interaction_values[(0, 3, 4)] - assert interaction_values_transformed[4, 3, 0] == interaction_values[(0, 3, 4)] - assert interaction_values_transformed[0, 4, 3] == interaction_values[(0, 3, 4)] - assert interaction_values_transformed[4, 0, 3] == interaction_values[(0, 3, 4)] - - with pytest.raises(ValueError): - _ = interaction_values.get_n_order_values(0) - - -def test_sparsify(): - """Tests the sparsify function of the InteractionValues dataclass.""" - # parameters - values = np.array([1, 1e-1, 1e-3, 1e-4, 1, 1e-4, 1]) - n_players = 7 - interaction_lookup = {(i,): i for i in range(len(values))} - original_length = len(values) - - # create InteractionValues object - interaction_values = InteractionValues( - values=values, - index="SV", - n_players=n_players, - min_order=1, - max_order=1, - interaction_lookup=interaction_lookup, - baseline_value=0.0, - ) - - # test before sparsify - assert len(interaction_values.values) == original_length - assert np.all(interaction_values.values == values) - assert interaction_values[(3,)] == values[3] # will be removed - assert interaction_values[(4,)] == values[4] - assert interaction_values[(5,)] == values[5] # will be removed - assert interaction_values[(6,)] == values[6] - assert (3,) in interaction_values.interaction_lookup - assert (5,) in interaction_values.interaction_lookup - - # sparsify - threshold = 1e-3 - interaction_values.sparsify(threshold=threshold) - - # test after sparsify - assert len(interaction_values.values) == original_length - 2 # two are removed - assert interaction_values[(3,)] != values[3] # removed - assert interaction_values[(5,)] != values[5] # removed - assert interaction_values[(3,)] == 0 # removed - assert interaction_values[(5,)] == 0 # removed - assert interaction_values[(4,)] == values[4] # not removed - assert interaction_values[(6,)] == values[6] # not removed - assert (3,) not in interaction_values.interaction_lookup # removed - assert (5,) not in interaction_values.interaction_lookup # removed - - # sparsify again - threshold = 0.9 - interaction_values.sparsify(threshold=threshold) - - # test after sparsify - assert len(interaction_values.values) == 3 - assert interaction_values[(4,)] == values[4] # not removed - assert interaction_values[(6,)] == values[6] # not removed - assert interaction_values[(0,)] == values[0] # not removed - - -def test_top_k(): - """Tests the top-k selection of the InteractionValues dataclass.""" - # parameters - values = np.array([1, 2, 3, 4, 5, 6, 8, 7, 9, 10]) - n_players = 10 - interaction_lookup = {(i,): i for i in range(len(values))} - original_length = len(values) - - # create InteractionValues object - interaction_values = InteractionValues( - values=values, - index="SV", - n_players=n_players, - min_order=1, - max_order=1, - interaction_lookup=interaction_lookup, - baseline_value=0.0, - ) - - # test before top-k - assert len(interaction_values.values) == original_length - assert np.all(interaction_values.values == values) - for i in range(n_players): - assert interaction_values[(i,)] == values[i] - - # top-k - k = 3 - top_k_interaction, sorted_top_k_interactions = interaction_values.get_top_k( - k=k, - as_interaction_values=False, - ) - - assert len(top_k_interaction) == len(sorted_top_k_interactions) == k - assert sorted_top_k_interactions[0] == ((9,), 10) - assert sorted_top_k_interactions[1] == ((8,), 9) - assert sorted_top_k_interactions[2] == ((6,), 8) - - assert (9,) in top_k_interaction - assert (8,) in top_k_interaction - assert (6,) in top_k_interaction - - # test with k > len(values) - k = 20 - top_k_interaction, sorted_top_k_interactions = interaction_values.get_top_k( - k=k, - as_interaction_values=False, - ) - assert len(top_k_interaction) == len(sorted_top_k_interactions) == original_length - - # test with k = 0 - k = 0 - top_k_interaction, sorted_top_k_interactions = interaction_values.get_top_k( - k=k, - as_interaction_values=False, - ) - assert len(top_k_interaction) == len(sorted_top_k_interactions) == 0 - - -def test_from_dict(): - """Tests the from_dict method of the InteractionValues dataclass.""" - # parameters - n_players = 10 - interactions = {(i,): float(i + 1) for i in range(n_players)} - interaction_lookup = {interaction: i for i, interaction in enumerate(interactions.keys())} - - # create InteractionValues object - interaction_values = InteractionValues( - values=interactions, - index="SV", - n_players=n_players, - min_order=1, - max_order=1, - baseline_value=0.0, - ) - - # create dict - interaction_values_dict = interaction_values.to_dict() - assert interaction_values_dict["values"] == interactions - assert interaction_values_dict["index"] == "SV" - assert interaction_values_dict["n_players"] == n_players - assert interaction_values_dict["min_order"] == 1 - assert interaction_values_dict["max_order"] == 1 - assert interaction_values_dict["interaction_lookup"] == interaction_lookup - assert interaction_values_dict["baseline_value"] == 0.0 - - # create InteractionValues object from dict - interaction_values_from_dict = InteractionValues.from_dict(interaction_values_dict) - - assert interaction_values_from_dict == interaction_values - - -def test_plot(): - """Tests the plot methods in InteractionValues.""" - n = 5 - min_order = 1 - max_order = 2 - interaction_lookup = { - interaction: i for i, interaction in enumerate(powerset(range(n), min_order, max_order)) - } - values = np.random.rand(len(interaction_lookup)) - interaction_values = InteractionValues( - values=values, - index="SII", - n_players=n, - min_order=min_order, - max_order=max_order, - interaction_lookup=interaction_lookup, - baseline_value=0.0, - ) - - _ = interaction_values.plot_network(show=False) - _ = interaction_values.plot_network(show=False, feature_names=["a" for _ in range(n)]) - _ = interaction_values.plot_stacked_bar(show=False) - _ = interaction_values.plot_stacked_bar(show=False, feature_names=["a" for _ in range(n)]) - - n = 5 - min_order = 1 - max_order = 1 - interaction_lookup = { - interaction: i for i, interaction in enumerate(powerset(range(n), min_order, max_order)) - } - values = np.random.rand(len(interaction_lookup)) - interaction_values = InteractionValues( - values=values, - index="SII", - n_players=n, - min_order=min_order, - max_order=max_order, - interaction_lookup=interaction_lookup, - baseline_value=0.0, - ) - with pytest.raises(ValueError): - _ = interaction_values.plot_network(show=False) - with pytest.raises(ValueError): - _ = interaction_values.plot_network(show=False, feature_names=["a" for _ in range(n)]) - _ = interaction_values.plot_stacked_bar(show=False) - _ = interaction_values.plot_stacked_bar(show=False, feature_names=["a" for _ in range(n)]) - - -@pytest.mark.parametrize("subset_players", [[0, 1], [0, 1, 3, 4]]) -def test_subset(subset_players): - """Test Subset function.""" - n = 7 - min_order = 1 - max_order = 3 - values = np.random.rand(2**n - 1) - interaction_lookup = { - interaction: i for i, interaction in enumerate(powerset(range(n), min_order, max_order)) - } - interaction_values = InteractionValues( - values=values, - index="SII", - max_order=max_order, - n_players=n, - min_order=min_order, - interaction_lookup=interaction_lookup, - estimated=False, - estimation_budget=0, - baseline_value=0.0, - ) - - n_players_in_subset = len(subset_players) - subset_interaction_values = interaction_values.get_subset(subset_players) - - assert subset_interaction_values.n_players == n - n_players_in_subset - assert all( - all(p in subset_players for p in key) - for key in subset_interaction_values.interaction_lookup - ) - assert len(subset_interaction_values.values) == len( - subset_interaction_values.interaction_lookup, - ) - assert interaction_values.baseline_value == subset_interaction_values.baseline_value - assert subset_interaction_values.min_order == interaction_values.min_order - assert subset_interaction_values.max_order == interaction_values.max_order - assert subset_interaction_values.estimated == interaction_values.estimated - assert subset_interaction_values.estimation_budget == interaction_values.estimation_budget - assert subset_interaction_values.index == interaction_values.index - - # check that all values are correct - for interaction in powerset(subset_players, max_size=max_order, min_size=min_order): - old_value = interaction_values[interaction] - new_value = subset_interaction_values[interaction] - assert old_value == new_value - - -@pytest.mark.parametrize("aggregation", ["sum", "mean", "median", "max", "min"]) -def test_aggregation(aggregation): - """Tests the aggregation of InteractionValues.""" - n_objects = 3 - n, min_order, max_order = 5, 1, 3 - interaction_values_list = [] - for _ in range(n_objects): - values = np.random.rand(2**n - 1) - interaction_lookup = { - interaction: i for i, interaction in enumerate(powerset(range(n), min_order, max_order)) - } - interaction_values = InteractionValues( - values=values, - index="SII", - max_order=max_order, - n_players=n, - min_order=min_order, - interaction_lookup=interaction_lookup, - estimated=False, - estimation_budget=0, - baseline_value=0.0, - ) - interaction_values_list.append(interaction_values) - - aggregated_interaction_values = aggregate_interaction_values( - interaction_values_list, - aggregation=aggregation, - ) - - assert isinstance(aggregated_interaction_values, InteractionValues) - assert aggregated_interaction_values.index == "SII" - assert aggregated_interaction_values.n_players == n - assert aggregated_interaction_values.min_order == min_order - assert aggregated_interaction_values.max_order == max_order - - # check that all interactions are equal to the expected value - for interaction in powerset(range(n), 1, n): - aggregated_value = np.array( - [interaction_values[interaction] for interaction_values in interaction_values_list], - ) - if aggregation == "sum": - expected_value = np.sum(aggregated_value) - elif aggregation == "mean": - expected_value = np.mean(aggregated_value) - elif aggregation == "median": - expected_value = np.median(aggregated_value) - elif aggregation == "max": - expected_value = np.max(aggregated_value) - elif aggregation == "min": - expected_value = np.min(aggregated_value) - assert aggregated_interaction_values[interaction] == expected_value - - # test aggregate from InteractionValues object - aggregated_from_object = interaction_values_list[0].aggregate( - aggregation=aggregation, - others=interaction_values_list[1:], - ) - assert isinstance(aggregated_from_object, InteractionValues) - assert aggregated_from_object == aggregated_interaction_values # same values - assert aggregated_from_object is not aggregated_interaction_values # but different objects - - -def test_docs_aggregation_function(): - """Tests the aggregation function in the InteractionValues dataclass like in the docs.""" - iv1 = InteractionValues( - values=np.array([0.1, 0.2, 0.3, 0.4, 0.5, 0.6]), - index="SII", - n_players=3, - min_order=1, - max_order=2, - interaction_lookup={(0,): 0, (1,): 1, (2,): 2, (0, 1): 3, (0, 2): 4, (1, 2): 5}, - baseline_value=0.0, - ) - - # this does not contain the (1, 2) interaction (i.e. is 0) - iv2 = InteractionValues( - values=np.array([0.2, 0.3, 0.4, 0.5, 0.6]), - index="SII", - n_players=3, - min_order=1, - max_order=2, - interaction_lookup={(0,): 0, (1,): 1, (2,): 2, (0, 1): 3, (0, 2): 4}, - baseline_value=1.0, - ) - - # test sum - aggregated_interaction_values = aggregate_interaction_values([iv1, iv2], aggregation="sum") - assert pytest.approx(aggregated_interaction_values[(0,)]) == 0.3 - assert pytest.approx(aggregated_interaction_values[(1,)]) == 0.5 - assert pytest.approx(aggregated_interaction_values[(1, 2)]) == 0.6 - assert pytest.approx(aggregated_interaction_values.baseline_value) == 1.0 - - # test mean - aggregated_interaction_values = aggregate_interaction_values([iv1, iv2], aggregation="mean") - assert pytest.approx(aggregated_interaction_values[(0,)]) == 0.15 - assert pytest.approx(aggregated_interaction_values[(1,)]) == 0.25 - assert pytest.approx(aggregated_interaction_values[(1, 2)]) == 0.3 - assert pytest.approx(aggregated_interaction_values.baseline_value) == 0.5 - - with pytest.raises(ValueError): - _ = aggregate_interaction_values([iv1, iv2], aggregation="invalid") - - -def test_get_n_order_error_all_none(iv_10_all): - """Tests if `get_n_order` raises ValueError if all parameters are `None`.""" - iv = iv_10_all - with pytest.raises(ValueError): - iv.get_n_order() # all parameters are None - - -def test_get_n_order_error_min_larger_max(iv_10_all): - """Tests if `get_n_order` raises ValueError if min_order > max_order.""" - iv = iv_10_all - with pytest.raises(ValueError): - iv.get_n_order(min_order=2, max_order=1) # min > max - - with pytest.raises(ValueError): - iv.get_n_order(order=3, min_order=3, max_order=2) # min > max even with order - - -def test_get_n_order_min_max_overrides_order(iv_10_all): - """Tests that min_order and max_order overrides order.""" - iv = iv_10_all - min_order = 0 - max_order = 5 - iv_new = iv.get_n_order(order=2, min_order=min_order, max_order=max_order) - assert iv_new.min_order == min_order - assert iv_new.max_order == max_order - assert all( - min_order <= len(interaction) <= max_order for interaction in iv_new.interaction_lookup - ) - - -@pytest.mark.parametrize(("min_order", "max_order"), [(None, 3), (2, None)]) -def test_get_n_order_single_bound(min_order, max_order, iv_10_all): - """Tests behavior when only min or max is provided.""" - iv = iv_10_all - iv_new = iv.get_n_order(min_order=min_order, max_order=max_order) - - if min_order is None: - min_order = iv.min_order - if max_order is None: - max_order = iv.max_order - - assert iv_new.min_order == min_order - assert iv_new.max_order == max_order - assert all(min_order <= len(inter) <= max_order for inter in iv_new.interaction_lookup) - - -def test_get_n_order_empty_result(iv_10_all): - """Test that get_n_order returns an empty InteractionValues if no interactions match.""" - iv = iv_10_all - # Choose min/max such that no interaction can match - iv_new = iv.get_n_order(min_order=11, max_order=15) - assert len(iv_new.interaction_lookup) == 0 - assert iv_new.values.size == 0 - - # choose order to be larger than max_order - iv_new = iv.get_n_order(order=11) - assert len(iv_new.interaction_lookup) == 0 - assert iv_new.values.size == 0 - - -@pytest.mark.parametrize("order", [0, 1, 2, 3, 4, 5]) -def test_get_n_order_with_only_order_param( - order: int, - iv_10_all: InteractionValues, - iv_300_300_0_300: InteractionValues, -): - """Tests that get_n_order returns only the specified order if only order is given as a parameter.""" - for iv in [iv_10_all, iv_300_300_0_300]: - iv_new = iv.get_n_order(order=order) - assert isinstance(iv_new, InteractionValues) - assert iv_new.min_order == order - assert iv_new.max_order == order - - # check that the order is correct - assert all(len(interaction) == order for interaction in iv_new.interaction_lookup) - - # check that all interactions from the original are present - assert all( - interaction in iv_new.interaction_lookup - for interaction in iv.interaction_lookup - if len(interaction) == order - ) - - # check that all values are correct - assert all( - iv_new[interaction] == iv[interaction] for interaction in iv_new.interaction_lookup - ) - - -@pytest.mark.parametrize(("min_order", "max_order"), [(0, 1), (0, 2), (2, 3), (3, 4), (4, 4)]) -def test_get_n_order_with_only_min_max_param( - min_order: int, - max_order: int, - iv_10_all: InteractionValues, - iv_300_300_0_300: InteractionValues, -): - """Tests that get_n_order returns the correct interactions when only min and max are given.""" - for iv in [iv_10_all, iv_300_300_0_300]: - iv_new = iv.get_n_order(min_order=min_order, max_order=max_order) - assert isinstance(iv_new, InteractionValues) - assert iv_new.min_order == min_order - assert iv_new.max_order == max_order - - # check that the order is correct - assert all( - min_order <= len(interaction) <= max_order for interaction in iv_new.interaction_lookup - ) - - # check that all interactions from the original are present - assert all( - interaction in iv_new.interaction_lookup - for interaction in iv.interaction_lookup - if min_order <= len(interaction) <= max_order - ) - - # check that all values are correct - assert all( - iv_new[interaction] == iv[interaction] for interaction in iv_new.interaction_lookup - ) - - -def test_copy_behaviour(): - """Tests that InteractionValues objects are copied correctly.""" - from copy import copy, deepcopy - - # check that copy and deepcopy both work and create a copyied object - for copy_method in [copy, deepcopy]: - original = get_mock_interaction_value(n_players=10, n_interactions=20) - copied = copy_method(original) - interaction = next(iter(copied.interaction_lookup)) # we use this interaction to test later - - # Structural equality: values, lookup, etc. - assert isinstance(copied, InteractionValues) - assert np.array_equal(original.values, copied.values) - assert original.interaction_lookup == copied.interaction_lookup - assert original.n_players == copied.n_players - assert original.min_order == copied.min_order - assert original.max_order == copied.max_order - assert original.index == copied.index - assert original.baseline_value == copied.baseline_value - assert original.estimated == copied.estimated - assert original[interaction] == copied[interaction] - assert hash(original) == hash(copied) - assert original == copied - - # Independence: changing one doesn't affect the other - copied[0] += 1.0 - assert not np.array_equal(original.values, copied.values), "Values should be independent" - copied.interactions[interaction] = 999 - assert original.interactions != copied.interactions, "Interactions should be different" # fmt: skip - assert hash(original) != hash(copied) - assert original != copied, "Objects should be different" - - -class TestSavingInteractionValues: - """Tests the saving and loading of InteractionValues.""" - - @pytest.mark.parametrize("iv_str", ("iv_7_all", "iv_300_300_0_300")) - def test_save_and_load_json(self, iv_str: str, tmp_path: Path, request): - """Tests saving and loading of InteractionValues using a temp path.""" - path = tmp_path / pathlib.Path(f"test_interaction_values_{iv_str}.json") - iv: InteractionValues = request.getfixturevalue(iv_str) - - iv.save(path) - assert path.exists() - loaded_iv = InteractionValues.load(path) - assert loaded_iv == iv # check if loaded InteractionValues is equal to original - loaded_iv_json = InteractionValues.from_json_file(path) - assert loaded_iv_json == iv diff --git a/tests/shapiq/tests_unit/test_public_api.py b/tests/shapiq/tests_unit/test_public_api.py deleted file mode 100644 index f7103e13a..000000000 --- a/tests/shapiq/tests_unit/test_public_api.py +++ /dev/null @@ -1,85 +0,0 @@ -"""Tests that every concrete public subclass is registered in its module's ``__all__``. - -These tests act as a guard: if someone adds a new concrete subclass (e.g. a new -Approximator) without listing it in the corresponding ``__all__``, the test -fails and prompts the author to update the public API declaration. -""" - -from __future__ import annotations - -import importlib -import inspect - -import pytest - - -def _find_concrete_subclasses(module: object, base: type) -> set[str]: - """Return names of all concrete, public subclasses of *base* visible in *module*. - - Note: only classes that have been explicitly imported into *module*'s namespace - are detected. A class that lives in a sub-module but is not re-exported at the - package level will be silently missed. - - Args: - module: The Python module to inspect. - base: The base class to check against. - - Returns: - A set of class names that are concrete (non-abstract), non-private - subclasses of *base* found in *module*, excluding *base* itself. - """ - return { - name - for name, obj in inspect.getmembers(module, inspect.isclass) - if issubclass(obj, base) - and obj is not base - and not inspect.isabstract(obj) - and not name.startswith("_") - } - - -@pytest.mark.parametrize( - ("module_path", "base_path", "label"), - [ - ( - "shapiq.approximator", - "shapiq.approximator.base:Approximator", - "Approximator", - ), - ( - "shapiq.explainer", - "shapiq.explainer.base:Explainer", - "Explainer", - ), - ( - "shapiq.imputer", - "shapiq.imputer.base:Imputer", - "Imputer", - ), - ], - ids=["approximator", "explainer", "imputer"], -) -def test_all_concrete_subclasses_in_all(module_path: str, base_path: str, label: str) -> None: - """Every concrete public subclass must appear in its module's ``__all__``. - - This prevents new classes from silently escaping the public API and - therefore the auto-generated documentation. - - Args: - module_path: Dotted import path of the public package (e.g. ``shapiq.approximator``). - base_path: Colon-separated ``module:ClassName`` for the abstract base class. - label: Human-readable name used in the assertion message. - """ - module = importlib.import_module(module_path) - base_module_path, base_class_name = base_path.split(":") - base: type = getattr(importlib.import_module(base_module_path), base_class_name) - - concrete = _find_concrete_subclasses(module, base) - exported = set(module.__all__) - missing = concrete - exported - - pkg_init = f"src/shapiq/{module_path.split('.')[-1]}/__init__.py" - assert not missing, ( - f"Concrete {label} subclasses not listed in {module_path}.__all__: " - f"{missing}. Add them to {pkg_init}." - ) diff --git a/tests/shapiq/tests_unit/tests_approximators/__init__.py b/tests/shapiq/tests_unit/tests_approximators/__init__.py deleted file mode 100644 index c59b8a22f..000000000 --- a/tests/shapiq/tests_unit/tests_approximators/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Tests for the approximators module.""" diff --git a/tests/shapiq/tests_unit/tests_approximators/test_approximator_base_functionality.py b/tests/shapiq/tests_unit/tests_approximators/test_approximator_base_functionality.py deleted file mode 100644 index cc59fdc8e..000000000 --- a/tests/shapiq/tests_unit/tests_approximators/test_approximator_base_functionality.py +++ /dev/null @@ -1,62 +0,0 @@ -"""This test module tests base functionality of approximators.""" - -from __future__ import annotations - -from copy import copy, deepcopy - -import pytest - -from shapiq.approximator import Approximator, KernelSHAP -from shapiq_games.synthetic import DummyGame -from tests.shapiq.utils import get_concrete_class - - -def test_approximator_init(): - """Tests if the attributes and properties of approximators are set correctly.""" - n_players = 5 - game = DummyGame(n=n_players, interaction=(1, 2)) - - approximator = KernelSHAP(n=game.n_players, max_order=1, random_state=42) - assert approximator.n == n_players - - # test representation - representation = repr(approximator) - assert "KernelSHAP" in representation - assert str(approximator) == representation - - # test equality - approximator_copy = copy(approximator) - approximator_deepcopy = deepcopy(approximator) - approximator_deepcopy.index = "something" - assert approximator_copy == approximator # check that the copy is equal - assert approximator_deepcopy != approximator # check that the deepcopy is not equal - - assert hash(approximator) == hash(approximator_copy) - assert hash(approximator) != hash(approximator_deepcopy) - with pytest.raises(TypeError): - _ = approximator == 1 - - id_approx = approximator.approximator_id - assert hash(approximator) == id_approx - - # test if approximator can be called - approximator(budget=4, game=game) - - -def test_abstract_approximator(): - """Tests if the attributes and properties of approximators are set correctly.""" - approx = get_concrete_class(Approximator)(n=7, max_order=2, index="SII", top_order=False) - assert approx.n == 7 - assert approx.max_order == 2 - assert approx.index == "SII" - assert approx.top_order is False - - with pytest.raises(NotImplementedError): - approx.approximate(budget=100, game=lambda x: x) - - with pytest.raises(NotImplementedError): - approx(game=lambda x: x, budget=100) - - wrong_index = "something" - with pytest.raises(ValueError): - _ = get_concrete_class(Approximator)(n=7, max_order=2, index=wrong_index, top_order=False) diff --git a/tests/shapiq/tests_unit/tests_approximators/test_approximator_base_monte_carlo.py b/tests/shapiq/tests_unit/tests_approximators/test_approximator_base_monte_carlo.py deleted file mode 100644 index 038edf87a..000000000 --- a/tests/shapiq/tests_unit/tests_approximators/test_approximator_base_monte_carlo.py +++ /dev/null @@ -1,107 +0,0 @@ -"""This test module contains all tests regarding the base monte-carlo approximator many other approximators are based on.""" - -from __future__ import annotations - -import pytest - -from shapiq.approximator.montecarlo import MonteCarlo -from shapiq.interaction_values import InteractionValues -from shapiq_games.synthetic import DummyGame - - -@pytest.mark.parametrize( - ("n", "max_order", "index", "top_order", "stratify_intersection", "stratify_coalition_size"), - [ - (7, 2, "SII", False, True, False), - (7, 2, "wrong_index", False, False, True), - (7, 2, "FSII", True, False, False), - (7, 2, "FBII", True, False, False), - ], -) -def test_initialization( - n, - max_order, - index, - top_order, - stratify_intersection, - stratify_coalition_size, -): - """Tests the initialization of the MonteCarlo approximator.""" - if index == "wrong_index": - with pytest.raises(ValueError): - _ = MonteCarlo(n, max_order, index=index, top_order=top_order) - return - - approximator = MonteCarlo( - n, - max_order, - index=index, - top_order=top_order, - stratify_intersection=stratify_intersection, - stratify_coalition_size=stratify_coalition_size, - ) - assert approximator.n == n - assert approximator.max_order == max_order - assert approximator.top_order is top_order - assert approximator.min_order == (max_order if top_order else 0) - assert approximator.iteration_cost == 1 - assert approximator.index == index - - with pytest.raises(ValueError): - approximator._get_standard_form_weights(index="wrong_index") - - if index == "FSII": - max_order = approximator.max_order - _ = approximator._fsii_weight(interaction_size=max_order, coalition_size=0) # no error - with pytest.raises(ValueError): # FSII weights only defined for top order - approximator._fsii_weight(interaction_size=max_order - 1, coalition_size=0) # error - - if index == "FBII": - max_order = approximator.max_order - _ = approximator._fbii_weight(interaction_size=max_order) - with pytest.raises(ValueError): - approximator._fbii_weight(interaction_size=max_order - 1) - - -@pytest.mark.parametrize( - ("n", "index", "max_order", "budget", "stratify_intersection", "stratify_coalition_size"), - [ - (7, "SII", 2, 100, False, False), - (7, "SII", 2, 100, True, False), - (7, "SII", 2, 100, False, True), - (7, "SII", 2, 100, True, True), - (7, "SV", 1, 100, True, True), - (7, "k-SII", 2, 100, True, True), - (7, "STII", 2, 100, False, False), - (7, "FSII", 2, 100, False, False), - (7, "BII", 2, 100, False, False), - (7, "CHII", 2, 100, False, False), - ], -) -def test_approximate(n, index, max_order, budget, stratify_intersection, stratify_coalition_size): - """Tests the approximation of the MonteCarlo approximation.""" - interaction = (1, 2) - game = DummyGame(n, interaction) - approximator = MonteCarlo( - n, - max_order, - index=index, - random_state=42, - stratify_intersection=stratify_intersection, - stratify_coalition_size=stratify_coalition_size, - ) - estimates = approximator.approximate(budget, game) - assert isinstance(estimates, InteractionValues) - assert estimates.max_order == max_order - if index == "FSII": - assert estimates.min_order == max_order - else: - assert estimates.min_order == 0 - - # check that the budget is respected - assert game.access_counter <= budget + 2 - - # for order 2 (max_order) the interaction between player 1 and 2 is the most important (1.0) - interaction_estimate = estimates[interaction[0],] if index == "SV" else estimates[interaction] - - assert interaction_estimate != 0 diff --git a/tests/shapiq/tests_unit/tests_approximators/test_approximator_base_sparse.py b/tests/shapiq/tests_unit/tests_approximators/test_approximator_base_sparse.py deleted file mode 100644 index cd56ec5a9..000000000 --- a/tests/shapiq/tests_unit/tests_approximators/test_approximator_base_sparse.py +++ /dev/null @@ -1,309 +0,0 @@ -"""This test module contains all tests regarding the base sparse approximator.""" - -from __future__ import annotations - -import sys - -import pytest - -from shapiq.approximator.sparse import Sparse -from shapiq.game_theory.indices import ALL_AVAILABLE_CONCEPTS -from shapiq.interaction_values import InteractionValues -from shapiq_games.synthetic import DummyGame -from tests.shapiq.markers import skip_if_no_lightgbm - - -@skip_if_no_lightgbm -@pytest.mark.parametrize( - ("n", "index", "max_order", "top_order", "transform_type", "decoder_type"), - [ - (7, "FBII", None, False, "fourier", "soft"), - (7, "FBII", None, False, "FouRier", "Soft"), - (7, "FBII", None, False, "fourier", "Hard"), - (7, "wrong_index", None, False, "fourier", "soft"), # Should raise ValueError - (7, "wrong_index", None, False, "fourier", "wrong_dec_type"), # Should raise ValueError - (7, "FBII", 6, False, "fourier", "soft"), - (7, "FBII", 2, False, "fourier", "soft"), - (7, "FBII", 2, False, "fourier", "proxyspex"), - (7, "FBII", 2, False, "fourier", "Proxyspex"), - ], -) -def test_initialization(n, index, max_order, top_order, transform_type, decoder_type): - """Tests the initialization of the Sparse approximator.""" - if index == "wrong_index": - with pytest.raises(ValueError): - _ = Sparse( - n=n, - index=index, - max_order=max_order, - top_order=top_order, - transform_type=transform_type, - decoder_type=decoder_type, - ) - return - - if transform_type == "invalid_type": - with pytest.raises(ValueError): - _ = Sparse( - n=n, - index=index, - max_order=max_order, - top_order=top_order, - transform_type=transform_type, - decoder_type=decoder_type, - ) - return - - if decoder_type == "wrong_dec_type" or transform_type.lower() == "mobius": - with pytest.raises(ValueError): - _ = Sparse( - n=n, - index=index, - max_order=max_order, - top_order=top_order, - transform_type=transform_type, - decoder_type=decoder_type, - ) - return - - approximator = Sparse( - n=n, - index=index, - max_order=max_order, - top_order=top_order, - transform_type=transform_type, - decoder_type=decoder_type, - ) - - assert approximator.n == n - assert approximator.max_order == (n if max_order is None else max_order) - assert approximator.top_order is top_order - assert approximator.min_order == (max_order if top_order else 0) - assert approximator.index == index - assert approximator.transform_type == transform_type.lower() - if decoder_type is not None and decoder_type.lower() != "proxyspex": - channel_method = approximator.decoder_args["reconstruct_method_channel"] - if channel_method is None or decoder_type.lower() == "soft": - assert channel_method == "identity-siso" - else: - assert channel_method == "identity" - - -@pytest.mark.parametrize( - ( - "n", - "index", - "max_order", - "budget", - "transform_type", - "decoder_type", - "top_order", - "interaction", - ), - [ # These test usually pass with much fewer samples, (~90% of the time with 800), but we use a bigger budget to - # ensure that the tests are stable - (20, "STII", None, 1600, "fourier", "soft", False, (1, 2)), # Standard configuration (STII) - ( - 20, - "FBII", - None, - 6400, - "fourier", - "hard", - False, - (1, 2, 4, 5), - ), # Higher order interaction - (20, "FSII", None, 1600, "fourier", "soft", False, (0, 2)), # Standard configuration (FSII) - ( - 20, - "STII", - None, - 100, - "fourier", - "soft", - False, - (1, 2), - ), # Should throw and error budget too small - ( - 20, - "STII", - 2, - 1600, - "fourier", - "soft", - True, - (1, 2), - ), # Should filter out all 1st order interactions - ( - 20, - "STII", - 3, - 3200, - "fourier", - "soft", - False, - (1, 2, 3), - ), # Should filter out 3rd order interaction - ( - 20, - "STII", - 1, - 3200, - "fourier", - "soft", - False, - (1, 2, 3), - ), # Should spread 3rd order interaction across 1st - ], -) -def test_approximate_with_spex( - n, index, max_order, budget, transform_type, decoder_type, top_order, interaction -): - """Tests the approximation of the Sparse approximator with various configurations.""" - game = DummyGame(n, interaction) - approximator = Sparse( - n=n, - index=index, - max_order=max_order, - top_order=top_order, - transform_type=transform_type, - decoder_type=decoder_type, - random_state=42, - ) - # Perform approximation with budget - if n >= 20 and budget <= 100: - with pytest.raises(ValueError): - _ = approximator.approximate(budget, game) - return - - estimates = approximator.approximate(budget, game) - max_order = n if max_order is None else max_order - - # Verify the result structure - assert isinstance(estimates, InteractionValues) - assert estimates.max_order == max_order - assert estimates.min_order == (max_order if top_order else 0) - assert ( - estimates.index == index - if (max_order is None or max_order > 1) - else ALL_AVAILABLE_CONCEPTS[index]["generalizes"] - ) - assert estimates.estimated - assert estimates.estimation_budget > 0 - - # Check that game was called within budget - assert game.access_counter <= budget + 2 - - # Check that values are not empty - assert len(estimates.values) > 0 - - # generate the set of expected interactions - expected_interactions = set() - if estimates.min_order == 0: - expected_interactions.update({(i,) for i in range(n)}) - if estimates.max_order > 1: - expected_interactions.add(interaction) - - # Check the computed interactions - recovered_interactions = set(estimates.interaction_lookup.keys()) - zero_interactions = set() - if index in ("STII", "FBII", "FSII"): - for interaction_key in recovered_interactions: - if interaction_key not in expected_interactions: - assert estimates[interaction_key] == pytest.approx(0.0, abs=1e-2) - zero_interactions.add(interaction_key) - elif interaction_key == interaction and max_order >= len(interaction): - assert estimates[interaction_key] == pytest.approx(1.0, rel=0.01) - elif len(interaction_key) == 1 and interaction_key[0] in interaction and max_order == 1: - assert estimates[interaction_key] == pytest.approx( - 1 / n + 1 / len(interaction), rel=0.01 - ) - else: - assert estimates[interaction_key] == pytest.approx(1 / n, rel=0.01) - recovered_interactions = recovered_interactions - zero_interactions - assert recovered_interactions == expected_interactions - - -@skip_if_no_lightgbm -def test_approximate_with_proxyspex(): - """Tests the approximate method with the proxyspex decoder.""" - n = 10 - budget = 100 - interaction = (2, 4) - game = DummyGame(n, interaction) - - approximator = Sparse(n=n, index="FBII", max_order=2, decoder_type="proxyspex", random_state=42) - estimates = approximator.approximate(budget, game) - - # The goal is to ensure the code path runs and gives a sane result. - assert isinstance(estimates, InteractionValues) - assert estimates.estimated - assert estimates.estimation_budget == budget - - # The main interaction should be found and have a significant value - assert interaction in estimates.interaction_lookup - assert estimates[interaction] == pytest.approx(1.0, abs=0.5) - - -def test_sparse_init_succeeds_lightgbm(monkeypatch): - """ - Tests that the base Sparse class initializes successfully without lightgbm - if a non-proxyspex decoder is used and fails if proxyspex is used. - """ - # Temporarily pretend lightgbm is not installed - monkeypatch.setitem(sys.modules, "lightgbm", None) - - # This action should succeed without raising any errors because the decoder - # is "soft" and does not require lightgbm. - try: - Sparse(n=10, index="SII", decoder_type="soft") - except ImportError: - pytest.fail("Sparse raised an ImportError even when lightgbm was not required.") - - with pytest.raises(ImportError, match="The 'lightgbm' package is required"): - Sparse(n=10, index="SII", decoder_type="proxyspex") - - -def test_refine_zero_total_energy(): - """ - Tests that the _refine method handles the case when total energy is zero. - - This test ensures that when all Fourier coefficients (excluding the baseline) - are zero, the method returns the original dictionary without attempting to - divide by zero. - """ - import numpy as np - - n = 5 - # Use "soft" decoder which doesn't require lightgbm - approximator = Sparse(n=n, index="FBII", max_order=2, decoder_type="soft", random_state=42) - - # Create a four_dict where all non-baseline coefficients are zero - four_dict = { - (): 1.0, # baseline coefficient - (0,): 0.0, - (1,): 0.0, - (0, 1): 0.0, - (2,): 0.0, - (1, 2): 0.0, - } - - # Create some dummy training data - train_X = np.array( - [ - [0, 0, 0, 0, 0], - [1, 0, 0, 0, 0], - [0, 1, 0, 0, 0], - [1, 1, 0, 0, 0], - [0, 0, 1, 0, 0], - [1, 0, 1, 0, 0], - ] - ) - train_y = np.array([1.0, 1.0, 1.0, 1.0, 1.0, 1.0]) - - # Call _refine - should not raise a ZeroDivisionError - result = approximator._refine(four_dict, train_X, train_y) - - # The result should be the same as the input when total energy is zero - assert result == four_dict - assert len(result) == len(four_dict) diff --git a/tests/shapiq/tests_unit/tests_approximators/test_approximator_inconsistent_kernelshapiq.py b/tests/shapiq/tests_unit/tests_approximators/test_approximator_inconsistent_kernelshapiq.py deleted file mode 100644 index 91272060e..000000000 --- a/tests/shapiq/tests_unit/tests_approximators/test_approximator_inconsistent_kernelshapiq.py +++ /dev/null @@ -1,60 +0,0 @@ -"""This test module contains all tests regarding the Inconsistent KernelSHAP-IQ regression approximator.""" - -from __future__ import annotations - -import numpy as np -import pytest - -from shapiq.approximator import InconsistentKernelSHAPIQ -from shapiq.interaction_values import InteractionValues -from shapiq_games.synthetic import DummyGame - - -@pytest.mark.parametrize("n", [3, 7, 10]) -def test_initialization(n): - """Tests the initialization of the Inconsistent KernelSHAP-IQ approximator.""" - approximator = InconsistentKernelSHAPIQ(n) - assert approximator.n == n - assert approximator.max_order == 2 - assert approximator.top_order is False - assert approximator.min_order == 0 - assert approximator.iteration_cost == 1 - - # check for error when index is not in AVAILABLE_INDICES_KERNELSHAPIQ - with pytest.raises(ValueError): - _ = InconsistentKernelSHAPIQ(n, index="something") - - -@pytest.mark.parametrize( - ("budget", "order", "index"), - [(100, 2, "SII"), (100, 3, "SII"), (100, 3, "k-SII"), (100, 4, "SII")], -) -def test_approximate(budget, order, index): - """Tests the approximation of the Inconsistent KernelSHAP-IQ approximator.""" - n = 7 - interaction = (1, 2) - game = DummyGame(n, interaction) - - approximator = InconsistentKernelSHAPIQ(n, max_order=order, index=index) - estimates = approximator.approximate(budget, game) - assert isinstance(estimates, InteractionValues) - assert estimates.max_order == order - assert estimates.min_order == 0 - assert estimates.index == index - - # check that the budget is respected - assert game.access_counter <= budget - - if index == "SII": - assert estimates[(0,)] == pytest.approx(0.1442, abs=0.03) - assert estimates[(1,)] == pytest.approx(0.6429, abs=0.03) - assert estimates[(2,)] == pytest.approx(0.6429, abs=0.03) - if index == "k-SII": - efficiency = np.sum(estimates.values) - assert efficiency == pytest.approx(2.0, abs=0.03) - assert estimates[(0,)] == pytest.approx(0.1442, abs=0.03) - assert estimates[(1,)] == pytest.approx(0.1442, abs=0.03) - assert estimates[(2,)] == pytest.approx(0.1442, abs=0.03) - - assert estimates[(1, 2)] == pytest.approx(1.0, abs=0.03) - assert estimates[(1, 2, 3)] == pytest.approx(0, abs=0.03) diff --git a/tests/shapiq/tests_unit/tests_approximators/test_approximator_k_additive_kernelshap.py b/tests/shapiq/tests_unit/tests_approximators/test_approximator_k_additive_kernelshap.py deleted file mode 100644 index 37fbb1514..000000000 --- a/tests/shapiq/tests_unit/tests_approximators/test_approximator_k_additive_kernelshap.py +++ /dev/null @@ -1,41 +0,0 @@ -"""This test module contains all tests regarding the kADDSHAP regression approximator.""" - -from __future__ import annotations - -import pytest - -from shapiq.approximator import kADDSHAP -from shapiq.interaction_values import InteractionValues -from shapiq_games.synthetic import DummyGame - - -@pytest.mark.parametrize("n", [3, 7, 10]) -def test_initialization(n): - """Tests the initialization of the kADDSHAP approximator.""" - approximator = kADDSHAP(n) - assert approximator.n == n - assert approximator.max_order == 2 - assert approximator.index == "kADD-SHAP" - assert approximator.top_order is False - assert approximator.min_order == 0 - assert approximator.iteration_cost == 1 - - -@pytest.mark.parametrize(("budget", "order"), [(100, 1), (100, 2), (100, 3), (100, 4)]) -def test_approximate(budget, order): - """Tests the approximation of the kADDSHAP approximator.""" - n = 7 - interaction = (1, 2) - game = DummyGame(n, interaction) - - approximator = kADDSHAP(n, max_order=order) - sii_estimates = approximator.approximate(budget, game) - assert isinstance(sii_estimates, InteractionValues) - assert sii_estimates.max_order == order - assert sii_estimates.min_order == 0 - - # check that the budget is respected - assert game.access_counter <= budget - - assert sii_estimates[(1,)] == pytest.approx(0.6429, abs=0.1) - assert sii_estimates[(2,)] == pytest.approx(0.6429, abs=0.1) diff --git a/tests/shapiq/tests_unit/tests_approximators/test_approximator_kernelshap.py b/tests/shapiq/tests_unit/tests_approximators/test_approximator_kernelshap.py deleted file mode 100644 index 4a19c123a..000000000 --- a/tests/shapiq/tests_unit/tests_approximators/test_approximator_kernelshap.py +++ /dev/null @@ -1,50 +0,0 @@ -"""This test module contains all tests regarding the SV KernelSHAP regression approximator.""" - -from __future__ import annotations - -import numpy as np -import pytest - -from shapiq.approximator.regression import KernelSHAP -from shapiq.interaction_values import InteractionValues -from shapiq_games.synthetic import DummyGame - - -@pytest.mark.parametrize("n", [3, 7, 10]) -def test_initialization(n): - """Tests the initialization of the RegressionFSII approximator.""" - approximator = KernelSHAP(n) - assert approximator.n == n - assert approximator.max_order == 1 - assert approximator.top_order is False - assert approximator.min_order == 0 - assert approximator.iteration_cost == 1 - - -@pytest.mark.parametrize(("n", "budget"), [(7, 380), (7, 100)]) -def test_approximate(n, budget): - """Tests the approximation of the KernelSHAP approximator.""" - interaction = (1, 2) - game = DummyGame(n, interaction) - - approximator = KernelSHAP(n) - sv_estimates = approximator.approximate(budget, game) - assert isinstance(sv_estimates, InteractionValues) - assert sv_estimates.max_order == 1 - assert sv_estimates.min_order == 0 - assert sv_estimates.index == "SV" - assert sv_estimates.estimation_budget <= budget - assert sv_estimates.estimated != (budget >= 2**n) - - # check that the budget is respected - assert game.access_counter <= budget - - # check that the values are in the correct range - # check that the estimates are correct - # for order 1 player 1 and 2 are the most important with 0.6429 - assert sv_estimates[(1,)] == pytest.approx(0.6429, abs=0.1) - assert sv_estimates[(2,)] == pytest.approx(0.6429, abs=0.1) - - # check efficiency - efficiency = np.sum(sv_estimates.values) - assert efficiency == pytest.approx(2.0, abs=0.1) diff --git a/tests/shapiq/tests_unit/tests_approximators/test_approximator_kernelshapiq.py b/tests/shapiq/tests_unit/tests_approximators/test_approximator_kernelshapiq.py deleted file mode 100644 index 6ceffe951..000000000 --- a/tests/shapiq/tests_unit/tests_approximators/test_approximator_kernelshapiq.py +++ /dev/null @@ -1,60 +0,0 @@ -"""This test module contains all tests regarding the KernelSHAP-IQ regression approximator.""" - -from __future__ import annotations - -import numpy as np -import pytest - -from shapiq.approximator import KernelSHAPIQ -from shapiq.interaction_values import InteractionValues -from shapiq_games.synthetic import DummyGame - - -@pytest.mark.parametrize("n", [3, 7, 10]) -def test_initialization(n): - """Tests the initialization of the KernelSHAP-IQ approximator.""" - approximator = KernelSHAPIQ(n) - assert approximator.n == n - assert approximator.max_order == 2 - assert approximator.top_order is False - assert approximator.min_order == 0 - assert approximator.iteration_cost == 1 - - # check for error when index is not in AVAILABLE_INDICES_KERNELSHAPIQ - with pytest.raises(ValueError): - _ = KernelSHAPIQ(n, index="something") - - -@pytest.mark.parametrize( - ("budget", "order", "index"), - [(100, 2, "SII"), (100, 3, "SII"), (100, 3, "k-SII"), (100, 4, "SII")], -) -def test_approximate(budget, order, index): - """Tests the approximation of the KernelSHAP-IQ approximator.""" - n = 7 - interaction = (1, 2) - game = DummyGame(n, interaction) - - approximator = KernelSHAPIQ(n, max_order=order, index=index) - estimates = approximator.approximate(budget, game) - assert isinstance(estimates, InteractionValues) - assert estimates.max_order == order - assert estimates.min_order == 0 - assert estimates.index == index - - # check that the budget is respected - assert game.access_counter <= budget - - if index == "SII": - assert estimates[(0,)] == pytest.approx(0.1442, abs=0.1) - assert estimates[(1,)] == pytest.approx(0.6429, abs=0.1) - assert estimates[(2,)] == pytest.approx(0.6429, abs=0.1) - if index == "k-SII": - efficiency = np.sum(estimates.values) - assert efficiency == pytest.approx(2.0, abs=0.01) - assert estimates[(0,)] == pytest.approx(0.1442, abs=0.1) - assert estimates[(1,)] == pytest.approx(0.1442, abs=0.1) - assert estimates[(2,)] == pytest.approx(0.1442, abs=0.1) - - assert estimates[(1, 2)] == pytest.approx(1.0, abs=0.1) - assert estimates[(1, 2, 3)] == pytest.approx(0, abs=0.1) diff --git a/tests/shapiq/tests_unit/tests_approximators/test_approximator_msr_biased.py b/tests/shapiq/tests_unit/tests_approximators/test_approximator_msr_biased.py deleted file mode 100644 index 795dc26e4..000000000 --- a/tests/shapiq/tests_unit/tests_approximators/test_approximator_msr_biased.py +++ /dev/null @@ -1,82 +0,0 @@ -"""Tests for the ProxySPEX approximator.""" - -from __future__ import annotations - -import numpy as np -import pytest - -from shapiq.approximator.proxy import MSRBiased -from shapiq.game_theory.exact import ExactComputer -from shapiq.interaction_values import InteractionValues - - -def test_initialization_defaults(): - """Test that MSR-b initializes with correct defaults.""" - n = 10 - msr_b = MSRBiased(n=n) - - # Check ProxySHAP default values - assert msr_b.n == n - assert msr_b.max_order == 2 - assert msr_b.index == "SII" - - -@pytest.mark.parametrize( - ("n", "index", "max_order"), - [ - (7, "STII", 2), - (7, "FBII", 3), - (20, "FSII", 20), - ], -) -def test_initialization_custom(n, index, max_order): - """Test MSR-b initialization with custom parameters.""" - msr_b = MSRBiased( - n=n, - index=index, - max_order=max_order, - ) - - assert msr_b.n == n - assert msr_b.max_order == (n if max_order is None else max_order) - assert msr_b.index == index - - -@pytest.mark.parametrize( - ("n", "interactions", "budget"), - [ - (10, {(), (1,), (1, 2)}, 1024), - (7, {(), (1,), (1, 2)}, 128), - ], -) -def test_approximate(n, interactions, budget): - """Test ProxySHAP approximation functionality.""" - - def dummy_game(X): - return np.array( - [sum(1 for interaction in interactions if all(x[i] for i in interaction)) for x in X] - ) - - # Initialize MSR-b approximator - msr_b = MSRBiased(n=n, random_state=42, index="SII", max_order=2) - - exact_computer = ExactComputer(game=dummy_game, n_players=n) - gt_values = exact_computer(index="SII", order=2) - # Perform approximation - estimates = msr_b.approximate(budget, dummy_game) - - # Verify the result structure - assert isinstance(estimates, InteractionValues) - assert estimates.max_order == 2 - assert estimates.min_order == 0 # Default top_order is False - assert estimates.index == "SII" - assert estimates.estimated - assert estimates.estimation_budget > 0 - - # Check that values are not empty - assert len(estimates.values) > 0 - - for interaction in interactions: - if interaction == (): - continue - assert np.allclose(estimates[interaction], gt_values[interaction], atol=1e-5) diff --git a/tests/shapiq/tests_unit/tests_approximators/test_approximator_owen_sv.py b/tests/shapiq/tests_unit/tests_approximators/test_approximator_owen_sv.py deleted file mode 100644 index c0d1ffd8c..000000000 --- a/tests/shapiq/tests_unit/tests_approximators/test_approximator_owen_sv.py +++ /dev/null @@ -1,82 +0,0 @@ -"""This test module contains all tests regarding the SV stratified sampling approximator.""" - -from __future__ import annotations - -import numpy as np -import pytest - -from shapiq.approximator.marginals import OwenSamplingSV -from shapiq_games.synthetic import DummyGame - - -@pytest.mark.parametrize( - ("n", "m", "expected"), - [ - (5, 1, [0.5]), - (5, 2, [0.0, 1.0]), - (5, 3, [0.0, 0.5, 1.0]), - (5, 4, [0.0, 0.33333, 0.66666, 1.0]), - (5, 5, [0.0, 0.25, 0.5, 0.75, 1.0]), - (5, 6, [0.0, 0.2, 0.4, 0.6, 0.8, 1.0]), - (5, 10, [0.0, 0.11111, 0.22222, 0.33333, 0.44444, 0.55555, 0.66666, 0.77777, 0.88888, 1.0]), - (5, 11, [0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0]), - ], -) -def test_anchorpoints(n, m, expected): - """Tests the generation of anchor points in the OwenSamplingSV approximator.""" - approximator = OwenSamplingSV(n, m, random_state=42) - output = approximator.get_anchor_points(m) - expected = np.array(expected) - assert np.allclose(output, expected) - - with pytest.raises(ValueError): - _ = approximator.get_anchor_points(0) - - -@pytest.mark.parametrize( - ("n", "m", "budget"), - [ - (5, 3, 102), - (5, 3, 100), - (5, 3, 1000), - (5, 1, 1000), - (5, 2, 1000), - (5, 10, 1000), - (5, 41, 10000), - ], -) -def test_approximate(n, m, budget): - """Tests the approximation of the OwenSamplingSV approximator.""" - interaction = (1, 2) - game = DummyGame(n, interaction) - - approximator = OwenSamplingSV(n, m, random_state=42) - - assert approximator.index == "SV" - - # test for init parameter - assert approximator.index == "SV" - assert approximator.n == n - assert approximator.max_order == 1 - assert approximator.top_order is False - - sv_estimates = approximator.approximate(budget, game) - - # check that the budget is respected - assert game.access_counter <= budget - assert sv_estimates.index == "SV" - assert sv_estimates.max_order == 1 - assert sv_estimates.min_order == 0 - assert sv_estimates.estimation_budget <= budget - assert sv_estimates.estimated is True # always estimated - - # check Shapley values for all players that have only marginal contributions of size 0.2 - # their estimates must be exactly 0.2 - assert sv_estimates[(0,)] == pytest.approx(0.2, 0.001) - assert sv_estimates[(3,)] == pytest.approx(0.2, 0.001) - assert sv_estimates[(4,)] == pytest.approx(0.2, 0.001) - - # check Shapley values for interaction players - if budget >= 100000 and m >= 40: - assert sv_estimates[(1,)] == pytest.approx(0.7, 0.1) - assert sv_estimates[(2,)] == pytest.approx(0.7, 0.1) diff --git a/tests/shapiq/tests_unit/tests_approximators/test_approximator_permutation_sii.py b/tests/shapiq/tests_unit/tests_approximators/test_approximator_permutation_sii.py deleted file mode 100644 index 5e3176419..000000000 --- a/tests/shapiq/tests_unit/tests_approximators/test_approximator_permutation_sii.py +++ /dev/null @@ -1,77 +0,0 @@ -"""This test module contains all tests regarding the SII permutation sampling approximator.""" - -from __future__ import annotations - -import pytest - -from shapiq.approximator.permutation import PermutationSamplingSII -from shapiq.interaction_values import InteractionValues -from shapiq_games.synthetic import DummyGame - - -@pytest.mark.parametrize( - ("n", "max_order", "top_order", "index", "expected"), - [ - (3, 1, True, "SII", 6), - (3, 1, False, "SII", 6), - (3, 2, True, "SII", 8), - (3, 2, False, "SII", 14), - (10, 3, False, "SII", 120), - (10, 3, False, "k-SII", 120), - (10, 3, False, "something", 120), # expected to fail with ValueError - ], -) -def test_initialization(n, max_order, top_order, index, expected): - """Tests the initialization of the PermutationSamplingSII approximator.""" - if index == "something": - with pytest.raises(ValueError): - _ = PermutationSamplingSII(n, max_order, index, top_order=top_order) - return - approximator = PermutationSamplingSII(n, max_order, index, top_order=top_order) - assert approximator.n == n - assert approximator.max_order == max_order - assert approximator.top_order == top_order - assert approximator.min_order == (max_order if top_order else 0) - assert approximator.iteration_cost == expected - assert approximator.index == index - - -@pytest.mark.parametrize("index", ["SII", "k-SII"]) -@pytest.mark.parametrize( - ("n", "max_order", "top_order", "budget", "batch_size"), - [ - (7, 2, False, 380, 10), - (7, 2, False, 500, 10), - (7, 2, False, 500, None), - (7, 2, True, 500, None), - ], -) -def test_approximate(n, max_order, top_order, budget, batch_size, index): - """Tests the approximation of the PermutationSamplingSII approximator.""" - interaction = (1, 2) - game = DummyGame(n, interaction) - approximator = PermutationSamplingSII(n, max_order, index, top_order=top_order, random_state=42) - estimates = approximator.approximate(budget, game, batch_size=batch_size) - assert isinstance(estimates, InteractionValues) - assert estimates.max_order == max_order - assert estimates.min_order == (max_order if (top_order and index != "k-SII") else 0) - assert estimates.index == index - assert estimates.estimated is True # always estimated - assert estimates.estimation_budget <= budget - - # check that the budget is respected - assert game.access_counter <= budget - - # check that the estimates are correct - if not top_order: - assert estimates[(0,)] == pytest.approx(0.1442, abs=0.2) - - if index == "SII": - assert estimates[(1,)] == pytest.approx(0.6429, abs=0.2) # large interval - assert estimates[(2,)] == pytest.approx(0.6429, abs=0.2) - if index == "k-SII": - assert estimates[(1,)] == pytest.approx(0.1442, abs=0.2) - assert estimates[(2,)] == pytest.approx(0.1442, abs=0.2) - - # for order 2 the interaction between player 1 and 2 is the most important - assert estimates[(1, 2)] == pytest.approx(1.0, 0.2) diff --git a/tests/shapiq/tests_unit/tests_approximators/test_approximator_permutation_sti.py b/tests/shapiq/tests_unit/tests_approximators/test_approximator_permutation_sti.py deleted file mode 100644 index 196ff0e06..000000000 --- a/tests/shapiq/tests_unit/tests_approximators/test_approximator_permutation_sti.py +++ /dev/null @@ -1,77 +0,0 @@ -"""This test module contains all tests regarding the STII permutation sampling approximator.""" - -from __future__ import annotations - -import numpy as np -import pytest - -from shapiq.approximator.permutation import PermutationSamplingSTII -from shapiq.interaction_values import InteractionValues -from shapiq_games.synthetic import DummyGame - - -@pytest.mark.parametrize( - ("n", "max_order", "iteration_cost"), - [ - (3, 1, 6), - (3, 2, 12), - (7, 2, 84), # used in subsequent tests - (10, 3, 960), - ], -) -def test_initialization(n, max_order, iteration_cost): - """Tests the initialization of the PermutationSamplingSTII approximator.""" - approximator = PermutationSamplingSTII(n, max_order) - assert approximator.n == n - assert approximator.max_order == max_order - assert approximator.top_order is False - assert approximator.min_order == 0 - assert approximator.iteration_cost == iteration_cost - assert approximator.index == "STII" - - -@pytest.mark.parametrize( - ("n", "max_order", "budget", "batch_size"), - [ - (7, 2, 380, 2), - (7, 2, 500, 2), - ], -) -def test_approximate(n, max_order, budget, batch_size): - """Tests the approximation of the PermutationSamplingSTII approximator.""" - interaction = (1, 2) - game = DummyGame(n, interaction) - approximator = PermutationSamplingSTII(n, max_order, random_state=42) - sti_estimates = approximator.approximate(budget, game, batch_size=batch_size) - assert isinstance(sti_estimates, InteractionValues) - assert sti_estimates.max_order == max_order - assert sti_estimates.min_order == 0 - assert sti_estimates.estimated is True # always estimated - assert sti_estimates.estimation_budget <= budget - - # check that the budget is respected - assert game.access_counter <= budget - - # check that the estimates are correct - # for order 1 all players should be equal - first_order_values = np.asarray([sti_estimates[(i,)] for i in range(n)]) - assert np.allclose(first_order_values, first_order_values[0]) - # for order 2 the interaction between player 1 and 2 is the most important (1.0) - assert sti_estimates[(1, 2)] == pytest.approx(1.0, 0.2) - - # check efficiency - efficiency = np.sum(sti_estimates.values) - assert efficiency == pytest.approx(2.0, 0.01) - - -def test_small_budget_warning(): - """Tests that a warning is raised if the budget is too small.""" - n, max_order = 10, 3 - interaction = (1, 2) - game = DummyGame(n, interaction) - approximator = PermutationSamplingSTII(n, max_order, random_state=42) - # lower_order_cost is 55 - with pytest.warns(UserWarning): - _ = approximator.approximate(1, game) # not even lower_order_cost - with pytest.warns(UserWarning): - _ = approximator.approximate(56, game) # lower_order_cost but no iteration diff --git a/tests/shapiq/tests_unit/tests_approximators/test_approximator_permutation_sv.py b/tests/shapiq/tests_unit/tests_approximators/test_approximator_permutation_sv.py deleted file mode 100644 index 44fcae4ed..000000000 --- a/tests/shapiq/tests_unit/tests_approximators/test_approximator_permutation_sv.py +++ /dev/null @@ -1,57 +0,0 @@ -"""This test module contains all tests regarding the SV permutation sampling approximator.""" - -from __future__ import annotations - -import numpy as np -import pytest - -from shapiq.approximator.permutation import PermutationSamplingSV -from shapiq_games.synthetic import DummyGame - - -@pytest.mark.parametrize( - ("n", "budget", "batch_size"), - [(5, 102, 1), (5, 102, 2), (5, 102, 5), (5, 100, 8), (5, 1000, 10)], -) -def test_approximate(n, budget, batch_size): - """Tests the approximation of the PermutationSamplingSV approximator.""" - interaction = (1, 2) - game = DummyGame(n, interaction) - - approximator = PermutationSamplingSV(n, random_state=42) - - # test for init parameter - assert approximator.index == "SV" - assert approximator.n == n - assert approximator.iteration_cost == n - 1 - assert approximator.max_order == 1 - assert approximator.top_order is False - - sv_estimates = approximator.approximate(budget, game, batch_size=batch_size) - - # check that the budget is respected - assert game.access_counter <= budget - assert sv_estimates.index == "SV" - assert sv_estimates.estimated is True # always estimated - assert sv_estimates.estimation_budget <= budget - - # check efficiency - efficiency = np.sum(sv_estimates.values) - assert efficiency == pytest.approx(2, 0.01) - - # check Shapley values for all players that have only marginal contributions of size 0.2 - # their estimates must be exactly 0.2 - assert sv_estimates[(0,)] == pytest.approx(0.2, 0.001) - assert sv_estimates[(3,)] == pytest.approx(0.2, 0.001) - assert sv_estimates[(4,)] == pytest.approx(0.2, 0.001) - - # check Shapley values for interaction players - if budget >= 1000: - assert sv_estimates[(1,)] == pytest.approx(0.7, 0.1) - assert sv_estimates[(2,)] == pytest.approx(0.7, 0.1) - - # check for single player game (caught edge case in code) - game = DummyGame(1, (0,)) - approximator = PermutationSamplingSV(1, random_state=42) - sv_estimates = approximator.approximate(10, game) - assert sv_estimates[(0,)] == pytest.approx(2.0, 0.01) diff --git a/tests/shapiq/tests_unit/tests_approximators/test_approximator_proxyshap.py b/tests/shapiq/tests_unit/tests_approximators/test_approximator_proxyshap.py deleted file mode 100644 index 494a256d3..000000000 --- a/tests/shapiq/tests_unit/tests_approximators/test_approximator_proxyshap.py +++ /dev/null @@ -1,84 +0,0 @@ -"""Tests for the ProxySPEX approximator.""" - -from __future__ import annotations - -import numpy as np -import pytest -from xgboost import XGBRegressor - -from shapiq.approximator.proxy import ProxySHAP -from shapiq.game_theory.exact import ExactComputer -from shapiq.interaction_values import InteractionValues - - -def test_initialization_defaults(): - """Test that ProxySHAP initializes with correct defaults.""" - n = 10 - proxyshap = ProxySHAP(n=n) - - # Check ProxySHAP default values - assert proxyshap.n == n - assert proxyshap.max_order == 2 - assert proxyshap.index == "SII" - assert isinstance(proxyshap.proxy_model, XGBRegressor) - - -@pytest.mark.parametrize( - ("n", "index", "max_order"), - [ - (7, "STII", 2), - (7, "FBII", 3), - (20, "FSII", 20), - ], -) -def test_initialization_custom(n, index, max_order): - """Test ProxySHAP initialization with custom parameters.""" - proxyshap = ProxySHAP( - n=n, - index=index, - max_order=max_order, - ) - - assert proxyshap.n == n - assert proxyshap.max_order == (n if max_order is None else max_order) - assert proxyshap.index == index - - -@pytest.mark.parametrize( - ("n", "interactions", "budget"), - [ - (10, {(), (1,), (1, 2)}, 1024), - (7, {(), (1,), (1, 2)}, 128), - ], -) -def test_approximate(n, interactions, budget): - """Test ProxySHAP approximation functionality.""" - - def dummy_game(X): - return np.array( - [sum(1 for interaction in interactions if all(x[i] for i in interaction)) for x in X] - ) - - # Initialize ProxySHAP approximator - proxyshap = ProxySHAP(n=n, random_state=42, index="SII", max_order=2) - - exact_computer = ExactComputer(game=dummy_game, n_players=n) - gt_values = exact_computer(index="SII", order=2) - # Perform approximation - estimates = proxyshap.approximate(budget, dummy_game) - - # Verify the result structure - assert isinstance(estimates, InteractionValues) - assert estimates.max_order == 2 - assert estimates.min_order == 0 # Default top_order is False - assert estimates.index == "SII" - assert estimates.estimated - assert estimates.estimation_budget > 0 - - # Check that values are not empty - assert len(estimates.values) > 0 - - for interaction in interactions: - if interaction == (): - continue - assert np.allclose(estimates[interaction], gt_values[interaction], atol=1e-5) diff --git a/tests/shapiq/tests_unit/tests_approximators/test_approximator_proxyspex.py b/tests/shapiq/tests_unit/tests_approximators/test_approximator_proxyspex.py deleted file mode 100644 index 2c925e930..000000000 --- a/tests/shapiq/tests_unit/tests_approximators/test_approximator_proxyspex.py +++ /dev/null @@ -1,100 +0,0 @@ -"""Tests for the ProxySPEX approximator.""" - -from __future__ import annotations - -import sys - -import pytest - -from shapiq.approximator.sparse.proxyspex import ProxySPEX -from shapiq.interaction_values import InteractionValues -from tests.shapiq.markers import skip_if_no_lightgbm - - -@skip_if_no_lightgbm -def test_initialization_defaults(): - """Test that ProxySPEX initializes with correct defaults.""" - n = 10 - proxyspex = ProxySPEX(n=n) - - # Check ProxySPEX default values - assert proxyspex.n == n - assert proxyspex.max_order == n # Default is None, which becomes n - assert proxyspex.index == "FBII" - assert proxyspex.top_order is False - assert proxyspex.transform_type == "fourier" - assert proxyspex.decoder_type == "proxyspex" # For proxyspex - - -@pytest.mark.parametrize( - ("n", "index", "max_order", "top_order"), - [ - (7, "STII", 2, False), - (7, "FBII", 3, True), - (20, "FSII", None, False), - ], -) -@skip_if_no_lightgbm -def test_initialization_custom(n, index, max_order, top_order): - """Test ProxySPEX initialization with custom parameters.""" - proxyspex = ProxySPEX( - n=n, - index=index, - max_order=max_order, - top_order=top_order, - ) - - assert proxyspex.n == n - assert proxyspex.max_order == (n if max_order is None else max_order) - assert proxyspex.index == index - assert proxyspex.top_order is top_order - assert proxyspex.transform_type == "fourier" - - -@pytest.mark.parametrize( - ("n", "interactions", "budget"), - [ - (10, {(), (1,), (1, 2)}, 1000), - (7, {(), (1,), (1, 2)}, 800), - ], -) -@skip_if_no_lightgbm -def test_approximate(n, interactions, budget): - """Test ProxySPEX approximation functionality.""" - - def dummy_game(X): - return [sum(1 for interaction in interactions if all(x[i] for i in interaction)) for x in X] - - # Initialize SPEX approximator - proxyspex = ProxySPEX(n=n, random_state=42) - - # Perform approximation - estimates = proxyspex.approximate(budget, dummy_game) - - # Verify the result structure - assert isinstance(estimates, InteractionValues) - assert estimates.max_order == n - assert estimates.min_order == 0 # Default top_order is False - assert estimates.index == "FBII" - assert estimates.estimated - assert estimates.estimation_budget > 0 - - # Check that values are not empty - assert len(estimates.values) > 0 - - # Check that the target interaction has a non-zero value - for interaction in interactions: - assert interaction in estimates.interaction_lookup - assert abs(estimates[interaction]) > 0 - # The dummy game should return approximately 1.0 for the target interaction - assert estimates[interaction] == pytest.approx(1.0, abs=0.5) - - -def test_proxyspex_import_error_if_missing(monkeypatch): - """Tests that ProxySPEX raises an ImportError if lightgbm is not installed.""" - # Temporarily pretend lightgbm is not installed - monkeypatch.setitem(sys.modules, "lightgbm", None) - - # Use pytest.raises to assert that an ImportError is thrown - with pytest.raises(ImportError, match="The 'lightgbm' package is required"): - ProxySPEX(n=10) diff --git a/tests/shapiq/tests_unit/tests_approximators/test_approximator_regression_base.py b/tests/shapiq/tests_unit/tests_approximators/test_approximator_regression_base.py deleted file mode 100644 index e5abf9420..000000000 --- a/tests/shapiq/tests_unit/tests_approximators/test_approximator_regression_base.py +++ /dev/null @@ -1,19 +0,0 @@ -"""This module contains all tests regarding the base Regression approximator.""" - -from __future__ import annotations - -from typing import get_args - -import pytest - -from shapiq.approximator.regression import Regression -from shapiq.approximator.regression.base import ValidRegressionIndices - - -def test_basic_functions(): - """Tests the initialization of the Regression approximator.""" - for index in set(get_args(ValidRegressionIndices)): - _ = Regression(n=7, max_order=2, index=index) - - with pytest.raises(ValueError): - _ = Regression(n=7, max_order=2, index="wrong_index") diff --git a/tests/shapiq/tests_unit/tests_approximators/test_approximator_regression_fbi.py b/tests/shapiq/tests_unit/tests_approximators/test_approximator_regression_fbi.py deleted file mode 100644 index bcc8c8184..000000000 --- a/tests/shapiq/tests_unit/tests_approximators/test_approximator_regression_fbi.py +++ /dev/null @@ -1,90 +0,0 @@ -"""This test module contains all tests regarding the FSII regression approximator.""" - -from __future__ import annotations - -from copy import copy, deepcopy - -import numpy as np -import pytest - -from shapiq import ExactComputer -from shapiq.approximator import RegressionFBII -from shapiq_games.synthetic import DummyGame - - -@pytest.mark.parametrize( - ("n", "max_order"), - [ - (3, 1), - (3, 2), - (7, 2), # used in subsequent tests - (10, 3), - ], -) -def test_initialization(n, max_order): - """Tests the initialization of the RegressionFBII approximator.""" - approximator = RegressionFBII(n, max_order) - assert approximator.n == n - assert approximator.max_order == max_order - assert approximator.top_order is False - assert approximator.min_order == 0 - assert approximator.iteration_cost == 1 - assert approximator.index == "FBII" - - approximator_copy = copy(approximator) - approximator_deepcopy = deepcopy(approximator) - approximator_deepcopy.index = "something" - assert approximator_copy == approximator # check that the copy is equal - assert approximator_deepcopy != approximator # check that the deepcopy is not equal - approximator_string = str(approximator) - assert repr(approximator) == approximator_string - assert hash(approximator) == hash(approximator_copy) - assert hash(approximator) != hash(approximator_deepcopy) - - -def test_extreme_weight_initialisation(): - """Tests if the attributes and properties of approximators are set correctly.""" - # In local tests this number still did not trigger an OverflowError - n_players = 1000 - game = DummyGame(n=n_players, interaction=(1, 2)) - approximator = RegressionFBII(n=game.n_players, max_order=1, random_state=42) - approximator.approximate(200, game) - - # This should trigger a warning - n_players = 2000 - game = DummyGame(n=n_players, interaction=(1, 2)) - with pytest.warns(UserWarning): - # We approximate weights very extreme - approximator = RegressionFBII(n=game.n_players, max_order=1, random_state=42) - approximator.approximate(200, game) - - -def test_approximate_bv_equality(cooking_game): - """Tests the approximation of the RegressionFBII approximator to be equal to BV.""" - n_players = 3 - game = cooking_game - exact_computer = ExactComputer(game, n_players) - banzhaf = exact_computer("BV") - fbii_exac = exact_computer("FBII", order=1) - approximator = RegressionFBII(n=n_players, max_order=1) - - fbii_approx = approximator.approximate(budget=2**n_players, game=game) - assert np.allclose(fbii_exac.values, fbii_approx.values, atol=1e-2) - - # disregard the baseline value - assert np.allclose(banzhaf.values[1:], fbii_approx.values[1:], atol=1e-2) - - -def test_approximate_fbii(paper_game): - """Tests the approximation of the RegressionFBII approximator. - - This test checks the approximation of the RegressionFBII approximator to be equal to the results - from http://jmlr.org/papers/v24/22-0202.html. - """ - n_players = 11 - game = paper_game - approximator = RegressionFBII(n=n_players, max_order=2) - banzhaf_fbii = approximator.approximate(budget=2**n_players, game=game) - - assert np.allclose(np.round(banzhaf_fbii.values[1:12], 2), 1.08, atol=1e-4) - assert np.allclose(banzhaf_fbii.values[12:], -0.113, atol=1e-2) diff --git a/tests/shapiq/tests_unit/tests_approximators/test_approximator_regression_fsi.py b/tests/shapiq/tests_unit/tests_approximators/test_approximator_regression_fsi.py deleted file mode 100644 index 12809c398..000000000 --- a/tests/shapiq/tests_unit/tests_approximators/test_approximator_regression_fsi.py +++ /dev/null @@ -1,60 +0,0 @@ -"""This test module contains all tests regarding the FSII regression approximator.""" - -from __future__ import annotations - -import numpy as np -import pytest - -from shapiq.approximator.regression import RegressionFSII -from shapiq.interaction_values import InteractionValues -from shapiq_games.synthetic import DummyGame - - -@pytest.mark.parametrize( - ("n", "max_order"), - [ - (3, 1), - (3, 2), - (7, 2), # used in subsequent tests - (10, 3), - ], -) -def test_initialization(n, max_order): - """Tests the initialization of the RegressionFSII approximator.""" - approximator = RegressionFSII(n, max_order) - assert approximator.n == n - assert approximator.max_order == max_order - assert approximator.top_order is False - assert approximator.min_order == 0 - assert approximator.iteration_cost == 1 - assert approximator.index == "FSII" - - -@pytest.mark.parametrize(("n", "max_order", "budget"), [(7, 2, 380), (7, 2, 100)]) -def test_approximate(n, max_order, budget): - """Tests the approximation of the RegressionFSII approximator.""" - interaction = (1, 2) - game = DummyGame(n, interaction) - approximator = RegressionFSII(n, max_order, random_state=42) - fsi_estimates = approximator.approximate(budget, game) - assert isinstance(fsi_estimates, InteractionValues) - assert fsi_estimates.max_order == max_order - assert fsi_estimates.min_order == 0 - - # check that the budget is respected - assert game.access_counter <= budget - - # check that the estimates are correct - assert fsi_estimates.index == "FSII" - - # for order 1 all players should be equal - first_order: np.ndarray = fsi_estimates.values[1 : n + 1] # fist n values are first order - assert np.allclose(first_order, first_order[0]) - - # for order 2 the interaction between player 1 and 2 is the most important (1.0) - interaction_estimate = fsi_estimates[interaction] - assert interaction_estimate == pytest.approx(1.0, 0.1) - - # check efficiency - efficiency = np.sum(fsi_estimates.values) - assert efficiency == pytest.approx(efficiency, 0.1) diff --git a/tests/shapiq/tests_unit/tests_approximators/test_approximator_shapiq.py b/tests/shapiq/tests_unit/tests_approximators/test_approximator_shapiq.py deleted file mode 100644 index 2d730dec5..000000000 --- a/tests/shapiq/tests_unit/tests_approximators/test_approximator_shapiq.py +++ /dev/null @@ -1,128 +0,0 @@ -"""This test module contains all tests regarding the shapiq approximator.""" - -from __future__ import annotations - -import numpy as np -import pytest - -from shapiq.approximator.montecarlo import SHAPIQ -from shapiq.interaction_values import InteractionValues -from shapiq_games.synthetic import DummyGame - - -@pytest.mark.parametrize( - ("n", "max_order", "index", "top_order"), - [ - (7, 2, "SII", False), - (7, 2, "SII", True), - (7, 2, "STII", False), - (7, 2, "STII", True), - (7, 2, "FSII", True), - (7, 2, "FBII", True), - ], -) -def test_initialization(n, max_order, index, top_order): - """Tests the initialization of the ShapIQ approximator.""" - approximator = SHAPIQ(n, max_order, index=index, top_order=top_order) - assert approximator.n == n - assert approximator.max_order == max_order - assert approximator.top_order is top_order - assert approximator.min_order == (max_order if top_order else 0) - assert approximator.iteration_cost == 1 - assert approximator.index == index - - -@pytest.mark.parametrize(("n", "max_order", "budget"), [(7, 2, 100)]) -def test_approximate_fsi(n, max_order, budget): - """Tests the approximation of the ShapIQ FSII approximation.""" - interaction = (1, 2) - game = DummyGame(n, interaction) - approximator = SHAPIQ(n, max_order, index="FSII", top_order=True, random_state=42) - estimates = approximator.approximate(budget, game) - assert isinstance(estimates, InteractionValues) - assert estimates.max_order == max_order - assert estimates.min_order == max_order # only top order for FSII - - # check that the budget is respected - assert game.access_counter <= budget + 2 - - # for order 2 (max_order) the interaction between player 1 and 2 is the most important (1.0) - interaction_estimate = estimates[interaction] - assert interaction_estimate == pytest.approx(1.0, 0.4) # large tolerance for FSII - - -@pytest.mark.parametrize(("n", "max_order", "budget"), [(7, 2, 100)]) -def test_approximate_fbi(n, max_order, budget): - """Tests the approximation of the ShapIQ FSII approximation.""" - interaction = (1, 2) - game = DummyGame(n, interaction) - approximator = SHAPIQ(n, max_order, index="FBII", top_order=True, random_state=42) - estimates = approximator.approximate(budget, game) - assert isinstance(estimates, InteractionValues) - assert estimates.max_order == max_order - assert estimates.min_order == max_order # only top order for FSII - - # check that the budget is respected - assert game.access_counter <= budget + 2 - - # for order 2 (max_order) the interaction between player 1 and 2 is the most important (1.0) - interaction_estimate = estimates[interaction] - assert interaction_estimate == pytest.approx(1.0, 0.4) # large tolerance for FBII - - -@pytest.mark.parametrize( - ("n", "max_order", "top_order", "budget"), - [(7, 2, False, 100), (7, 2, True, 100), (7, 2, False, 300)], -) -def test_approximate_sii(n, max_order, top_order, budget): - """Tests the approximation of the ShapIQ SII approximation.""" - interaction = (1, 2) - game = DummyGame(n, interaction) - approximator = SHAPIQ(n, max_order, index="SII", top_order=top_order, random_state=42) - estimates = approximator.approximate(budget, game) - assert isinstance(estimates, InteractionValues) - assert estimates.max_order == max_order - assert estimates.min_order == (max_order if top_order else 0) - - # check that the budget is respected - assert game.access_counter <= budget + 2 - - # for order 2 (max_order) the interaction between player 1 and 2 is the most important (1.0) - assert estimates[interaction] == pytest.approx(1.0, 0.4) - - if not top_order: - # for order 1 (min_order) the interaction between 1 and 2 is the most important (0.6429) - if budget <= 2**n: - assert estimates[(1,)] == pytest.approx(0.6429, 0.4) - assert estimates[(2,)] == pytest.approx(0.6429, 0.4) - else: - assert estimates[(1,)] == pytest.approx(0.6429, 0.01) - assert estimates[(2,)] == pytest.approx(0.6429, 0.01) - - -@pytest.mark.parametrize( - ("n", "max_order", "top_order", "budget"), [(7, 2, False, 100), (7, 2, True, 100)] -) -def test_approximate_sti(n, max_order, top_order, budget): - """Tests the approximation of the ShapIQ STII approximation.""" - interaction = (1, 2) - game = DummyGame(n, interaction) - approximator = SHAPIQ(n, max_order, index="STII", top_order=top_order, random_state=42) - estimates = approximator.approximate(budget, game) - assert isinstance(estimates, InteractionValues) - assert estimates.max_order == max_order - assert estimates.min_order == (max_order if top_order else 0) - - # check that the budget is respected - assert game.access_counter <= budget + 2 - - # for order 2 (max_order) the interaction between player 1 and 2 is the most important (1.0) - assert estimates[interaction] == pytest.approx(1.0, 0.5) - - if not top_order: - # for order 1 (min_order) the interaction between player 1 and 2 is the most important (0.7) - assert estimates[(1,)] == pytest.approx(1 / 7, 0.4) - assert estimates[(2,)] == pytest.approx(1 / 7, 0.4) - - # check efficiency - assert np.sum(estimates.values) == pytest.approx(2.0, 0.4) diff --git a/tests/shapiq/tests_unit/tests_approximators/test_approximator_spex.py b/tests/shapiq/tests_unit/tests_approximators/test_approximator_spex.py deleted file mode 100644 index 047b26c7d..000000000 --- a/tests/shapiq/tests_unit/tests_approximators/test_approximator_spex.py +++ /dev/null @@ -1,171 +0,0 @@ -"""Tests for the SPEX approximator.""" - -from __future__ import annotations - -import pytest - -from shapiq.approximator.sparse.spex import SPEX -from shapiq.interaction_values import InteractionValues -from shapiq_games.synthetic import DummyGame - - -def test_initialization_defaults(): - """Test that SPEX initializes with correct defaults.""" - n = 10 - spex = SPEX(n=n) - - # Check SPEX default values - assert spex.n == n - assert spex.max_order == n # Default is None, which becomes n - assert spex.index == "FBII" - assert spex.top_order is False - assert spex.transform_type == "fourier" - assert spex.decoder_args["reconstruct_method_channel"] == "identity-siso" # For soft decoder - - -@pytest.mark.parametrize( - ("n", "index", "max_order", "top_order", "decoder_type"), - [ - (7, "STII", 2, False, "soft"), - (7, "FBII", 3, True, "hard"), - (20, "FSII", None, False, "soft"), - ], -) -def test_initialization_custom(n, index, max_order, top_order, decoder_type): - """Test SPEX initialization with custom parameters.""" - spex = SPEX( - n=n, - index=index, - max_order=max_order, - top_order=top_order, - decoder_type=decoder_type, - ) - - assert spex.n == n - assert spex.max_order == (n if max_order is None else max_order) - assert spex.index == index - assert spex.top_order is top_order - assert spex.transform_type == "fourier" - - # Check decoder configuration - if decoder_type.lower() == "soft": - assert spex.decoder_args["reconstruct_method_channel"] == "identity-siso" - else: - assert spex.decoder_args["reconstruct_method_channel"] == "identity" - - -@pytest.mark.parametrize( - ("n", "interaction", "budget"), - [ - (10, (1, 2), 1000), - (7, (0, 3, 5), 800), - ], -) -def test_approximate(n, interaction, budget): - """Test SPEX approximation functionality.""" - # Create a game with a specific interaction - game = DummyGame(n, interaction) - - # Initialize SPEX approximator - spex = SPEX(n=n, random_state=42) - - # Perform approximation - estimates = spex.approximate(budget, game) - - # Verify the result structure - assert isinstance(estimates, InteractionValues) - assert estimates.max_order == n - assert estimates.min_order == 0 # Default top_order is False - assert estimates.index == "FBII" - assert estimates.estimated - assert estimates.estimation_budget > 0 - - # Check that game was called within budget - assert game.access_counter <= budget + 2 - - # Check that values are not empty - assert len(estimates.values) > 0 - - # Check that the target interaction has a non-zero value - if len(interaction) <= n: - assert interaction in estimates.interaction_lookup - assert abs(estimates[interaction]) > 0 - # The dummy game should return approximately 1.0 for the target interaction - assert estimates[interaction] == pytest.approx(1.0, abs=0.5) - - -def test_spex_vs_sparse(): - """Test that SPEX behaves identically to Sparse with transform_type='fourier'.""" - from shapiq.approximator.sparse import Sparse - - n = 8 - interaction = (1, 3) - budget = 800 - random_state = 42 - - # Create a game - game = DummyGame(n, interaction) - - # Initialize both approximators with identical parameters - spex = SPEX(n=n, random_state=random_state) - sparse = Sparse( - n=n, index="FBII", transform_type="fourier", decoder_type="soft", random_state=random_state - ) - - # Run approximation with both - spex_estimates = spex.approximate(budget, game) - - # Reset game counter for fair comparison - game.access_counter = 0 - sparse_estimates = sparse.approximate(budget, game) - - # Check that both produced similar results - assert spex_estimates.index == sparse_estimates.index - assert spex_estimates.max_order == sparse_estimates.max_order - assert spex_estimates.min_order == sparse_estimates.min_order - - # Check that the interaction is estimated similarly - assert abs(spex_estimates[interaction] - sparse_estimates[interaction]) < 0.1 - - -@pytest.mark.parametrize( - ("n", "interaction", "budget", "correct_b", "correct_t"), - [ - (10, (1, 2), 1000, 3, 5), - (10, (1, 2), 450, 3, 3), - (7, (0, 3, 5), 800, 3, 5), - (7, (0, 3, 5), 300, 3, 2), - ], -) -def test_sparsity_parameter(n, interaction, budget, correct_b, correct_t): - """Test SPEX approximation functionality.""" - # Create a game with a specific interaction - game = DummyGame(n, interaction) - - # Initialize SPEX approximator - spex = SPEX(n=n, random_state=42) - - # Run approximation with both - _ = spex.approximate(budget, game) - - assert spex.query_args["b"] == correct_b - assert spex.degree_parameter == correct_t - - -@pytest.mark.parametrize( - ("n", "interaction", "budget"), - [ - (10, (1, 2), 100), - (7, (0, 3, 5), 20), - ], -) -def test_undersampling(n, interaction, budget): - """Test SPEX approximation functionality.""" - # Create a game with a specific interaction - game = DummyGame(n, interaction) - - # Initialize SPEX approximator - spex = SPEX(n=n, random_state=42) - - with pytest.raises(ValueError): - _ = spex.approximate(budget, game) diff --git a/tests/shapiq/tests_unit/tests_approximators/test_approximator_stratified_sv.py b/tests/shapiq/tests_unit/tests_approximators/test_approximator_stratified_sv.py deleted file mode 100644 index cda739f30..000000000 --- a/tests/shapiq/tests_unit/tests_approximators/test_approximator_stratified_sv.py +++ /dev/null @@ -1,49 +0,0 @@ -"""This test module contains all tests regarding the SV stratified sampling approximator.""" - -from __future__ import annotations - -import pytest - -from shapiq.approximator.marginals import StratifiedSamplingSV -from shapiq_games.synthetic import DummyGame - - -@pytest.mark.parametrize( - ("n", "budget"), - [(5, 100), (5, 1000)], -) -def test_approximate(n, budget): - """Tests the approximation of the StratifiedSamplingSV approximator.""" - interaction = (1, 2) - game = DummyGame(n, interaction) - - approximator = StratifiedSamplingSV(n, random_state=42) - - assert approximator.index == "SV" - - # test for init parameter - assert approximator.index == "SV" - assert approximator.n == n - assert approximator.max_order == 1 - assert approximator.top_order is False - - sv_estimates = approximator.approximate(budget, game) - - # check that the budget is respected - assert game.access_counter <= budget - assert sv_estimates.index == "SV" - assert sv_estimates.max_order == 1 - assert sv_estimates.min_order == 0 - assert sv_estimates.estimation_budget <= budget - assert sv_estimates.estimated is True # always estimated - - # check Shapley values for all players that have only marginal contributions of size 0.2 - # their estimates must be exactly 0.2 - assert sv_estimates[(0,)] == pytest.approx(0.2, 0.001) - assert sv_estimates[(3,)] == pytest.approx(0.2, 0.001) - assert sv_estimates[(4,)] == pytest.approx(0.2, 0.001) - - # check Shapley values for interaction players - if budget >= 1000: - assert sv_estimates[(1,)] == pytest.approx(0.7, 0.2) - assert sv_estimates[(2,)] == pytest.approx(0.7, 0.2) diff --git a/tests/shapiq/tests_unit/tests_approximators/test_approximator_svarm.py b/tests/shapiq/tests_unit/tests_approximators/test_approximator_svarm.py deleted file mode 100644 index e657e78a8..000000000 --- a/tests/shapiq/tests_unit/tests_approximators/test_approximator_svarm.py +++ /dev/null @@ -1,37 +0,0 @@ -"""This test module contains all tests regarding the SVARM approximator.""" - -from __future__ import annotations - -import pytest - -from shapiq.approximator.montecarlo import SVARM -from shapiq.interaction_values import InteractionValues -from shapiq_games.synthetic import DummyGame - - -@pytest.mark.parametrize("n", [7, 10, 50]) -def test_initialization(n): - """Tests the initialization of the SVARM approximator.""" - approximator = SVARM(n=n) - assert approximator.n == n - assert approximator.max_order == 1 - assert approximator.iteration_cost == 1 - assert approximator.index == "SV" - assert approximator.min_order == 0 - - -@pytest.mark.parametrize(("n", "budget"), [(7, 100), (7, 300)]) -def test_approximate_sii(n, budget): - """Tests the approximation of the SVARM SV approximation.""" - interaction = (1, 2) - game = DummyGame(n, interaction) - svarm = SVARM(n, random_state=42) - estimates = svarm.approximate(budget, game) - assert isinstance(estimates, InteractionValues) - assert estimates.max_order == 1 - - # check that the budget is respected - assert game.access_counter <= budget + 2 - - assert estimates[(1,)] == pytest.approx(0.6429, 0.05) - assert estimates[(2,)] == pytest.approx(0.6429, 0.05) diff --git a/tests/shapiq/tests_unit/tests_approximators/test_approximator_svarmiq.py b/tests/shapiq/tests_unit/tests_approximators/test_approximator_svarmiq.py deleted file mode 100644 index bb81c4b0e..000000000 --- a/tests/shapiq/tests_unit/tests_approximators/test_approximator_svarmiq.py +++ /dev/null @@ -1,58 +0,0 @@ -"""This test module contains all tests regarding the svarmiq approximator.""" - -from __future__ import annotations - -import pytest - -from shapiq.approximator.montecarlo import SVARMIQ -from shapiq.interaction_values import InteractionValues -from shapiq_games.synthetic import DummyGame - - -@pytest.mark.parametrize( - ("n", "max_order", "index", "top_order"), - [ - (7, 2, "SII", False), - (7, 2, "SII", True), - (7, 2, "k-SII", True), - (7, 2, "k-SII", False), - (7, 2, "STII", False), - (7, 2, "STII", True), - (7, 2, "FSII", True), - ], -) -def test_initialization(n, max_order, index, top_order): - """Tests the initialization of the SVARM-IQ approximator.""" - approximator = SVARMIQ(n, max_order, index=index, top_order=top_order) - assert approximator.n == n - assert approximator.max_order == max_order - assert approximator.top_order is top_order - assert approximator.min_order == (max_order if top_order else 0) - assert approximator.iteration_cost == 1 - assert approximator.index == index - - -@pytest.mark.parametrize( - ("n", "max_order", "top_order", "budget"), - [(7, 2, False, 100), (7, 2, True, 100), (7, 2, False, 300)], -) -def test_approximate_sii(n, max_order, top_order, budget): - """Tests the approximation of the SVARM-IQ SII approximation.""" - interaction = (1, 2) - game = DummyGame(n, interaction) - approximator = SVARMIQ(n, max_order, index="SII", top_order=top_order, random_state=42) - estimates = approximator.approximate(budget, game) - assert isinstance(estimates, InteractionValues) - assert estimates.max_order == max_order - assert estimates.min_order == (max_order if top_order else 0) - - # check that the budget is respected - assert game.access_counter <= budget + 2 - - # for order 2 (max_order) the interaction between player 1 and 2 is the most important (1.0) - assert estimates[interaction] == pytest.approx(1.0, 0.01) - - if not top_order: - # for order 1 (min_order) the interaction between 1 and 2 is the most important (0.6429) - assert estimates[(1,)] == pytest.approx(0.6429, 0.05) - assert estimates[(2,)] == pytest.approx(0.6429, 0.05) diff --git a/tests/shapiq/tests_unit/tests_approximators/test_approximator_unbiased_ksh.py b/tests/shapiq/tests_unit/tests_approximators/test_approximator_unbiased_ksh.py deleted file mode 100644 index 24e9cc63a..000000000 --- a/tests/shapiq/tests_unit/tests_approximators/test_approximator_unbiased_ksh.py +++ /dev/null @@ -1,50 +0,0 @@ -"""This test module contains all tests for the Unbiased KernelSHAP approximator.""" - -from __future__ import annotations - -import pytest - -from shapiq.approximator import UnbiasedKernelSHAP -from shapiq_games.synthetic import DummyGame - - -def test_basic_functionality(): - """Tests the initialization of the RegressionFSII approximator.""" - n_players = 7 - - approximator = UnbiasedKernelSHAP(n_players) - assert approximator.n == n_players - assert approximator.max_order == 1 - assert approximator.top_order is False - assert approximator.min_order == 0 - assert approximator.iteration_cost == 1 - assert approximator.index == "SV" - - # test that the approximator can approximate the correct values - interaction = (1, 2) - game = DummyGame(n_players, interaction) - budget = 2**n_players - - approximator = UnbiasedKernelSHAP(n_players) - sv_estimates = approximator.approximate(budget, game) - assert sv_estimates.n_players == n_players - assert sv_estimates.max_order == 1 - assert sv_estimates.min_order == 0 - assert sv_estimates.index == "SV" - assert sv_estimates.estimated is False - assert sv_estimates.estimation_budget == budget - - # check that the values are correct - assert sv_estimates[()] == 0.0 - assert sv_estimates[(0,)] == pytest.approx(0.1429, 0.01) - assert sv_estimates[(1,)] == pytest.approx(0.6429, 0.01) - - # smaller budget - budget = int(budget * 0.75) - sv_estimates = approximator.approximate(budget, game) - assert sv_estimates.n_players == n_players - assert sv_estimates.max_order == 1 - assert sv_estimates.min_order == 0 - assert sv_estimates.index == "SV" - assert sv_estimates.estimated is True - assert sv_estimates.estimation_budget == budget diff --git a/tests/shapiq/tests_unit/tests_approximators/test_sampling.py b/tests/shapiq/tests_unit/tests_approximators/test_sampling.py deleted file mode 100644 index fa5167ae1..000000000 --- a/tests/shapiq/tests_unit/tests_approximators/test_sampling.py +++ /dev/null @@ -1,176 +0,0 @@ -"""This test module contains all tests for the CoalitionSampler class.""" - -from __future__ import annotations - -import numpy as np -import pytest - -from shapiq.approximator.sampling import CoalitionSampler - - -@pytest.mark.parametrize("n_players", [5, 10, 50]) -@pytest.mark.parametrize("budget", [10, 100]) -def test_basic_functionality(n_players, budget): - """This test checks the basic functionality of the CoalitionSampler class.""" - n = n_players - expected_budget = min(budget, 2**n) - - # test init and default params - uniform_sampling_weights = np.ones(n + 1) / (n + 1) # only empty and full should be complete - sampler = CoalitionSampler(n, uniform_sampling_weights) - assert sampler.n == n - assert np.isclose(sampler._sampling_weights, uniform_sampling_weights).all() - assert sampler.pairing_trick is False # default to False - assert len(sampler.coalitions_matrix) == 0 - assert len(sampler.coalitions_counter) == 0 - assert len(sampler.coalitions_probability) == 0 - assert sampler.n_max_coalitions == 2**n - assert sampler.n_coalitions == 0 - assert sampler.empty_coalition_index is None - - # test sampling - sampler.sample(budget) - - # test for correct shape and values - assert sampler.coalitions_matrix.shape[0] == expected_budget - assert sampler.coalitions_counter.shape[0] == expected_budget - assert sampler.coalitions_probability.shape[0] == expected_budget - assert sampler.n_coalitions == expected_budget - index_empty = np.where(np.sum(sampler.coalitions_matrix, axis=1) == 0)[0][0] # all rows zero - assert sampler.empty_coalition_index == index_empty - assert len(sampler.coalitions_size) == expected_budget - - # check for correct data types in properties - assert sampler.is_coalition_size_sampled.dtype == bool - assert sampler.is_coalition_sampled.dtype == bool - assert sampler.sampling_adjustment_weights.dtype == float - assert sampler.sampling_size_probabilities.dtype == float - assert sampler.coalitions_probability.dtype == float - assert sampler.coalitions_size_probability.dtype == float - assert sampler.coalitions_in_size_probability.dtype == float - - # check for error if sampling budget is less than two (empty and full) - with pytest.raises(ValueError): - sampler.sample(1) - - # test with pairing - sampler = CoalitionSampler(n, uniform_sampling_weights, pairing_trick=True) - assert sampler.pairing_trick is True - sampler.sample(budget) - assert sampler.coalitions_matrix.shape[0] == expected_budget - assert sampler.coalitions_counter.shape[0] == expected_budget - assert sampler.coalitions_probability.shape[0] == expected_budget - assert sampler.n_coalitions == expected_budget - - # test for asymmetric sampling weights and pairing trick - asymmetric_sampling_weights = np.ones(n + 1) / (n + 1) - asymmetric_sampling_weights[1] = 0.5 - with pytest.warns(UserWarning): - _ = CoalitionSampler(n, asymmetric_sampling_weights, pairing_trick=True) - - # test for negative sampling weights - negative_sampling_weights = np.ones(n + 1) / (n + 1) - negative_sampling_weights[1] = -0.5 - with pytest.raises(ValueError): - _ = CoalitionSampler(n, negative_sampling_weights) - - # test for mismatch in player number and sampling weights - with pytest.raises(ValueError): - _ = CoalitionSampler(n, np.ones(n)) - - # test double sampling - n_first = expected_budget - n_second = expected_budget - 5 - sampler = CoalitionSampler(n, uniform_sampling_weights, pairing_trick=True) - sampler.sample(n_first) - assert sampler.n_coalitions == n_first - sampler.sample(n_second) - assert sampler.n_coalitions == n_second - - -def test_user_warning_stalling(): - """This test checks the warning for sketchy budgets in the CoalitionSampler class.""" - n = 5 - uniform_sampling_weights = np.ones(n + 1) / (n + 1) # only empty and full - - # test for warning with sketchy budget (stalling) - with pytest.warns(UserWarning): - sampler = CoalitionSampler(n, uniform_sampling_weights) - sampler.sample(2**n - 1) - - -def test_sampling(): - """This test checks the sampling functionality of the CoalitionSampler class.""" - for random_state in range(30): - rng = np.random.default_rng(seed=random_state) - - # setup variables for test - n = rng.integers(low=2, high=12) - budget = rng.integers(low=1, high=2**12) - sampling_weights = rng.random(size=n + 1) - excluded_size = rng.integers(0, high=2, size=n + 1) - sampling_weights[excluded_size] = 0 - sampling_weights[-2] = 0.5 # ensure one set size remains - - # run the sampler - sampler = CoalitionSampler( - n, - sampling_weights, - pairing_trick=False, - random_state=random_state, - ) - sampler.sample(budget) - - # get params from sampler - max_samples_in_sampler = min(sampler.n_max_coalitions, budget) - coalitions_matrix = sampler.coalitions_matrix - - # assert number of unique coalitions - n_unique_coals = np.unique(coalitions_matrix, axis=0).shape[0] - assert n_unique_coals == max_samples_in_sampler - - # assert that coalitions counter larger than sampling_budget - sampled_coalitions_counter = sampler.coalitions_counter - assert np.sum(sampled_coalitions_counter) >= max_samples_in_sampler - - # assert similar output with scaled sampling weights and similar random_state - sampling_weights_scaled = sampling_weights * 1.4 - sampler_scaled = CoalitionSampler( - n, - sampling_weights_scaled, - pairing_trick=False, - random_state=random_state, - ) - sampler_scaled.sample(budget) - coalitions_matrix_scaled = sampler_scaled.coalitions_matrix - assert np.allclose(coalitions_matrix, coalitions_matrix_scaled) # all equal - - # assert splitting of coalition sizes is correct - combined_sizes: list = ( - sampler._coalitions_to_sample - + sampler._coalitions_to_compute - + sampler._coalitions_to_exclude - ) - assert len(combined_sizes) == n + 1 - - # assert coalitions are excluded from sampling - for exclude_size in sampler._coalitions_to_exclude: - assert np.all(np.sum(coalitions_matrix, axis=1) != exclude_size) - - # assert weights are equal to one for fully computed subset sizes - for compute_size in sampler._coalitions_to_compute: - assert np.all( - sampler.coalitions_probability[ - np.where(np.sum(coalitions_matrix, axis=1) == compute_size) - ] - == 1, - ) - - # assert weights are less than one for sampled subsets - for sample_size in sampler._coalitions_to_sample: - assert np.all( - sampler.coalitions_probability[ - np.where(np.sum(coalitions_matrix, axis=1) == sample_size) - ] - < 1, - ) diff --git a/tests/shapiq/tests_unit/tests_datasets/__init__.py b/tests/shapiq/tests_unit/tests_datasets/__init__.py deleted file mode 100644 index 4b25344af..000000000 --- a/tests/shapiq/tests_unit/tests_datasets/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Tests for the datasets module.""" diff --git a/tests/shapiq/tests_unit/tests_datasets/test_all.py b/tests/shapiq/tests_unit/tests_datasets/test_all.py deleted file mode 100644 index 4c023ddc4..000000000 --- a/tests/shapiq/tests_unit/tests_datasets/test_all.py +++ /dev/null @@ -1,41 +0,0 @@ -"""This test module contains the tests for all datasets.""" - -from __future__ import annotations - -import numpy as np -from pandas import DataFrame, Series - -from shapiq.datasets import load_adult_census, load_bike_sharing, load_california_housing - - -def test_load_bike(): - """Test loading the Bike Sharing dataset.""" - x_data, y_data = load_bike_sharing() - assert isinstance(x_data, DataFrame) - assert isinstance(y_data, Series) - - x_data, y_data = load_bike_sharing(to_numpy=True) - assert isinstance(x_data, np.ndarray) - assert isinstance(y_data, np.ndarray) - - -def test_load_adult_census(): - """Test loading the Adult Census dataset.""" - x_data, y_data = load_adult_census() - assert isinstance(x_data, DataFrame) - assert isinstance(y_data, Series) - - x_data, y_data = load_adult_census(to_numpy=True) - assert isinstance(x_data, np.ndarray) - assert isinstance(y_data, np.ndarray) - - -def test_load_california_housing(): - """Test loading the California housing dataset.""" - x_data, y_data = load_california_housing() - assert isinstance(x_data, DataFrame) - assert isinstance(y_data, Series) - - x_data, y_data = load_california_housing(to_numpy=True) - assert isinstance(x_data, np.ndarray) - assert isinstance(y_data, np.ndarray) diff --git a/tests/shapiq/tests_unit/tests_explainer/__init__.py b/tests/shapiq/tests_unit/tests_explainer/__init__.py deleted file mode 100644 index 3c7bf4927..000000000 --- a/tests/shapiq/tests_unit/tests_explainer/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Tests for the explainer module.""" diff --git a/tests/shapiq/tests_unit/tests_explainer/test_agnostic_explainer.py b/tests/shapiq/tests_unit/tests_explainer/test_agnostic_explainer.py deleted file mode 100644 index da959df08..000000000 --- a/tests/shapiq/tests_unit/tests_explainer/test_agnostic_explainer.py +++ /dev/null @@ -1,186 +0,0 @@ -"""Unit tests for the AgnosticExplainer class.""" - -from __future__ import annotations - -from typing import TYPE_CHECKING, get_args - -import pytest - -from shapiq import InteractionValues, MarginalImputer -from shapiq.explainer.agnostic import AgnosticExplainer, AgnosticExplainerIndices -from shapiq.explainer.base import Explainer -from shapiq_games.synthetic import DummyGame, RandomGame - -if TYPE_CHECKING: - import numpy as np - - from shapiq.typing import IndexType - - -@pytest.mark.parametrize("index", get_args(AgnosticExplainerIndices)) -def test_initialize_agnostic_explainer(index: IndexType) -> None: - """Test the initialization of the AgnosticExplainer.""" - game = DummyGame(n=5, interaction=(1, 2)) - explainer = AgnosticExplainer( - game=game, - index=index, - max_order=2, - random_state=42, - ) - assert isinstance(explainer, AgnosticExplainer) - assert isinstance(explainer, Explainer) - - -def test_compute_interactions() -> None: - """Test the computation of interactions using the AgnosticExplainer.""" - game = DummyGame(n=5, interaction=(1, 2)) - explainer = AgnosticExplainer( - game=game, - index="k-SII", - max_order=2, - random_state=42, - ) - - # Compute interaction values - iv = explainer.explain(budget=2**game.n_players) - - assert isinstance(iv, InteractionValues) - assert iv.index == "k-SII" - assert iv.max_order == 2 - - -def test_compute_interactions_with_x(dt_reg_model, background_reg_data) -> None: - """Test the computation of interactions with a specific input.""" - - imputer = MarginalImputer( - model=dt_reg_model.predict, - data=background_reg_data, - random_state=42, - ) - x_explain = background_reg_data[0] - - explainer = AgnosticExplainer( - game=imputer, - index="k-SII", - max_order=2, - random_state=42, - ) - - iv = explainer.explain(x_explain, budget=2**imputer.n_players) - - assert isinstance(iv, InteractionValues) - assert iv.index == "k-SII" - assert iv.max_order == 2 - - -def test_compute_random_seed_init(dt_reg_model, background_reg_data) -> None: - """Test the computation of interactions with a specific random seed.""" - imputer = MarginalImputer( - model=dt_reg_model.predict, - data=background_reg_data, - random_state=42, - x=background_reg_data[0], - ) - - explainer = AgnosticExplainer( - game=imputer, - index="k-SII", - max_order=2, - random_state=42, - ) - - iv1 = explainer.explain(budget=10) - - explainer_random = AgnosticExplainer( - game=imputer, - index="k-SII", - max_order=2, - random_state=42, - ) - - iv2 = explainer_random.explain(budget=10) - - assert iv1 == iv2 # Ensure that the results are consistent with the same random seed - - explainer_third = AgnosticExplainer( - game=imputer, - index="k-SII", - max_order=2, - random_state=43, # Different random seed - ) - - iv3 = explainer_third.explain(budget=10) - - assert iv1 != iv3 # Ensure that the results differ with a different random seed - - -def test_compute_random_seed_in_function_call(dt_reg_model, background_reg_data) -> None: - """Test the computation of interactions with a specific random seed in function call.""" - imputer = MarginalImputer( - model=dt_reg_model.predict, - data=background_reg_data, - random_state=42, - x=background_reg_data[0], - ) - - explainer = AgnosticExplainer( - game=imputer, - index="k-SII", - max_order=2, - random_state=None, - ) - - iv1 = explainer.explain(budget=10, random_state=42) - iv2 = explainer.explain(budget=10, random_state=42) - - assert iv1 == iv2 # Ensure that the results are consistent with the same random seed - - explainer_third = AgnosticExplainer(game=imputer, index="k-SII", max_order=2, random_state=None) - - iv3 = explainer_third.explain(budget=10, random_state=43) # Different random seed - iv4 = explainer_third.explain(budget=10, random_state=43) - - assert iv3 == iv4 # Ensure that the results are consistent with the same random seed - assert iv1 != iv3 # Ensure that the results differ with a different random seed - - -def test_with_callable(): - """Test the AgnosticExplainer with a callable game.""" - game_one = RandomGame(n=5, random_state=42) - - def callable_game(coalitions: np.ndarray) -> np.ndarray: - return game_one(coalitions) - - explainer = AgnosticExplainer( - game=callable_game, - index="k-SII", - max_order=2, - random_state=42, - n_players=game_one.n_players, - ) - - iv1 = explainer.explain(budget=2**game_one.n_players) - - game_two = RandomGame(n=5, random_state=42) - explainer_game = AgnosticExplainer( - game=game_two, index="k-SII", max_order=2, random_state=42, n_players=game_two.n_players - ) - iv2 = explainer_game.explain(budget=2**game_two.n_players) - assert iv1 == iv2 # Ensure that the results are consistent with the callable and game instance - - -def test_raise_error_n_players_not_specified() -> None: - """Test that an error is raised if the number of players is not specified.""" - - game = DummyGame(n=5, interaction=(1, 2)) - - def callable_game(coalitions: np.ndarray) -> np.ndarray: - return game(coalitions) - - with pytest.raises(ValueError): - AgnosticExplainer( - game=callable_game, - index="k-SII", - max_order=2, - n_players=None, # n_players not specified - ) diff --git a/tests/shapiq/tests_unit/tests_explainer/test_configuration.py b/tests/shapiq/tests_unit/tests_explainer/test_configuration.py deleted file mode 100644 index d0fca9250..000000000 --- a/tests/shapiq/tests_unit/tests_explainer/test_configuration.py +++ /dev/null @@ -1,146 +0,0 @@ -"""Tests the configuration module for the explainer.""" - -from __future__ import annotations - -from typing import get_args - -import pytest - -from shapiq.approximator import ( - SVARMIQ, - KernelSHAP, - KernelSHAPIQ, - RegressionFBII, - RegressionFSII, -) -from shapiq.explainer.configuration import ValidApproximatorTypes - - -class TestAutomaticSelection: - """Tests the automatic selection of approximators based on indices and orders.""" - - def test_choosing_of_spex(self): - """Tests if SPEX is chosen appropriately for large max_order.""" - from shapiq.explainer.configuration import choose_spex - - n_players = list(range(101)) # from 0 to 100 players - orders = [0, 1, 2, 3, 4, 5, 6, 7, 8] - - for order in orders: - for n in n_players: - use_spex = choose_spex(n_players=n, max_order=order) - # check if SPEX is chosen correctly - if order <= 1 or n <= 16: - assert not use_spex - elif ( - (order > 1 and n > 64) - or (order == 3 and n > 32) - or (order == 4 and n > 16) - or (order > 4 and n > 16) - ): - assert use_spex - else: - assert not use_spex, ( - f"Unexpected SPEX choice for n_players={n}, max_order={order}." - ) - - @pytest.mark.parametrize( - "index, order, n_players, expected_approx", - [ - # SV correctly uses KernelSHAP - ("SV", 1, 10, KernelSHAP), - ("SV", 1, 101, KernelSHAP), - ("SII", 1, 10, KernelSHAP), - ("k-SII", 1, 10, KernelSHAP), - ("FSII", 1, 10, KernelSHAP), - ("STII", 1, 10, KernelSHAP), - ("SV", 2, 10, KernelSHAP), # SV is selected even if max_order > 1 - # BV correctly uses RegressionFBII - ("BV", 1, 10, RegressionFBII), - ("BV", 1, 101, RegressionFBII), - ("BV", 2, 10, RegressionFBII), # BV is selected even if max_order > 1 - # RegressionFSII is selected correctly - ("FSII", 2, 10, RegressionFSII), - ("FSII", 3, 10, RegressionFSII), - # RegressionFBII is selected correctly - ("FBII", 2, 10, RegressionFBII), - ("FBII", 3, 10, RegressionFBII), - # KernelSHAPIQ is selected correctly - ("SII", 2, 10, KernelSHAPIQ), - ("k-SII", 2, 10, KernelSHAPIQ), - ("SII", 3, 10, KernelSHAPIQ), - ("k-SII", 3, 10, KernelSHAPIQ), - # we omit SPEX since it takes a longer time - # test SVARMIQ - ("STII", 2, 10, SVARMIQ), - ("STII", 3, 10, SVARMIQ), - ], - ) - def test_setup_approximator_automatically(self, index, order, n_players, expected_approx): - """Checks if the automatic setup of the approximator works correctly.""" - from shapiq.explainer.configuration import setup_approximator_automatically - - approx = setup_approximator_automatically(index=index, max_order=order, n_players=n_players) - assert isinstance(approx, expected_approx) - - -class TestSetupApproximator: - """Tests the setup of the approximator with different configurations.""" - - def test_setup_approximator_with_existing_approx(self): - """Tests if the setup of the approximator with an existing approximator returns the instance.""" - from shapiq.explainer.configuration import setup_approximator - - approx = KernelSHAP(n=10) - approx_r = setup_approximator(approximator=approx, index="SV", max_order=1, n_players=10) - assert approx_r is approx, ( - "The returned approximator should be the same as the input approximator." - ) - - def test_setup_approximator_with_auto(self): - """Tests if the setup of the approximator with 'auto' returns an approximator instance.""" - from shapiq.approximator.base import Approximator - from shapiq.explainer.configuration import setup_approximator - - approx = setup_approximator(approximator="auto", index="SV", max_order=1, n_players=10) - assert isinstance(approx, Approximator) - - @pytest.mark.parametrize("approx_name", list(get_args(ValidApproximatorTypes))) - def test_setup_approximator_from_string(self, approx_name: ValidApproximatorTypes): - """Tests if the setup of the approximator from a string returns an instance of the correct type.""" - from shapiq.explainer.configuration import APPROXIMATOR_CONFIGURATIONS, setup_approximator - - available_indices = APPROXIMATOR_CONFIGURATIONS[approx_name].keys() - for index in available_indices: - order = 1 if index in ["SV", "BV"] else 2 - approx_class = APPROXIMATOR_CONFIGURATIONS[approx_name][index] - approx = setup_approximator( - approximator=approx_name, index=index, max_order=order, n_players=10 - ) - assert isinstance(approx, approx_class), ( - f"Expected {approx_class} for {approx_name} with index {index}, " - f"but got {type(approx_class)}." - ) - - -class TestErrorCases: - """Tests for error cases for the setup_approximator function.""" - - def test_setup_approximator_with_invalid_approximator(self): - """Tests that an error is raised when an invalid approximator is passed.""" - from shapiq.explainer.configuration import setup_approximator - - with pytest.raises(ValueError, match="Invalid approximator `invalid`."): - setup_approximator(approximator="invalid", index="SV", max_order=1, n_players=10) - - def test_setup_approximator_with_invalid_class_as_approx(self): - """Tests that an error is raised when an invalid class is passed as approximator.""" - from shapiq.explainer.configuration import setup_approximator - - class InvalidApproximator: - pass - - with pytest.raises(TypeError, match="Invalid approximator "): - setup_approximator( - approximator=InvalidApproximator, index="SV", max_order=1, n_players=10 - ) diff --git a/tests/shapiq/tests_unit/tests_explainer/test_explainer_base_functionality.py b/tests/shapiq/tests_unit/tests_explainer/test_explainer_base_functionality.py deleted file mode 100644 index 3fb51e3a5..000000000 --- a/tests/shapiq/tests_unit/tests_explainer/test_explainer_base_functionality.py +++ /dev/null @@ -1,13 +0,0 @@ -"""This module tests the base functionality of the explainer class.""" - -from __future__ import annotations - -import pytest - -from shapiq import Explainer - - -def test_explainer(): - """Tests if the attributes and properties of explainers are set correctly.""" - with pytest.raises(TypeError): - Explainer() diff --git a/tests/shapiq/tests_unit/tests_explainer/test_explainer_models.py b/tests/shapiq/tests_unit/tests_explainer/test_explainer_models.py deleted file mode 100644 index 4131ff847..000000000 --- a/tests/shapiq/tests_unit/tests_explainer/test_explainer_models.py +++ /dev/null @@ -1,254 +0,0 @@ -"""This test module contains tests for the Tabular explainer module given differnt model types.""" - -from __future__ import annotations - -import pytest - -from shapiq import InteractionValues -from shapiq.explainer import Explainer, TabularExplainer, TreeExplainer -from tests.shapiq.fixtures.data import BUDGET_NR_FEATURES - - -def test_torch_reg(torch_reg_model, background_reg_data): - """Test the explainer with basic torch regression model.""" - import torch - - x_explain = background_reg_data[0] - x_explain_tensor = torch.tensor(x_explain, dtype=torch.float32).reshape(1, -1) - prediction = torch_reg_model(x_explain_tensor).detach().numpy()[0] - - explainer = Explainer(model=torch_reg_model, data=background_reg_data) - values = explainer.explain(x_explain, budget=BUDGET_NR_FEATURES) - assert isinstance(values, InteractionValues) - sum_of_values = sum(values.values) - assert prediction == pytest.approx(sum_of_values, rel=0.01) - - -def test_torch_clf(torch_clf_model, background_clf_data): - """Test the explainer with basic torch classification model.""" - import torch - - x_explain = background_clf_data[0] - x_explain_tensor = torch.tensor(x_explain, dtype=torch.float32).reshape(1, -1) - prediction = torch_clf_model(x_explain_tensor).detach().numpy()[0] - - explainer = Explainer(model=torch_clf_model, data=background_clf_data, class_index=2) - values = explainer.explain(x_explain, budget=BUDGET_NR_FEATURES) - assert isinstance(values, InteractionValues) - sum_of_values = sum(values.values) - assert prediction[2] == pytest.approx(sum_of_values, rel=0.001) - - explainer = Explainer(model=torch_clf_model, data=background_clf_data, class_index=0) - values = explainer.explain(x_explain, budget=BUDGET_NR_FEATURES) - assert isinstance(values, InteractionValues) - sum_of_values = sum(values.values) - assert prediction[0] == pytest.approx(sum_of_values, rel=0.001) - - -def test_sklearn_clf_tree(dt_clf_model, background_clf_data): - """Test the explainer with a basic sklearn decision tree classification model.""" - x_explain = background_clf_data[0] - prediction = dt_clf_model.predict_proba(x_explain.reshape(1, -1))[0] - - explainer = TabularExplainer(model=dt_clf_model, data=background_clf_data, class_index=2) - values = explainer.explain(x_explain, budget=BUDGET_NR_FEATURES) - assert isinstance(values, InteractionValues) - sum_of_values = sum(values.values) - assert prediction[2] == pytest.approx(sum_of_values, abs=0.001) - - explainer = TabularExplainer(model=dt_clf_model, data=background_clf_data, class_index=0) - values = explainer.explain(x_explain, budget=BUDGET_NR_FEATURES) - assert isinstance(values, InteractionValues) - sum_of_values = sum(values.values) - assert prediction[0] == pytest.approx(sum_of_values, abs=0.001) - - # do the same with the bare explainer (only for class_label=2) - explainer = Explainer(model=dt_clf_model, data=background_clf_data, class_index=2) - assert isinstance(explainer, TreeExplainer) # check explainer to be a TreeExplainer - values = explainer.explain(x_explain, budget=BUDGET_NR_FEATURES) - assert isinstance(values, InteractionValues) - sum_of_values = sum(values.values) - assert prediction[2] == pytest.approx(sum_of_values, abs=0.001) - - -def test_sklearn_reg_tree(dt_reg_model, background_reg_data): - """Test the explainer with a basic sklearn decision tree regression model.""" - x_explain = background_reg_data[0] - prediction = dt_reg_model.predict(x_explain.reshape(1, -1))[0] - - explainer = TabularExplainer(model=dt_reg_model, data=background_reg_data) - values = explainer.explain(x_explain, budget=BUDGET_NR_FEATURES) - assert isinstance(values, InteractionValues) - sum_of_values = sum(values.values) - assert prediction == pytest.approx(sum_of_values, abs=0.001) - - # do the same with the bare explainer - explainer = Explainer(model=dt_reg_model, data=background_reg_data) - assert isinstance(explainer, TreeExplainer) # check explainer to be a TreeExplainer - values = explainer.explain(x_explain, budget=BUDGET_NR_FEATURES) - assert isinstance(values, InteractionValues) - sum_of_values = sum(values.values) - assert prediction == pytest.approx(sum_of_values, abs=0.001) - - -def test_sklearn_clf_forest(rf_clf_model, background_clf_data): - """Test the explainer with a basic sklearn classification model.""" - x_explain = background_clf_data[0] - prediction = rf_clf_model.predict_proba(x_explain.reshape(1, -1))[0] - - explainer = TabularExplainer(model=rf_clf_model, data=background_clf_data, class_index=2) - values = explainer.explain(x_explain, budget=BUDGET_NR_FEATURES) - assert isinstance(values, InteractionValues) - sum_of_values = sum(values.values) - assert prediction[2] == pytest.approx(sum_of_values, rel=0.001) - - explainer = TabularExplainer(model=rf_clf_model, data=background_clf_data, class_index=0) - values = explainer.explain(x_explain, budget=BUDGET_NR_FEATURES) - assert isinstance(values, InteractionValues) - sum_of_values = sum(values.values) - assert prediction[0] == pytest.approx(sum_of_values, rel=0.001) - - # do the same with the bare explainer (only for class_label=2) - explainer = Explainer(model=rf_clf_model, data=background_clf_data, class_index=2) - values = explainer.explain(x_explain, budget=BUDGET_NR_FEATURES) - assert isinstance(values, InteractionValues) - sum_of_values = sum(values.values) - assert prediction[2] == pytest.approx(sum_of_values, rel=0.001) - - -def test_sklearn_reg_forest(rf_reg_model, background_reg_data): - """Test the explainer with a basic sklearn regression model.""" - x_explain = background_reg_data[0] - prediction = rf_reg_model.predict(x_explain.reshape(1, -1))[0] - - explainer = TabularExplainer(model=rf_reg_model, data=background_reg_data) - values = explainer.explain(x_explain, budget=BUDGET_NR_FEATURES) - assert isinstance(values, InteractionValues) - sum_of_values = sum(values.values) - assert prediction == pytest.approx(sum_of_values) - - # do the same with the bare explainer - explainer = Explainer(model=rf_reg_model, data=background_reg_data) - values = explainer.explain(x_explain, budget=BUDGET_NR_FEATURES) - assert isinstance(values, InteractionValues) - sum_of_values = sum(values.values) - assert prediction == pytest.approx(sum_of_values, rel=0.01) - - -def test_sklearn_clf_logistic_regression(lr_clf_model, background_clf_data): - """Test the explainer with a basic sklearn logistic regression model.""" - x_explain = background_clf_data[0] - prediction = lr_clf_model.predict_proba(x_explain.reshape(1, -1))[0] - - explainer = TabularExplainer(model=lr_clf_model, data=background_clf_data, class_index=2) - values = explainer.explain(x_explain, budget=BUDGET_NR_FEATURES) - assert isinstance(values, InteractionValues) - sum_of_values = sum(values.values) - assert prediction[2] == pytest.approx(sum_of_values) - - explainer = TabularExplainer(model=lr_clf_model, data=background_clf_data, class_index=0) - values = explainer.explain(x_explain, budget=BUDGET_NR_FEATURES) - assert isinstance(values, InteractionValues) - sum_of_values = sum(values.values) - assert prediction[0] == pytest.approx(sum_of_values) - - # do the same with the bare explainer (only for class_label=2) - explainer = Explainer(model=lr_clf_model, data=background_clf_data, class_index=2) - values = explainer.explain(x_explain, budget=BUDGET_NR_FEATURES) - assert isinstance(values, InteractionValues) - sum_of_values = sum(values.values) - assert prediction[2] == pytest.approx(sum_of_values) - - -def test_sklearn_reg_linear_regression(lr_reg_model, background_reg_data): - """Test the explainer with a basic sklearn linear regression model.""" - x_explain = background_reg_data[0] - prediction = lr_reg_model.predict(x_explain.reshape(1, -1))[0] - - explainer = TabularExplainer(model=lr_reg_model, data=background_reg_data) - values = explainer.explain(x_explain, budget=BUDGET_NR_FEATURES) - assert isinstance(values, InteractionValues) - sum_of_values = sum(values.values) - assert prediction == pytest.approx(sum_of_values) - - # do the same with the bare explainer - explainer = Explainer(model=lr_reg_model, data=background_reg_data) - values = explainer.explain(x_explain, budget=BUDGET_NR_FEATURES) - assert isinstance(values, InteractionValues) - sum_of_values = sum(values.values) - assert prediction == pytest.approx(sum_of_values) - - -def test_lightgbm_reg(lightgbm_reg_model, background_reg_data): - """Test the explainer with a basic lightgbm regression model.""" - x_explain = background_reg_data[0] - prediction = lightgbm_reg_model.predict(x_explain.reshape(1, -1))[0] - - explainer = TabularExplainer(model=lightgbm_reg_model, data=background_reg_data) - values = explainer.explain(x_explain, budget=BUDGET_NR_FEATURES) - - assert isinstance(values, InteractionValues) - sum_of_values = sum(values.values) - assert prediction == pytest.approx(sum_of_values) - - # do the same with the bare explainer - explainer = Explainer(model=lightgbm_reg_model, data=background_reg_data) - assert isinstance(explainer, TreeExplainer) # check explainer to be a TreeExplainer - values = explainer.explain(x_explain, budget=BUDGET_NR_FEATURES) - - assert isinstance(values, InteractionValues) - sum_of_values = sum(values.values) - assert prediction == pytest.approx(sum_of_values) - - -def test_lightgbm_clf(lightgbm_clf_model, background_clf_data): - """Test the explainer with a basic lightgbm classification model.""" - x_explain = background_clf_data[0] - prediction = lightgbm_clf_model.predict_proba(x_explain.reshape(1, -1))[0] - - explainer = TabularExplainer(model=lightgbm_clf_model, data=background_clf_data, class_index=2) - values = explainer.explain(x_explain, budget=BUDGET_NR_FEATURES) - - assert isinstance(values, InteractionValues) - sum_of_values = sum(values.values) - assert prediction[2] == pytest.approx(sum_of_values, rel=0.001) - - explainer = TabularExplainer(model=lightgbm_clf_model, data=background_clf_data, class_index=0) - values = explainer.explain(x_explain, budget=BUDGET_NR_FEATURES) - - assert isinstance(values, InteractionValues) - sum_of_values = sum(values.values) - assert prediction[0] == pytest.approx(sum_of_values, rel=0.001) - - # do the same with the bare explainer (only for class_label=2) - explainer = Explainer(model=lightgbm_clf_model, data=background_clf_data, class_index=2) - assert isinstance(explainer, TreeExplainer) # check explainer to be a TreeExplainer - values = explainer.explain(x_explain, budget=BUDGET_NR_FEATURES) - - assert isinstance(values, InteractionValues) - # note we do not check for efficiency here as the explanations are in log-odds space and - # it is not straightforward to compare them with the probabilities from the model - # https://github.com/shap/shap/issues/963 - - -def test_isoforest_clf(if_clf_model, if_clf_dataset): - """Test the explainer with a basic isolation forest classification model.""" - x_data = if_clf_dataset[0] - - x_explain = x_data[0] - prediction = if_clf_model.predict(x_explain.reshape(1, -1))[0] - - explainer = TabularExplainer(model=if_clf_model, data=x_data, class_index=2) - values = explainer.explain(x_explain, budget=BUDGET_NR_FEATURES) - - assert isinstance(values, InteractionValues) - sum_of_values = sum(values.values) - assert pytest.approx(sum_of_values, abs=0.001) == prediction - - # do the same with the bare explainer - explainer = Explainer(model=if_clf_model, data=x_data, class_index=2) - assert isinstance(explainer, TreeExplainer) # check explainer to be a TreeExplainer - values = explainer.explain(x_explain, budget=BUDGET_NR_FEATURES) - - assert isinstance(values, InteractionValues) - # tree explainer explains a bit differently than the tabular explainer so we do not compare the values diff --git a/tests/shapiq/tests_unit/tests_explainer/test_explainer_tabpfn.py b/tests/shapiq/tests_unit/tests_explainer/test_explainer_tabpfn.py deleted file mode 100644 index 4156cc0a4..000000000 --- a/tests/shapiq/tests_unit/tests_explainer/test_explainer_tabpfn.py +++ /dev/null @@ -1,116 +0,0 @@ -"""This test module tests the TabPFNExplainer object.""" - -from __future__ import annotations - -import pytest - -from shapiq import Explainer, InteractionValues, TabPFNExplainer, TabularExplainer -from tests.shapiq.fixtures.data import BUDGET_NR_FEATURES_SMALL -from tests.shapiq.markers import skip_if_no_tabpfn - - -@skip_if_no_tabpfn -@pytest.mark.external_libraries -class TestTabPFNExplainer: - """Tests for the TabPFNExplainer class.""" - - def test_tabpfn_explainer_clf(self, tabpfn_classification_problem): - """Test the TabPFNExplainer class for classification problems.""" - import tabpfn - - # setup - model, data, labels, x_test = tabpfn_classification_problem - x_explain = x_test[0] - assert isinstance(model, tabpfn.TabPFNClassifier) - if model.n_features_in_ == data.shape[1]: - model.fit(data, labels) - assert model.n_features_in_ == data.shape[1] - - explainer = TabPFNExplainer(model=model, data=data, labels=labels, x_test=x_test) - explanation = explainer.explain(x=x_explain, budget=BUDGET_NR_FEATURES_SMALL) - assert isinstance(explanation, InteractionValues) - - # test that bare explainer gets turned into TabPFNExplainer - explainer = Explainer(model=model, data=data, labels=labels, x_test=x_test) - assert isinstance(explainer, TabPFNExplainer) - - # test that TabularExplainer works as well - with pytest.warns(UserWarning): - explainer = TabularExplainer(model=model, data=data, class_index=1, imputer="baseline") - assert isinstance(explainer, TabularExplainer) - - def test_tabpfn_explainer_reg(self, tabpfn_regression_problem): - """Test the TabPFNExplainer class for regression problems.""" - import tabpfn - - # setup - model, data, labels, x_test = tabpfn_regression_problem - x_explain = x_test[0] - assert isinstance(model, tabpfn.TabPFNRegressor) - if model.n_features_in_ == data.shape[1]: - model.fit(data, labels) - assert model.n_features_in_ == data.shape[1] - - explainer = TabPFNExplainer(model=model, data=data, labels=labels, x_test=x_test) - explanation = explainer.explain(x=x_explain, budget=BUDGET_NR_FEATURES_SMALL) - assert isinstance(explanation, InteractionValues) - - # test that bare explainer gets turned into TabPFNExplainer - explainer = Explainer(model=model, data=data, labels=labels, x_test=x_test) - assert isinstance(explainer, TabPFNExplainer) - - def test_tabpfn_bare_explainer(self, tabpfn_classification_problem, tabpfn_regression_problem): - """Test that the TabPFNExplainer can be initialized without data and labels.""" - - def _run_test(problem): - """Helper function to run the test.""" - model, data, labels, x_test = problem - explainer = Explainer(model=model, data=data, labels=labels, x_test=x_test) - assert isinstance(explainer, TabPFNExplainer) - - # test that TabularExplainer works as well - with pytest.warns(UserWarning): - explainer = TabularExplainer( - model=model, data=data, class_index=1, imputer="baseline" - ) - assert isinstance(explainer, TabularExplainer) - - _run_test(tabpfn_regression_problem) - _run_test(tabpfn_classification_problem) - - def test_tabpfn_user_warning(self, tabpfn_regression_problem, tabpfn_classification_problem): - """Test that the TabularExplainer can be used with TabPFN models but raises a UserWarning.""" - - def _run_test(problem): - """Helper function to run the test.""" - model, data, _, _ = problem - with pytest.warns(UserWarning): - explainer = TabularExplainer( - model=model, data=data, class_index=1, imputer="baseline" - ) - assert isinstance(explainer, TabularExplainer) - - _run_test(tabpfn_regression_problem) - _run_test(tabpfn_regression_problem) - - -@skip_if_no_tabpfn -@pytest.mark.external_libraries -class TestTabPFNExplainerBugFixes: - """Tests for bug fixes conducted in the TabPFNExplainer.""" - - def test_after_explanation_prediction(self, tabpfn_regression_problem): - """Tests that the model can be used for prediction after explanation. - - This bug was raised in issue [#396](https://github.com/mmschlk/shapiq/issues/396) - """ - model, data, labels, x_test = tabpfn_regression_problem - x_explain = x_test[0] - - _ = model.predict(x_explain.reshape(1, -1)) - - explainer = TabPFNExplainer(model=model, data=data, labels=labels, x_test=x_test) - explainer.explain(x=x_explain, budget=3) - assert model.n_features_in_ == data.shape[1] - - model.predict(x_explain.reshape(1, -1)) # should not raise an error diff --git a/tests/shapiq/tests_unit/tests_explainer/test_explainer_tabular.py b/tests/shapiq/tests_unit/tests_explainer/test_explainer_tabular.py deleted file mode 100644 index 135cc01b7..000000000 --- a/tests/shapiq/tests_unit/tests_explainer/test_explainer_tabular.py +++ /dev/null @@ -1,253 +0,0 @@ -"""This test module contains all tests regarding the interaction explainer for the shapiq package.""" - -from __future__ import annotations - -from typing import get_args - -import numpy as np -import pytest - -from shapiq import InteractionValues -from shapiq.approximator import RegressionFSII -from shapiq.explainer.tabular import ( - TabularExplainer, - TabularExplainerApproximators, - TabularExplainerImputers, -) -from tests.shapiq.fixtures.data import BUDGET_NR_FEATURES -from tests.shapiq.utils import get_expected_index_or_skip - -MAX_ORDERS = [2, 3] - - -def test_auto_params(dt_reg_model, background_reg_data): - """Test the default parameters of the explainer.""" - model_function = dt_reg_model.predict - explainer = TabularExplainer( - model=model_function, - data=background_reg_data, - ) - assert explainer.index == "k-SII" - assert explainer.approximator.index == "k-SII" - assert explainer.max_order == 2 - assert explainer.approximator.__class__.__name__ == "KernelSHAPIQ" - - -def test_init_params_error_and_warning(dt_reg_model, background_reg_data): - """Test the initialization of the interaction explainer.""" - model_function = dt_reg_model.predict - with pytest.raises(ValueError): - TabularExplainer( - model=model_function, - data=background_reg_data, - index="invalid", - max_order=0, - ) - with pytest.warns(): - TabularExplainer( - model=model_function, - data=background_reg_data, - max_order=1, - index="k-SII", # not SV and order is 1 - ) - with pytest.warns(): - TabularExplainer( - model=model_function, - data=background_reg_data, - max_order=1, - index="FBII", # not BV and order is 1 - ) - with pytest.warns(): - TabularExplainer( - model=model_function, - data=background_reg_data, - index="SV", - max_order=2, # higher than 1 and index is SV or BV - ) - with pytest.warns(): - TabularExplainer( - model=model_function, - data=background_reg_data, - index="BV", - max_order=2, # higher than 1 and index is SV or BV - ) - - -def test_init_params_approx(dt_reg_model, background_reg_data): - """Test the initialization of the tabular explainer.""" - data = background_reg_data - model_function = dt_reg_model.predict - with pytest.raises(ValueError): - TabularExplainer( - model=model_function, - data=data, - approximator="invalid", - ) - explainer = TabularExplainer( - approximator="regression", - index="FSII", - model=model_function, - data=data, - ) - assert explainer.approximator.__class__.__name__ == "RegressionFSII" - - # init explainer with manual approximator - approximator = RegressionFSII(n=9, max_order=2) - explainer = TabularExplainer( - model=model_function, - data=data, - approximator=approximator, - ) - assert explainer.approximator.__class__.__name__ == "RegressionFSII" - assert explainer.approximator == approximator - - -@pytest.mark.parametrize("approximator", get_args(TabularExplainerApproximators)) -@pytest.mark.parametrize("max_order", [*MAX_ORDERS, 1]) -def test_init_params_approx_params(dt_reg_model, background_reg_data, approximator, max_order): - """Test the initialization of the tabular explainer.""" - explainer = TabularExplainer( - approximator=approximator, - model=dt_reg_model, - data=background_reg_data, - max_order=max_order, - ) - if approximator == "spex": - pytest.skip("Spex works only for larger datasets/budgets.") - iv = explainer.explain(background_reg_data[0], budget=BUDGET_NR_FEATURES) - assert isinstance(iv, InteractionValues) - - -BUDGETS = [2**5, 2**8, BUDGET_NR_FEATURES] - - -@pytest.mark.parametrize("budget", BUDGETS) -@pytest.mark.parametrize("max_order", MAX_ORDERS) -@pytest.mark.parametrize("imputer", get_args(TabularExplainerImputers)) -def test_explain(dt_reg_model, background_reg_data, budget, max_order, imputer): - """Test the initialization of the interaction explainer.""" - index = "FSII" - _ = get_expected_index_or_skip(index, max_order) - - model_function = dt_reg_model.predict - data = background_reg_data - explainer = TabularExplainer( - model=model_function, - data=data, - random_state=42, - index=index, - max_order=max_order, - approximator="auto", - imputer=imputer, - ) - x = data[0].reshape(1, -1) - interaction_values = explainer.explain(x, budget=budget) - assert interaction_values.index == index - assert interaction_values.max_order == max_order - assert interaction_values.estimation_budget <= budget + 2 - interaction_values0 = explainer.explain(x, budget=budget, random_state=0) - interaction_values2 = explainer.explain(x, budget=budget, random_state=0) - assert np.allclose( - interaction_values0.get_n_order_values(1), - interaction_values2.get_n_order_values(1), - ) - assert np.allclose( - interaction_values0.get_n_order_values(2), - interaction_values2.get_n_order_values(2), - ) - - # test for efficiency - prediction = float(model_function(x)[0]) - sum_of_values = float(np.sum(interaction_values.values)) - assert pytest.approx(interaction_values[()]) == interaction_values.baseline_value - assert pytest.approx(sum_of_values, 0.01) == prediction - - -def test_against_shap_linear(): - """Tests weather TabularExplainer yields similar results as SHAP with a basic linear model.""" - n_samples = 3 - dim = 5 - rng = np.random.default_rng(42) - - def make_linear_model(): - w = rng.normal(size=dim) - - def model(X: np.ndarray): - return np.dot(X, w) - - return model - - X = rng.normal(size=(n_samples, dim)) - model = make_linear_model() - # The following code is commented out because it requires SHAP to be installed. - """ - # import shap - # compute with shap - # explainer_shap = shap.explainers.Exact(model, X) - # shap_values = explainer_shap(X).values - # print(shap_values) - """ - shap_values = np.array( - [ - [-0.29565839, -0.36698085, -0.55970434, 0.22567077, 0.05852208], - [1.08513574, 0.06365536, 0.46312977, -0.61532757, 0.00370387], - [-0.78947735, 0.30332549, 0.09657457, 0.38965679, -0.06222595], - ], - ) - - # compute with shapiq - explainer_shapiq = TabularExplainer( - model=model, - data=X, - random_state=42, - index="SV", - max_order=1, - approximator="auto", - imputer="marginal", - ) - shapiq_values = explainer_shapiq.explain_X(X, budget=2**dim) - shapiq_values = np.array([values.get_n_order_values(1) for values in shapiq_values]) - - assert np.allclose(shap_values, shapiq_values, atol=1e-5) - - -def test_explain_X_progressbar(): - """Tests if the progress bar is shown when verbose is set to True.""" - n_samples = 3 - dim = 5 - rng = np.random.default_rng(42) - X = rng.normal(size=(n_samples, dim)) - - def model(X: np.ndarray): - return np.dot(X, np.ones(dim)) - - explainer = TabularExplainer( - model=model, - data=X, - random_state=42, - index="SV", - max_order=1, - ) - _ = explainer.explain_X(X, budget=2**dim, verbose=True) - _ = explainer.explain_X(X, budget=2**dim, verbose=False) - - -@pytest.mark.parametrize("approximator", get_args(TabularExplainerApproximators)) -def test_explain_sv(dt_reg_model, background_reg_data, approximator): - """Tests if init and compute works for SV for different estimators.""" - model_function = dt_reg_model.predict - data = background_reg_data - explainer = TabularExplainer( - model=model_function, - data=data, - random_state=42, - index="SV", - max_order=1, - approximator=approximator, - ) - x = data[0].reshape(1, -1) - if approximator == "spex": - pytest.skip("Spex works only for larger datasets/budgets.") - interaction_values = explainer.explain(x, budget=20) - assert interaction_values.index == "SV" - assert interaction_values.max_order == 1 diff --git a/tests/shapiq/tests_unit/tests_explainer/test_explainer_utils.py b/tests/shapiq/tests_unit/tests_explainer/test_explainer_utils.py deleted file mode 100644 index abd5d6d19..000000000 --- a/tests/shapiq/tests_unit/tests_explainer/test_explainer_utils.py +++ /dev/null @@ -1,155 +0,0 @@ -"""Tests for the utility functions in the explainer module.""" - -from __future__ import annotations - -import inspect -import sys -from typing import Any -from unittest.mock import Mock - -import numpy as np -import pytest - -from shapiq.explainer.utils import get_predict_function_and_model_type -from shapiq.tree.validation import SUPPORTED_MODELS -from tests.shapiq.conftest import ( - TABULAR_MODEL_FIXTURES, - TABULAR_TENSORFLOW_MODEL_FIXTURES, - TABULAR_TORCH_MODEL_FIXTURES, - TREE_MODEL_FIXTURES, -) # pyright: ignore[reportCallIssue] thinks is RuntimeError - - -def _utils_get_model(model, label, x_data): - predict_function, model_type = get_predict_function_and_model_type(model, label) - assert predict_function(model, x_data).ndim == 1 # pyright: ignore[reportCallIssue] thinks its RuntimeError - return predict_function, model_type - - -@pytest.mark.external_libraries -@pytest.mark.parametrize(("model_name", "label"), TABULAR_MODEL_FIXTURES) -def test_tabular_get_predict_function_and_model_type( - model_name, - label, - background_reg_dataset, - request, -): - """Tests whether the tabular model is recognized as a tabular model.""" - model = request.getfixturevalue(model_name) - x_data, y = background_reg_dataset - predict_function, model_type = _utils_get_model(model, label, x_data) - assert model_type == "tabular" - - if label == "custom_model": - assert np.all(predict_function(model, x_data) == y) # pyright: ignore[reportCallIssue] thinks its RuntimeError - - if label == "sklearn.linear_model.LinearRegression": - assert np.all(predict_function(model, x_data) == model.predict(x_data)) # pyright: ignore[reportCallIssue] thinks its RuntimeError - - -@pytest.mark.skipif( - not any(pkg in sys.modules for pkg in ["tensorflow"]), - reason="Tensorflow is not available.", -) -@pytest.mark.external_libraries -@pytest.mark.parametrize(("model_name", "label"), TABULAR_TENSORFLOW_MODEL_FIXTURES) -def test_tensorflow_get_predict_function_and_model_type( - model_name, - label, - background_reg_dataset, - request, -): - """Tests whether the tensorflow model is recognized as a tabular model.""" - model = request.getfixturevalue(model_name) - x_data, _ = background_reg_dataset - _predict_function, model_type = _utils_get_model(model, label, x_data) - assert model_type == "tabular" - - -@pytest.mark.external_libraries -@pytest.mark.parametrize(("model_name", "label"), TABULAR_TORCH_MODEL_FIXTURES) -def test_torch_get_predict_function_and_model_type( - model_name, - label, - background_reg_dataset, - request, -): - """Tests whether the torch model is recognized as a tabular model.""" - model = request.getfixturevalue(model_name) - x_data, _ = background_reg_dataset - _predict_function, model_type = _utils_get_model(model, label, x_data) - assert model_type == "tabular" - - -@pytest.mark.external_libraries -@pytest.mark.parametrize(("model_fixture", "model_class"), TREE_MODEL_FIXTURES) -def test_tree_get_predict_function_and_model_type( - model_fixture, - model_class, - background_reg_dataset, - request, -): - """Tests whether the tree model is recognized as a tree model.""" - model = request.getfixturevalue(model_fixture) - x_data, _y = background_reg_dataset - predict_function, model_type = _utils_get_model(model, model_class, x_data) - assert model_type == "tree" - - if model_class == "sklearn.tree.DecisionTreeRegressor": - assert np.all(predict_function(model, x_data) == model.predict(x_data)) # pyright: ignore[reportCallIssue] thinks its RuntimeError - - -def test_all_supported_tree_models_recognized(): - """Test that all supported tree models are recognized as tree models.""" - model = Mock() - for label in SUPPORTED_MODELS: - _predict_function, model_type = get_predict_function_and_model_type(model, label) - assert model_type == "tree" - - -def test_all_supported_product_kernel_models_recognized(): - """Test that all supported SVM models are recognized as product kernel models.""" - model = Mock() - svm_models = [ - "sklearn.svm.SVC", - "sklearn.svm.SVR", - "sklearn.gaussian_process.GaussianProcessRegressor", - ] - for label in svm_models: - _predict_function, model_type = get_predict_function_and_model_type(model, label) - assert model_type == "product_kernel" - - -class ModelWithFalseCall: - """A dummy model that has a __call__ method but does not match the expected signature.""" - - def __call__(self, string: str, double: float): - """A dummy call method that does not match the expected signature.""" - - -class NonCallableModel: - """A dummy model that does not implement a __call__ method.""" - - -def test_exceptions_get_predict_function_and_model_type(background_reg_data): - """Test the exceptions in get_predict_function_and_model_type.""" - # neither call nor predict functions - model_without_call = NonCallableModel() - with pytest.raises(TypeError): - _, _ = get_predict_function_and_model_type(model_without_call, "non_sense_model") - - -def test_class_index(): - """Test the class index in get_predict_function_and_model_type.""" - - def _model(x: np.ndarray): - return np.array([[1, 2, 3, 4], [1, 2, 3, 4]]) - - for i in range(4): - pred_fun, _label = get_predict_function_and_model_type(_model, "custom_model", i) - return_value = pred_fun(_model, np.array([[11, 22, 33, 44], [11, 22, 33, 44]])) # pyright: ignore[reportCallIssue] thinks its RuntimeError - assert return_value[0] == i + 1 - - -def _valid_sig(param: inspect.Parameter): - return param.annotation in (np.ndarray, inspect._empty, Any) diff --git a/tests/shapiq/tests_unit/tests_explainer/test_prediction_function.py b/tests/shapiq/tests_unit/tests_explainer/test_prediction_function.py deleted file mode 100644 index 79fa37b05..000000000 --- a/tests/shapiq/tests_unit/tests_explainer/test_prediction_function.py +++ /dev/null @@ -1,36 +0,0 @@ -"""All tests that check if the prediction functions are extracted and selected correctly.""" - -from __future__ import annotations - -import numpy as np -import pytest - -from shapiq.explainer.utils import get_predict_function_and_model_type - - -class TestSklearnAPI: - """All tests that check if prediction functions are extracted correctly for sklearn-like models.""" - - _dummy_input = np.zeros((1, 3)) - """A dummy input for testing purposes to be used in the tests.""" - - def _dummy_predict(self, x: np.ndarray) -> np.ndarray: - """A dummy predict function that returns zeros.""" - return np.array([0.0] * x.shape[0]) - - @pytest.mark.parametrize("model_fixture", ["tabpfn_clf_model"]) - def test_uses_predict_logit(self, model_fixture, request, monkeypatch) -> None: - """Models that should use the logits as the prediction function.""" - flag_is_used = False - - def mock_predict_logits(model, x): - nonlocal flag_is_used - flag_is_used = True - return self._dummy_predict(x) - - monkeypatch.setattr("shapiq.explainer.utils.predict_logits", mock_predict_logits) - model = request.getfixturevalue(model_fixture) - predict_function, _ = get_predict_function_and_model_type(model) - if not isinstance(predict_function, RuntimeError): - _ = predict_function(model, self._dummy_input) - assert flag_is_used, "The logits prediction function was not used." diff --git a/tests/shapiq/tests_unit/tests_explainer/test_productkernel_explainer.py b/tests/shapiq/tests_unit/tests_explainer/test_productkernel_explainer.py deleted file mode 100644 index 28cb4af39..000000000 --- a/tests/shapiq/tests_unit/tests_explainer/test_productkernel_explainer.py +++ /dev/null @@ -1,140 +0,0 @@ -"""This test module contains all tests for the product kernel explainer module of the shapiq package.""" - -from __future__ import annotations - -import copy - -import pytest -from sklearn.gaussian_process import GaussianProcessClassifier - -from shapiq.explainer.product_kernel import ProductKernelExplainer -from shapiq.explainer.product_kernel.conversion import convert_gp_reg, convert_svm -from shapiq.explainer.product_kernel.game import ( - ProductKernelGame, -) -from shapiq.game_theory.exact import ExactComputer - - -def test_invalid_application(bin_svc_model, background_clf_dataset_binary): - """Test the product kernel explainer with an invalid application.""" - with pytest.raises(ValueError): - _ = ProductKernelExplainer(model=bin_svc_model, max_order=2, index="SV") - - non_rbf_svm = copy.deepcopy(bin_svc_model) - non_rbf_svm.kernel = "linear" - - with pytest.raises(ValueError): - _ = ProductKernelExplainer(model=non_rbf_svm, max_order=1, index="SV") - - gaussian_process_classifier = GaussianProcessClassifier() - - with pytest.raises(TypeError): - _ = ProductKernelExplainer(model=gaussian_process_classifier, max_order=1, index="SV") - - -def test_bin_svc_product_kernel_explainer(bin_svc_model, background_clf_dataset_binary): - """Test the product kernel explainer with a binary SVC model.""" - - # Initialize the explainer - explainer = ProductKernelExplainer(model=bin_svc_model, max_order=1, index="SV") - - x_explain, _ = background_clf_dataset_binary - explanation = explainer.explain(x_explain[0]) - prediction = bin_svc_model.decision_function(x_explain[0].reshape(1, -1)) - - assert explanation.values.sum() == pytest.approx(prediction.item()) - - -def test_svr_product_kernel_explainer(svr_model, background_reg_data): - """Test the product kernel explainer with a SVR model.""" - - # Initialize the explainer - explainer = ProductKernelExplainer(model=svr_model, max_order=1, index="SV") - - x_explain = background_reg_data - explanation = explainer.explain(x_explain[0]) - prediction = svr_model.predict(x_explain[0].reshape(1, -1)) - - assert explanation.values.sum() == pytest.approx(prediction.item()) - - -def test_gp_reg_product_kernel_explainer(gp_reg_model, background_reg_data): - """Test the product kernel explainer with a Gaussian Process Regressor model.""" - - # Initialize the explainer - explainer = ProductKernelExplainer(model=gp_reg_model, max_order=1, index="SV") - - x_explain = background_reg_data - explanation = explainer.explain(x_explain[0]) - prediction = gp_reg_model.predict(x_explain[0].reshape(1, -1)) - - assert explanation.values.sum() == pytest.approx(prediction) - - -def test_svc_against_exact_computer(bin_svc_model, background_clf_dataset_binary): - """Test the binary SVC model against the exact computer for product kernel explainer.""" - - x_explain, _ = background_clf_dataset_binary - - # Initialize the exact computer - svc_kernel_game = ProductKernelGame( - model=convert_svm(bin_svc_model), - n_players=bin_svc_model.n_features_in_, - explain_point=x_explain[0], - normalize=False, - ) - exact_computer = ExactComputer(game=svc_kernel_game, n_players=bin_svc_model.n_features_in_) - - sv_values = exact_computer("SV").values - sum_values = sv_values.sum() - - model_prediction = bin_svc_model.decision_function(x_explain[0].reshape(1, -1)) - model_prediction_scalar = model_prediction.item() - - assert model_prediction_scalar == pytest.approx(sum_values) - - -def test_svr_against_exact_computer(svr_model, background_reg_data): - """Test the SVR model against the exact computer for product kernel explainer.""" - - x_explain = background_reg_data - - # Initialize the exact computer - svr_kernel_game = ProductKernelGame( - model=convert_svm(svr_model), - n_players=svr_model.n_features_in_, - explain_point=x_explain[0], - normalize=False, - ) - exact_computer = ExactComputer(game=svr_kernel_game, n_players=svr_model.n_features_in_) - - sv_values = exact_computer("SV").values - sum_values = sv_values.sum() - - model_prediction = svr_model.predict(x_explain[0].reshape(1, -1)) - model_prediction_scalar = model_prediction.item() - - assert model_prediction_scalar == pytest.approx(sum_values) - - -def test_gp_reg_against_exact_computer(gp_reg_model, background_reg_data): - """Test the Gaussian Process Regression model against the exact computer for product kernel explainer.""" - - x_explain = background_reg_data - - # Initialize the exact computer - gp_reg_kernel_game = ProductKernelGame( - model=convert_gp_reg(gp_reg_model), - n_players=gp_reg_model.n_features_in_, - explain_point=x_explain[0], - normalize=False, - ) - exact_computer = ExactComputer(game=gp_reg_kernel_game, n_players=gp_reg_model.n_features_in_) - - sv_values = exact_computer("SV").values - sum_values = sv_values.sum() - - model_prediction = gp_reg_model.predict(x_explain[0].reshape(1, -1)) - model_prediction_scalar = model_prediction.item() - - assert model_prediction_scalar == pytest.approx(sum_values) diff --git a/tests/shapiq/tests_unit/tests_explainer/tests_tree_explainer/__init__.py b/tests/shapiq/tests_unit/tests_explainer/tests_tree_explainer/__init__.py deleted file mode 100644 index fcc606e83..000000000 --- a/tests/shapiq/tests_unit/tests_explainer/tests_tree_explainer/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""This module contains all tests for the tree explainer implementation.""" diff --git a/tests/shapiq/tests_unit/tests_explainer/tests_tree_explainer/test_correct_calculation.py b/tests/shapiq/tests_unit/tests_explainer/tests_tree_explainer/test_correct_calculation.py deleted file mode 100644 index ac2494996..000000000 --- a/tests/shapiq/tests_unit/tests_explainer/tests_tree_explainer/test_correct_calculation.py +++ /dev/null @@ -1,485 +0,0 @@ -from __future__ import annotations - -import numpy as np -import pytest - -from shapiq.game_theory.exact import ExactComputer -from shapiq.tree import InterventionalGame, InterventionalTreeExplainer - -SEED = 1337 -np.random.seed(SEED) - - -@pytest.mark.parametrize( - ("index", "order"), - [ - ("SV", 1), - ("BV", 1), - ("SII", 2), - ("BII", 2), - ("CHII", 2), - ("FBII", 2), - ("FBII", 1), - ("FSII", 2), - ("STII", 2), - ], -) -def test_correct_calculation_dt_reg_index_order(dt_reg_model, reg_data, index, order): - X_train, X_test, _y_train, _y_test = reg_data - model = dt_reg_model - point_to_explain = X_test[0:1] - - # Our InterventionalTreeExplainer - own_interventional_explainer = InterventionalTreeExplainer( - model, X_train, index=index, max_order=order, debug=False - ) - explanation = own_interventional_explainer.explain_function(point_to_explain.flatten()) - own_interactions = explanation.interactions - - # Interventional Game with Exact Computer - interventional_game = InterventionalGame(model, X_train, point_to_explain.flatten()) - exact_computer = ExactComputer(interventional_game) - exact_values = exact_computer(index, order) - game_interactions = exact_values.interactions - - # Assertions that own Interventional Implementatoin matches Exact Computer - for _i, interaction in enumerate(own_interactions.keys()): - if index in ["FSII", "STII"]: - if len(interaction) != order: - continue - # Only check full interactions for FBII and FSII due to the current code supporting only the discrete derivate formula - assert np.isclose( - own_interactions[interaction], - game_interactions.get(interaction, 0), - atol=1e-6, - ) - elif len(interaction) > 0: - assert np.isclose( - own_interactions[interaction], - game_interactions.get(interaction, 0), - atol=1e-6, - ) - - -@pytest.mark.parametrize( - ("index", "order"), - [ - ("SV", 1), - ("BV", 1), - ("FBII", 1), - ("SII", 2), - ("BII", 2), - ("CHII", 2), - ("FBII", 2), - ("FSII", 2), - ("STII", 2), - ("SII", 3), - ("BII", 3), - ("CHII", 3), - ("FBII", 3), - ("FSII", 3), - ], -) -def test_correct_calculation_dt_clas_index_order(dt_clf_model, cls_data, index, order): - CLASS_INDEX = 1 - X_train, X_test, _, _ = cls_data - model = dt_clf_model - point_to_explain = X_test[0:1] - - # Our InterventionalTreeExplainer - own_interventional_explainer = InterventionalTreeExplainer( - model, - X_train, - index=index, - max_order=order, - debug=False, - class_index=CLASS_INDEX, - ) - explanation = own_interventional_explainer.explain_function(point_to_explain.flatten()) - own_interactions = explanation.interactions - - # Interventional Game with Exact Computer - interventional_game = InterventionalGame( - model, X_train, point_to_explain.flatten(), class_index=CLASS_INDEX - ) - exact_computer = ExactComputer(interventional_game) - exact_values = exact_computer(index, order) - game_interactions = exact_values.interactions - - # Assertions that own Interventional Implementatoin matches Exact Computer - for _i, interaction in enumerate(own_interactions.keys()): - if index in ["FSII", "STII"]: - if len(interaction) != order: - continue - # Only check full interactions for FBII and FSII due to the current code supporting only the discrete derivate formula - assert np.isclose( - own_interactions[interaction], - game_interactions.get(interaction, 0), - atol=1e-6, - ) - elif len(interaction) > 0: - assert np.isclose( - own_interactions[interaction], - game_interactions.get(interaction, 0), - atol=1e-6, - ) - - -@pytest.mark.parametrize( - ("index", "order"), - [ - ("SV", 1), - ("BV", 1), - ("FBII", 1), - ("SII", 2), - ("BII", 2), - ("CHII", 2), - ("FBII", 2), - ("FSII", 2), - ("STII", 2), - ("SII", 3), - ("BII", 3), - ("CHII", 3), - ("FBII", 3), - ("FSII", 3), - ], -) -def test_correct_calculation_rf_reg_index_order(rf_reg_model, reg_data, index, order): - X_train, X_test, _y_train, _y_test = reg_data - model = rf_reg_model - point_to_explain = X_test[0:1] - - # Our InterventionalTreeExplainer - own_interventional_explainer = InterventionalTreeExplainer( - model, X_train, max_order=order, index=index, debug=False - ) - explanation = own_interventional_explainer.explain_function(point_to_explain.flatten()) - own_interactions = explanation.interactions - - # Interventional Game with Exact Computer - interventional_game = InterventionalGame(model, X_train, point_to_explain.flatten()) - exact_computer = ExactComputer(interventional_game) - exact_values = exact_computer(index, order) - game_interactions = exact_values.interactions - - # Assertions that own Interventional Implementatoin matches Exact Computer - for _i, interaction in enumerate(own_interactions.keys()): - if index in ["FSII", "STII"]: - if len(interaction) != order: - continue - # Only check full interactions for FBII and FSII due to the current code supporting only the discrete derivate formula - assert np.isclose( - own_interactions[interaction], - game_interactions.get(interaction, 0), - atol=1e-6, - ) - elif len(interaction) > 0: - assert np.isclose( - own_interactions[interaction], - game_interactions.get(interaction, 0), - atol=1e-6, - ) - - -@pytest.mark.parametrize( - ("index", "order"), - [ - ("SV", 1), - ("BV", 1), - ("FBII", 1), - ("SII", 2), - ("BII", 2), - ("CHII", 2), - ("FBII", 2), - ("FSII", 2), - ("STII", 2), - ("SII", 3), - ("BII", 3), - ("CHII", 3), - ("FBII", 3), - ("FSII", 3), - ], -) -def test_correct_calculation_rf_clas_index_order(rf_clf_model, cls_data, index, order): - CLASS_INDEX = 1 - X_train, X_test, _, _ = cls_data - model = rf_clf_model - point_to_explain = X_test[0:1] - - # Our InterventionalTreeExplainer - own_interventional_explainer = InterventionalTreeExplainer( - model, - X_train, - max_order=order, - index=index, - debug=False, - class_index=CLASS_INDEX, - ) - explanation = own_interventional_explainer.explain_function(point_to_explain.flatten()) - own_interactions = explanation.interactions - - # Interventional Game with Exact Computer - interventional_game = InterventionalGame( - model, X_train, point_to_explain.flatten(), class_index=CLASS_INDEX - ) - exact_computer = ExactComputer(interventional_game) - exact_values = exact_computer(index, order) - game_interactions = exact_values.interactions - - # Assertions that own Interventional Implementatoin matches Exact Computer - for interaction in own_interactions: - if index in ["FSII", "STII"]: - if len(interaction) != order: - continue - # Only check full interactions for FBII and FSII due to the current code supporting only the discrete derivate formula - assert np.isclose( - own_interactions[interaction], - game_interactions.get(interaction, 0), - atol=1e-6, - ) - elif len(interaction) > 0: - assert np.isclose( - own_interactions[interaction], - game_interactions.get(interaction, 0), - atol=1e-6, - ) - - -@pytest.mark.parametrize( - ("index", "order"), - [ - ("SV", 1), - ("BV", 1), - ("FBII", 1), - ("SII", 2), - ("BII", 2), - ("CHII", 2), - ("FBII", 2), - ("FSII", 2), - ("STII", 2), - ("SII", 3), - ("BII", 3), - ("CHII", 3), - ("FBII", 3), - ("FSII", 3), - ], -) -def test_correct_calculation_xgb_reg_index_order(xgb_reg_model, reg_data, index, order): - X_train, X_test, _, _ = reg_data - model = xgb_reg_model - point_to_explain = X_test[0:1] - - # Our InterventionalTreeExplainer - own_interventional_explainer = InterventionalTreeExplainer( - model, X_train, max_order=order, index=index, debug=False - ) - explanation = own_interventional_explainer.explain_function(point_to_explain.flatten()) - own_interactions = explanation.interactions - - # Interventional Game with Exact Computer - interventional_game = InterventionalGame(model, X_train, point_to_explain.flatten()) - exact_computer = ExactComputer(interventional_game) - exact_values = exact_computer(index, order) - game_interactions = exact_values.interactions - - # Assertions that own Interventional Implementation matches Exact Computer - for _, interaction in enumerate(own_interactions.keys()): - if index in ["FSII", "STII"]: - if len(interaction) != order: - continue - # Using 1e-5 tolerance due to float32 vs float64 precision differences in XGBoost calculations - assert np.isclose( - own_interactions[interaction], - game_interactions.get(interaction, 0), - atol=1e-5, - ) - elif len(interaction) > 0: - assert np.isclose( - own_interactions[interaction], - game_interactions.get(interaction, 0), - atol=1e-5, - ) - - -@pytest.mark.parametrize( - ("index", "order"), - [ - ("SV", 1), - ("BV", 1), - ("FBII", 1), - ("SII", 2), - ("BII", 2), - ("CHII", 2), - ("FBII", 2), - ("FSII", 2), - ("STII", 2), - ("SII", 3), - ("BII", 3), - ("CHII", 3), - ("FBII", 3), - ("FSII", 3), - ], -) -def test_correct_calculation_xgb_clas_index_order(xgb_clf_model, cls_data, index, order): - CLASS_INDEX = 1 - X_train, X_test, _y_train, _y_test = cls_data - model = xgb_clf_model - point_to_explain = X_test[0:1] - - # Our InterventionalTreeExplainer - own_interventional_explainer = InterventionalTreeExplainer( - model, - X_train, - max_order=order, - index=index, - debug=False, - class_index=CLASS_INDEX, - ) - explanation = own_interventional_explainer.explain_function(point_to_explain.flatten()) - own_interactions = explanation.interactions - - # Interventional Game with Exact Computer - interventional_game = InterventionalGame( - model, X_train, point_to_explain.flatten(), class_index=CLASS_INDEX - ) - exact_computer = ExactComputer(interventional_game) - exact_values = exact_computer(index, order) - game_interactions = exact_values.interactions - - # Assertions that own Interventional Implementatoin matches Exact Computer - for _, interaction in enumerate(own_interactions.keys()): - if index in ["FSII", "STII"]: - if len(interaction) != order: - continue - # Only check full interactions for FBII and FSII due to the current code supporting only the discrete derivate formula - assert np.isclose( - own_interactions[interaction], - game_interactions.get(interaction, 0), - atol=1e-6, - ) - elif len(interaction) > 0: - assert np.isclose( - own_interactions[interaction], - game_interactions.get(interaction, 0), - atol=1e-6, - ) - - -@pytest.mark.parametrize( - ("index", "order"), - [ - ("SV", 1), - ("BV", 1), - ("FBII", 1), - ("SII", 2), - ("BII", 2), - ("CHII", 2), - ("FBII", 2), - ("FSII", 2), - ("STII", 2), - ("SII", 3), - ("BII", 3), - ("CHII", 3), - ("FBII", 3), - ("FSII", 3), - ], -) -def test_correct_calculation_lgbm_reg_index_order(lightgbm_reg_model, reg_data, index, order): - X_train, X_test, _y_train, _y_test = reg_data - model = lightgbm_reg_model - point_to_explain = X_test[0:1] - - # Our InterventionalTreeExplainer - own_interventional_explainer = InterventionalTreeExplainer( - model, X_train, max_order=order, index=index, debug=False - ) - explanation = own_interventional_explainer.explain_function(point_to_explain.flatten()) - own_interactions = explanation.interactions - - # Interventional Game with Exact Computer - interventional_game = InterventionalGame(model, X_train, point_to_explain.flatten()) - exact_computer = ExactComputer(interventional_game) - exact_values = exact_computer(index, order) - game_interactions = exact_values.interactions - - # Assertions that own Interventional Implementation matches Exact Computer - for _, interaction in enumerate(own_interactions.keys()): - if index in ["FSII", "STII"]: - if len(interaction) != order: - continue - # Only check full interactions for FBII and FSII due to the current code supporting only the discrete derivate formula - assert np.isclose( - own_interactions[interaction], - game_interactions[interaction], - atol=1e-6, - ) - elif len(interaction) > 0: - assert np.isclose( - own_interactions[interaction], - game_interactions.get(interaction, 0), - atol=1e-6, - ) - - -@pytest.mark.parametrize( - ("index", "order"), - [ - ("SV", 1), - ("BV", 1), - ("FBII", 1), - ("SII", 2), - ("BII", 2), - ("CHII", 2), - ("FBII", 2), - ("FSII", 2), - ("STII", 2), - ("SII", 3), - ("BII", 3), - ("CHII", 3), - ("FBII", 3), - ("FSII", 3), - ], -) -def test_correct_calculation_lgbm_clas_index_order(lightgbm_clf_model, cls_data, index, order): - CLASS_INDEX = 1 - X_train, X_test, _, _ = cls_data - model = lightgbm_clf_model - point_to_explain = X_test[0:1] - - # Our InterventionalTreeExplainer - own_interventional_explainer = InterventionalTreeExplainer( - model, - X_train, - max_order=order, - index=index, - debug=False, - class_index=CLASS_INDEX, - ) - explanation = own_interventional_explainer.explain_function(point_to_explain.flatten()) - own_interactions = explanation.interactions - - # Interventional Game with Exact Computer - interventional_game = InterventionalGame( - model, X_train, point_to_explain.flatten(), class_index=CLASS_INDEX - ) - exact_computer = ExactComputer(interventional_game) - exact_values = exact_computer(index, order) - game_interactions = exact_values.interactions - - # Assertions that own Interventional Implementatoin matches Exact Computer - for _, interaction in enumerate(own_interactions.keys()): - if index in ["FSII", "STII"]: - if len(interaction) != order: - continue - # Only check full interactions for FBII and FSII due to the current code supporting only the discrete derivate formula - assert np.isclose( - own_interactions[interaction], - game_interactions.get(interaction, 0), - atol=1e-6, - ) - elif len(interaction) > 0: - assert np.isclose( - own_interactions[interaction], - game_interactions.get(interaction, 0), - atol=1e-6, - ) diff --git a/tests/shapiq/tests_unit/tests_explainer/tests_tree_explainer/test_tree_bugfix.py b/tests/shapiq/tests_unit/tests_explainer/tests_tree_explainer/test_tree_bugfix.py deleted file mode 100644 index f685d2cbb..000000000 --- a/tests/shapiq/tests_unit/tests_explainer/tests_tree_explainer/test_tree_bugfix.py +++ /dev/null @@ -1,385 +0,0 @@ -"""This test module contains all tests for bugfixes regarding TreeSHAP-IQ.""" - -from __future__ import annotations - -import numpy as np -import pytest - -from shapiq.tree import TreeExplainer, TreeModel, TreeSHAPIQ - - -def test_bike_bug(): - """A test for the bug denoted in GH #118. Should be fixed.""" - children_left = [ - 1, - 2, - 3, - 4, - -1, - -1, - 7, - -1, - -1, - 10, - 11, - -1, - -1, - 14, - -1, - -1, - 17, - 18, - 19, - -1, - -1, - 22, - -1, - -1, - 25, - 26, - -1, - -1, - 29, - -1, - -1, - ] - chidren_right = [ - 16, - 9, - 6, - 5, - -1, - -1, - 8, - -1, - -1, - 13, - 12, - -1, - -1, - 15, - -1, - -1, - 24, - 21, - 20, - -1, - -1, - 23, - -1, - -1, - 28, - 27, - -1, - -1, - 30, - -1, - -1, - ] - features = [ - 0, - 0, - 0, - 10, - -2, - -2, - 10, - -2, - -2, - 10, - 2, - -2, - -2, - 2, - -2, - -2, - 1, - 6, - 5, - -2, - -2, - 0, - -2, - -2, - 6, - 0, - -2, - -2, - 0, - -2, - -2, - ] - thresholds = [ - -0.45833333, - -0.54166666, - -0.875, - 0.5, - np.nan, - np.nan, - 0.5, - np.nan, - np.nan, - 0.5, - -0.55244875, - np.nan, - np.nan, - -0.23671414, - np.nan, - np.nan, - -0.03125, - 0.5, - 2.5, - np.nan, - np.nan, - 0.625, - np.nan, - np.nan, - 0.5, - 0.70833334, - np.nan, - np.nan, - 0.70833334, - np.nan, - np.nan, - ] - node_sample_weight = [ - 13903.0, - 3996.0, - 3424.0, - 1156.0, - 375.0, - 781.0, - 2268.0, - 731.0, - 1537.0, - 572.0, - 188.0, - 72.0, - 116.0, - 384.0, - 172.0, - 212.0, - 9907.0, - 4451.0, - 2297.0, - 1540.0, - 757.0, - 2154.0, - 1636.0, - 518.0, - 5456.0, - 2640.0, - 2221.0, - 419.0, - 2816.0, - 2347.0, - 469.0, - ] - values = [ - 190.5770697, - 31.9014014, - 24.79964953, - 43.35034602, - 79.39733333, - 26.04225352, - 15.34435626, - 23.87824897, - 11.28562134, - 74.41258741, - 18.87765957, - 9.19444444, - 24.88793103, - 101.6015625, - 71.88372093, - 125.71226415, - 254.5790855, - 177.66344642, - 127.30605137, - 101.08311688, - 180.65257596, - 231.363974, - 264.46821516, - 126.81081081, - 317.32679619, - 247.60530303, - 267.30616839, - 143.17661098, - 382.69069602, - 417.93694078, - 206.30916844, - ] - - buggy_tree_model = { - "children_left": np.asarray(children_left), - "children_right": np.asarray(chidren_right), - "children_missing": np.asarray( - children_left - ), # intentionally set to left_children to test if it is ignored - "empty_prediction": 190.5770, - "features": np.asarray(features), - "thresholds": np.asarray(thresholds), - "node_sample_weight": np.asarray(node_sample_weight), - "values": np.asarray(values), - } - tree_model: TreeModel = TreeModel(**buggy_tree_model) - - x_explain = np.asarray( - [ - 0.58333333, - 0.9375, - 0.73706148, - -1.2, - 0.0, - 0.0, - 1.0, - 5.0, - 0.0, - 6.0, - 0.0, - 0.0, - ], - ) - - tree_explainer = TreeSHAPIQ(model=tree_model, index="SII", max_order=2, min_order=1) - tree_explainer.explain(x_explain) # bug appears for node 22 - - # if this test runs without an error, the bug is fixed - assert True - - -def test_xgboost_multiclass_base_score(): - """Test that XGBoost 3 multi-class base_score array is correctly parsed per class. - - In XGBoost 3, base_score for multi-class models is serialized as a per-class typed array - instead of a single scalar. Previously readBaseScoreOrZero() would fall back to 0.0, - breaking the efficiency property of Shapley values. - """ - import xgboost as xgb - from sklearn.datasets import make_classification - - X, y = make_classification( - random_state=42, n_samples=200, n_features=5, n_classes=3, n_informative=5, n_redundant=0 - ) - model = xgb.XGBClassifier( - random_state=42, n_estimators=10, max_depth=2, objective="multi:softprob", num_class=3 - ) - model.fit(X, y) - - x_explain = X[0] - booster = model.get_booster() - - raw_scores = booster.predict(xgb.DMatrix(x_explain.reshape(1, -1)), output_margin=True)[0] - - for class_idx in range(3): - explainer = TreeExplainer(model=model, max_order=1, index="SV", class_index=class_idx) - sv = explainer.explain(x_explain) - # TreeExplainer defaults to min_order=0, so sv[()] = baseline_value is included in - # sv.values. The efficiency property is therefore: sv.values.sum() == raw_score. - # (Adding sv.baseline_value again would double-count it.) - assert sv.baseline_value != 0.0, ( - f"baseline_value is 0.0 for class {class_idx}, indicating base_score was not read correctly" - ) - efficiency = sv.values.sum() - assert pytest.approx(efficiency, rel=1e-4) == raw_scores[class_idx], ( - f"Efficiency failed for class {class_idx}: {efficiency} != {raw_scores[class_idx]}. " - f"baseline_value={sv.baseline_value}" - ) - - -def test_xgboost_bug(): - """Test that xgboost works when not all features are used in the tree.""" - import xgboost as xgb - from sklearn.datasets import make_regression - - n_features_data = 7 - - # fit the tree on data that does not use all features - X, y = make_regression(random_state=42, n_samples=100, n_features=n_features_data) - model = xgb.XGBRegressor(random_state=42, n_estimators=10, max_depth=2) - model.fit(X, y) - - # make sure not all features are used in the tree - booster = model.get_booster() - data_frame = booster.trees_to_dataframe() - feature_names = np.setdiff1d(data_frame["Feature"], "Leaf") - n_features_in_tree = len(feature_names) - assert booster.num_features() == n_features_data - assert booster.num_features != n_features_in_tree - - # test the shapiq implementation - explainer = TreeExplainer(model=model, max_order=1, index="SV") - x_explain = X[0] - explanation = explainer.explain(x_explain) - - for value in explanation.values: - assert not np.isnan(value) - - -@pytest.mark.skip("Seems to be resolved") -def test_xgb_predicts_with_wrong_leaf_node(): - """Test that the xgboost model does not predict with the correct leaf node. - - This test illustrates that the predictions of the xgboost model do not perfectly align - with the xgboost models internal representation. - - Sometimes the model goes in a wrong direction in the path. This test illustrates this where - one datapoint should be predicted with a left leave node but is predicted with the right leave - node with the xgboost model. We are parsing the xgboost model and creating our tree model - representation, where we correctly predict with the left leave node. - """ - from sklearn.datasets import make_regression - from xgboost import XGBRegressor - - X, y = make_regression(n_samples=100, n_features=7, random_state=42) - model = XGBRegressor(random_state=42, n_estimators=1, max_depth=1) - model.fit(X, y) - booster = model.get_booster() - - # get the data point - x_explain = X[14] - x_explain_left = x_explain.copy() - x_explain_left[1] = 0.0 # set the feature value to 0.0 which is smaller than even the og. val - assert x_explain_left[1] < x_explain[1] # make sure the value is smaller - - # parse the xgboost model - data_df = booster.trees_to_dataframe() - threshold = data_df[data_df["Node"] == 0]["Split"].values[0] - feature_id = data_df[data_df["Node"] == 0]["Feature"].values[0] - intercept = model.intercept_[0] - prediction_left_df = data_df[data_df["Node"] == 1]["Gain"].values[0] + intercept - prediction_right_df = data_df[data_df["Node"] == 2]["Gain"].values[0] + intercept - - # make sure the xgboost model is using the features we are playing around with - assert feature_id == "f1" # feature 1 is used - assert x_explain[1] < threshold # feature value is < threshold (this instance should go left) - assert len(data_df) == 3 # only 3 nodes in the tree (one decision node and two leaf nodes) - - # get the predictions of the xgboost model - prediction_xgb = model.predict(x_explain.reshape(1, -1)) - prediction_xgb_left = model.predict(x_explain_left.reshape(1, -1)) - assert not np.allclose(prediction_xgb, prediction_xgb_left) # predictions are different - # the original prediction is going right not left as it should - assert np.allclose(prediction_xgb, prediction_right_df) - assert np.allclose(prediction_xgb, prediction_left_df) - - # get our tree model representation - tree_explainer = TreeExplainer(model=model, index="SV") - tree_model = tree_explainer._treeshapiq_explainers[0]._tree - prediction_tree_model = tree_model.predict_one(x_explain) - prediction_tree_model_left = tree_model.predict_one(x_explain_left) - # predictions of og xgb is different from our tree model - # where both instances are correctly predicted to be left - assert prediction_xgb != prediction_tree_model - assert prediction_tree_model == prediction_left_df - assert prediction_tree_model_left == prediction_left_df - assert prediction_tree_model != prediction_right_df - - # get the explanation of the tree model - sv = tree_explainer.explain(x_explain) - efficiency = sum(sv.values) - if sv[()] == 0: - efficiency += sv.baseline_value - # efficiency is correct as the prediction with the tree model and not like the xgb model - assert pytest.approx(efficiency) == prediction_tree_model - assert pytest.approx(efficiency, rel=0.0001) == prediction_left_df - assert pytest.approx(efficiency, rel=0.0001) != prediction_right_df diff --git a/tests/shapiq/tests_unit/tests_explainer/tests_tree_explainer/test_tree_explainer.py b/tests/shapiq/tests_unit/tests_explainer/tests_tree_explainer/test_tree_explainer.py deleted file mode 100644 index 48f0edcd2..000000000 --- a/tests/shapiq/tests_unit/tests_explainer/tests_tree_explainer/test_tree_explainer.py +++ /dev/null @@ -1,613 +0,0 @@ -"""This test module contains all tests for the tree explainer module of the shapiq package.""" - -from __future__ import annotations - -import copy - -import numpy as np -import pytest - -from shapiq.approximator.proxy.proxyshap import MSRBiased -from shapiq.tree import TreeExplainer, TreeModel -from shapiq.tree.interventional.cext import compute_interactions_sparse -from tests.shapiq.markers import skip_if_no_lightgbm - - -def test_compute_interactions_sparse_high_dimensional_indices_do_not_overflow(): - """Regression test for index overflow in sparse interaction computation. - - This test uses more than 127 features to ensure path-index arrays keep int64 - indices and the C-extension runs without crashing. - """ - - n_features = 170 - approximator = MSRBiased(n=n_features, max_order=1, index="SV") - - coalition_matrix = np.zeros((3, n_features), dtype=np.int64) - coalition_matrix[0, :5] = 1 - coalition_matrix[1, 100:110] = 1 - coalition_matrix[2, 160:] = 1 - - e_matrix, r_matrix, e_counts, r_counts = approximator._coalitions_to_tree_paths( - coalition_matrix, - ) - - assert e_matrix.dtype == np.int64 - assert r_matrix.dtype == np.int64 - assert np.max(r_matrix[r_matrix >= 0]) == n_features - 1 - - coalition_values = np.array([0.1, -0.2, 0.3], dtype=np.float32) - interactions = compute_interactions_sparse( - coalition_values, - e_matrix, - r_matrix, - e_counts, - r_counts, - "SV", - n_features, - 1, - ) - - assert isinstance(interactions, dict) - assert interactions - for key in interactions: - assert isinstance(key, tuple) - for feature_index in key: - assert 0 <= feature_index < n_features - - -def test_compute_interactions_flatten_repeated_calls_do_not_segfault(): - """Regression test for refcount corruption in flatten interaction output conversion. - - This test calls the compute_interactions_flatten function multiple times to check that it does not segfault due to refcount corruption in the C-extension. - """ - - from shapiq.tree.interventional.cext import compute_interactions_flatten - - n_features = 1778 - n_iterations = n_features - leaf_predictions = np.ones(n_iterations, dtype=np.float32) - features = np.arange(n_features, dtype=np.int64) - e_sizes = np.ones(n_iterations, dtype=np.int64) - r_sizes = np.zeros(n_iterations, dtype=np.int64) - feature_in_e = np.ones(n_iterations, dtype=np.int64) - leaf_id = np.zeros(n_iterations, dtype=np.int64) - - for _ in range(5): - out = compute_interactions_flatten( - leaf_predictions, - features, - e_sizes, - r_sizes, - feature_in_e, - leaf_id, - "SV", - n_iterations, - n_features, - n_iterations, - 1, - 0, - 1.0, - ) - assert len(out) == n_features - - -def test_decision_tree_classifier(rf_clf_model, background_clf_data): - """Test TreeExplainer with a simple decision tree classifier.""" - explainer = TreeExplainer(model=rf_clf_model, max_order=2, min_order=1) - - x_explain = background_clf_data[0] - explanation = explainer.explain(x_explain) - prediction = rf_clf_model.predict_proba(x_explain.reshape(1, -1))[0] - - assert type(explanation).__name__ == "InteractionValues" # check correct return type - - # check init with class label - _ = TreeExplainer(model=rf_clf_model, max_order=2, min_order=0, class_index=0) - - assert True - - explainer = _ = TreeExplainer(model=rf_clf_model, max_order=1, min_order=0, class_index=1) - explanation = explainer.explain(x_explain) - - # compare baseline_value with empty_predictions - assert explainer.baseline_value == sum( - [treeshapiq.empty_prediction for treeshapiq in explainer._treeshapiq_explainers], - ) - assert explanation.baseline_value == explainer.baseline_value - - # test efficiency - sum_of_values = sum(explanation.values) - assert prediction[1] == pytest.approx(sum_of_values) - - -def test_decision_tree_regression(dt_reg_model, background_reg_data): - """Test TreeExplainer with a simple decision tree regressor.""" - explainer = TreeExplainer(model=dt_reg_model, max_order=2, min_order=1) - - x_explain = background_reg_data[0] - explanation = explainer.explain(x_explain) - prediction = dt_reg_model.predict(x_explain.reshape(1, -1)) - - assert type(explanation).__name__ == "InteractionValues" # check correct return type - - # compare baseline_value with empty_predictions - assert explainer.baseline_value == sum( - [treeshapiq.empty_prediction for treeshapiq in explainer._treeshapiq_explainers], - ) - assert explanation.baseline_value == explainer.baseline_value - - # test efficiency - sum_of_values = sum(explanation.values) - assert prediction == pytest.approx(sum_of_values) - - -def test_random_forest_regression(rf_reg_model, background_reg_data): - """Test TreeExplainer with a simple decision tree regressor.""" - explainer = TreeExplainer(model=rf_reg_model, max_order=2, min_order=1) - - x_explain = background_reg_data[0] - explanation = explainer.explain(x_explain) - - assert type(explanation).__name__ == "InteractionValues" # check correct return type - - # compare baseline_value with empty_predictions - assert explainer.baseline_value == sum( - [treeshapiq.empty_prediction for treeshapiq in explainer._treeshapiq_explainers], - ) - assert explanation.baseline_value == explainer.baseline_value - - # assert efficiency - prediction = rf_reg_model.predict(x_explain.reshape(1, -1))[0] - sum_of_values = sum(explanation.values) - assert prediction == pytest.approx(sum_of_values) - - -def test_random_forest_classification(rf_clf_model, background_clf_data): - """Test TreeExplainer with a simple decision tree regressor.""" - class_label = 0 - explainer = TreeExplainer( - model=rf_clf_model, - max_order=1, - min_order=0, - index="SV", - class_index=class_label, - ) - - x_explain = background_clf_data[0] - explanation = explainer.explain(x_explain) - - assert type(explanation).__name__ == "InteractionValues" # check correct return type - - # compare baseline_value with empty_predictions - assert explainer.baseline_value == sum( - [treeshapiq.empty_prediction for treeshapiq in explainer._treeshapiq_explainers], - ) - assert explanation.baseline_value == explainer.baseline_value - - # assert efficieny - prediction = rf_clf_model.predict_proba(x_explain.reshape(1, -1))[0, class_label] - sum_of_values = sum(explanation.values) - assert prediction == pytest.approx(sum_of_values) - - -def test_against_shap_implementation(): - """Test the tree explainer against the shap implementation's tree explainer results.""" - # manual values for a tree to test against the shap implementation - children_left = np.asarray([1, 2, 3, -1, -1, -1, 7, -1, -1]) - children_right = np.asarray([6, 5, 4, -1, -1, -1, 8, -1, -1]) - features = np.asarray([0, 1, 0, -2, -2, -2, 2, -2, -2]) - thresholds = np.asarray([0, 0, -0.5, -2, -2, -2, 0, -2, -2]) - node_sample_weight = np.asarray([100, 50, 38, 15, 23, 12, 50, 20, 30]) - - # create a classification tree model - values = [110, 105, 95, 20, 50, 100, 75, 10, 40] - values = [values[i] / max(values) for i in range(len(values))] - values = np.asarray(values) - - x_explain = np.asarray([-1, -0.5, 1, 0]) - - tree_model = TreeModel( - children_left=children_left, - children_right=children_right, - children_missing=children_left, # no missing values, so we can set this to anything - features=features, - thresholds=thresholds, - node_sample_weight=node_sample_weight, - values=values, - ) - - explainer = TreeExplainer(model=tree_model, max_order=1, min_order=1, index="SV") - explanation = explainer.explain(x_explain) - - assert explanation[(0,)] == pytest.approx(-0.09263158, abs=1e-4) - assert explanation[(1,)] == pytest.approx(-0.12100478, abs=1e-4) - assert explanation[(2,)] == pytest.approx(0.02727273, abs=1e-4) - assert explanation[(3,)] == pytest.approx(0.0, abs=1e-4) - - explainer = TreeExplainer(model=tree_model, max_order=1, min_order=1, index="SII") - explanation = explainer.explain(x_explain) - - assert explanation[(0,)] == pytest.approx(-0.09263158, abs=1e-4) - assert explanation[(1,)] == pytest.approx(-0.12100478, abs=1e-4) - assert explanation[(2,)] == pytest.approx(0.02727273, abs=1e-4) - assert explanation[(3,)] == pytest.approx(0.0, abs=1e-4) - - with pytest.warns(UserWarning): - _ = TreeExplainer(model=tree_model, max_order=2, min_order=1, index="SV") - - -def test_xgboost_reg(xgb_reg_model, background_reg_data): - """Tests the shapiq implementation of TreeSHAP agains SHAP's implementation for XGBoost.""" - explanation_instance = 0 - - # the following code is used to get the shap values from the SHAP implementation - """ - # import shap - # explainer_shap = shap.TreeExplainer(model=xgb_reg_model) - # x_explain_shap = background_reg_data[explanation_instance].reshape(1, -1) - # sv_shap = explainer_shap.shap_values(x_explain_shap)[0] - """ - sv_shap = [-2.555832, 28.50987, 1.7708225, -7.8653603, 10.7955885, -0.1877861, 4.549199] - sv_shap = np.asarray(sv_shap) - - # compute with shapiq - explainer_shapiq = TreeExplainer(model=xgb_reg_model, max_order=1, index="SV") - x_explain_shapiq = background_reg_data[explanation_instance] - sv_shapiq = explainer_shapiq.explain(x=x_explain_shapiq) - sv_shapiq_values = sv_shapiq.get_n_order_values(1) - baseline_shapiq = sv_shapiq.baseline_value - - assert np.allclose(sv_shap, sv_shapiq_values, rtol=1e-5) - - # get prediction of the model - prediction = xgb_reg_model.predict(x_explain_shapiq.reshape(1, -1)) - assert prediction == pytest.approx(baseline_shapiq + np.sum(sv_shapiq_values), rel=1e-5) - - -def test_xgboost_clf(xgb_clf_model, background_clf_data): - """Tests the shapiq implementation of TreeSHAP against SHAP's implementation for XGBoost.""" - explanation_instance = 1 - class_label = 1 - - # the following code is used to get the shap values from the SHAP implementation - """ - # import shap - # model_copy = copy.deepcopy(xgb_clf_model) - # explainer_shap = shap.TreeExplainer(model=model_copy) - # baseline_shap = float(explainer_shap.expected_value[class_label]) - # print(baseline_shap) - # x_explain_shap = copy.deepcopy(background_clf_data[explanation_instance].reshape(1, -1)) - # sv_shap_all_classes = explainer_shap.shap_values(x_explain_shap) - # sv_shap = sv_shap_all_classes[0][:, class_label] - # print(sv_shap) - """ - sv = [-0.00543903, -0.15696308, -0.17532629, -0.24037467, 0.00245022, 0.00986468, -0.01556843] - sv_shap = np.array(sv) - - # compute with shapiq - explainer_shapiq = TreeExplainer( - model=xgb_clf_model, - max_order=1, - index="SV", - class_index=class_label, - ) - x_explain_shapiq = copy.deepcopy(background_clf_data[explanation_instance]) - sv_shapiq = explainer_shapiq.explain(x=x_explain_shapiq) - sv_shapiq_values = sv_shapiq.get_n_order_values(1) - baseline_shapiq = sv_shapiq.baseline_value - - assert np.allclose(sv_shap, sv_shapiq_values, rtol=1e-5) - - # get prediction of the model (as the log odds) - prediction = xgb_clf_model.predict(x_explain_shapiq.reshape(1, -1), output_margin=True)[0][ - class_label - ] - assert prediction == pytest.approx(baseline_shapiq + np.sum(sv_shapiq_values), rel=1e-5) - - -def test_random_forest_reg(rf_reg_model, background_reg_data): - """Tests the shapiq implementation of TreeSHAP vs. SHAP's implementation for Random Forest.""" - explanation_instance = 1 - - # the following code is used to get the shap values from the SHAP implementation - """ - # import shap - # model_copy = copy.deepcopy(rf_reg_model) - # explainer_shap = shap.TreeExplainer(model=model_copy) - # baseline_shap = float(explainer_shap.expected_value) - # x_explain_shap = copy.deepcopy(background_reg_data[explanation_instance].reshape(1, -1)) - # sv_shap_all_classes = explainer_shap.shap_values(x_explain_shap) - # sv_shap = sv_shap_all_classes[0] - # print(sv_shap_all_classes, baseline_shap) - """ - sv_shap = [25.8278293, -77.40235947, 0.0, 21.7067263, -4.85542565, 0.0, 4.91330141] - sv_shap = np.asarray(sv_shap) - baseline_shap = -0.713665621534487 - - # compute with shapiq - explainer_shapiq = TreeExplainer(model=rf_reg_model, max_order=1, index="SV") - x_explain_shapiq = copy.deepcopy(background_reg_data[explanation_instance]) - sv_shapiq = explainer_shapiq.explain(x=x_explain_shapiq) - sv_shapiq_values = sv_shapiq.get_n_order_values(1) - baseline_shapiq = sv_shapiq.baseline_value - - assert baseline_shap == pytest.approx(baseline_shapiq, rel=1e-4) - assert np.allclose(sv_shap, sv_shapiq_values, rtol=1e-5) - - -def test_random_forest_shap(rf_clf_model, background_clf_data): - """Tests the shapiq implementation of TreeSHAP vs. SHAP's implementation for Random Forest.""" - explanation_instance = 1 - class_label = 1 - - # the following code is used to get the shap values from the SHAP implementation - """ - # import shap - # model_copy = copy.deepcopy(rf_clf_model) - # explainer_shap = shap.TreeExplainer(model=model_copy) - # baseline_shap = float(explainer_shap.expected_value[class_label]) - # x_explain_shap = copy.deepcopy(background_clf_data[explanation_instance].reshape(1, -1)) - # sv_shap_all_classes = explainer_shap.shap_values(x_explain_shap) - # sv_shap = sv_shap_all_classes[0][:, class_label] - # print(sv_shap_all_classes, baseline_shap) - """ - sv_shap = [-0.00537992, 0.0, -0.08206514, -0.03122057, 0.0025626, 0.03182904, 0.03782473] - sv_shap = np.asarray(sv_shap) - baseline_shap = 0.32000000000000006 - - # compute with shapiq - explainer_shapiq = TreeExplainer( - model=rf_clf_model, - max_order=1, - index="SV", - class_index=class_label, - ) - x_explain_shapiq = copy.deepcopy(background_clf_data[explanation_instance]) - sv_shapiq = explainer_shapiq.explain(x=x_explain_shapiq) - sv_shapiq_values = sv_shapiq.get_n_order_values(1) - baseline_shapiq = sv_shapiq.baseline_value - - assert baseline_shap == pytest.approx(baseline_shapiq, rel=1e-4) - assert np.allclose(sv_shap, sv_shapiq_values, rtol=1e-5) - - -def test_lightgbm_clf_shap(lightgbm_clf_model, background_clf_data): - """Tests the shapiq implementation of TreeSHAP vs. SHAP's implementation for LightGBM.""" - explanation_instance = 1 - class_label = 1 - - # the following code is used to get the shap values from the SHAP implementation - # note that you need to uncomment these lines in the shap library you have locally installed: - # https://github.com/shap/shap/blob/6c4a71ce59ea579be58917d824fa0ba5cd97e787/shap/explainers/_tree.py#L543C1-L547C26 - - """ - # import shap - # model_copy = copy.deepcopy(lightgbm_clf_model) - # explainer_shap = shap.TreeExplainer(model=model_copy) - # baseline_shap = float(explainer_shap.expected_value[class_label]) - # x_explain_shap = copy.deepcopy(background_clf_data[explanation_instance].reshape(1, -1)) - # sv_shap_all_classes = explainer_shap.shap_values(x_explain_shap) - # sv_shap = sv_shap_all_classes[0][:, class_label] - # print(sv_shap_all_classes, baseline_shap) - """ - sv_shap = [0.0, 0.0, -0.05747963, -0.20128496, 0.0, 0.0, 0.01560273] - sv_shap = np.asarray(sv_shap) - baseline_shap = -1.0862557008895362 - - # compute with shapiq - explainer_shapiq = TreeExplainer( - model=lightgbm_clf_model, - max_order=1, - index="SV", - class_index=class_label, - ) - x_explain_shapiq = copy.deepcopy(background_clf_data[explanation_instance]) - sv_shapiq = explainer_shapiq.explain(x=x_explain_shapiq) - sv_shapiq_values = sv_shapiq.get_n_order_values(1) - baseline_shapiq = sv_shapiq.baseline_value - - assert baseline_shap == pytest.approx(baseline_shapiq, rel=1e-4) - assert np.allclose(sv_shap, sv_shapiq_values, rtol=1e-5) - - -def test_xgboost_shap_error(xgb_clf_model, background_clf_data): - """Tests for the strange behavior of SHAP's XGBoost implementation. - - The test is used to show that the shapiq implementation is correct and the SHAP implementation - is doing something weird. For some instances (e.g. the one used in this test) the SHAP values - are different from the shapiq values. However, when we round the `thresholds` of the xgboost - trees in shapiq, then the computed explanations match. This is a strange behavior as rounding - the thresholds makes the model less true to the original model but only then the explanations - match. - """ - explanation_instance = 0 - class_label = 1 - - # get the shap explanations (the following code is used to get SVs from SHAP) - # import shap # noqa: ERA001 - # model_copy = copy.deepcopy(xgb_clf_model) # noqa: ERA001 - # explainer_shap = shap.TreeExplainer(model=model_copy) # noqa: ERA001 - # baseline_shap = float(explainer_shap.expected_value[class_label]) # noqa: ERA001 - # x_explain_shap = copy.deepcopy(background_clf_data[explanation_instance].reshape(1, -1)) # noqa: ERA001 - # sv_shap_all_classes = explainer_shap.shap_values(x_explain_shap) # noqa: ERA001 - # sv_shap = sv_shap_all_classes[0][:, class_label] # noqa: ERA001 - # print(sv_shap) # noqa: ERA001 - # print(baseline_shap) # noqa: ERA001 - sv = [-0.00163171, 0.05075389, -0.13064955, -0.4421068, 0.00424677, -0.04832656, -0.01364264] - sv_shap = np.array(sv) - - # setup shapiq TreeSHAP - explainer_shapiq = TreeExplainer( - model=xgb_clf_model, - max_order=1, - index="SV", - class_index=class_label, - ) - x_explain_shapiq = copy.deepcopy(background_clf_data[explanation_instance]) - sv_shapiq = explainer_shapiq.explain(x=x_explain_shapiq) - sv_shapiq_values = sv_shapiq.get_n_order_values(1) - - # the SHAP sv values should be different from the shapiq values - assert not np.allclose(sv_shap, sv_shapiq_values, rtol=1e-5) - - # when we round the model thresholds of the xgb model (thresholds decide weather a feature is - # used or not) -> then suddenly the shap and shapiq values are the same, which points to the - # fact that the shapiq implementation is correct - explainer_shapiq_rounded = TreeExplainer( - model=xgb_clf_model, - max_order=1, - index="SV", - class_index=class_label, - ) - for tree_explainer in explainer_shapiq_rounded._treeshapiq_explainers: - tree_explainer._tree.thresholds = np.round(tree_explainer._tree.thresholds, 4) - x_explain_shapiq_rounded = copy.deepcopy(background_clf_data[explanation_instance]) - sv_shapiq_rounded = explainer_shapiq_rounded.explain(x=x_explain_shapiq_rounded) - sv_shapiq_rounded_values = sv_shapiq_rounded.get_n_order_values(1) - - # now the values surprisingly are the same - assert np.allclose(sv_shap, sv_shapiq_rounded_values, rtol=1e-5) - - -def test_iso_forest_shap(if_clf_model): - """Tests the shapiq implementation of TreeSHAP vs. SHAP's implementation for Isolation Forest.""" - x_explain = np.array([0.125, 0.05]) - - # the following code is used to get the shap values from the SHAP implementation - # import shap # noqa: ERA001 - # model_copy = copy.deepcopy(if_clf_model) # noqa: ERA001 - # explainer_shap = shap.TreeExplainer(model=model_copy) # noqa: ERA001 - # baseline_shap = float(explainer_shap.expected_value) # noqa: ERA001 - # sv_shap = explainer_shap.shap_values(x_explain) # noqa: ERA001 - # print(sv_shap) # noqa: ERA001 - # print(baseline_shap) # noqa: ERA001 - sv_shap = np.array([-1.40624839, -3.21377854]) - baseline_shap = 11.953360265689595 - - # compute with shapiq - explainer_shapiq = TreeExplainer(model=if_clf_model, max_order=1, index="SV") - sv_shapiq = explainer_shapiq.explain(x=x_explain) - sv_shapiq_values = sv_shapiq.get_n_order_values(1) - baseline_shapiq = sv_shapiq.baseline_value - - assert np.allclose(sv_shap, sv_shapiq_values, rtol=1e-5) - assert baseline_shap == pytest.approx(baseline_shapiq, rel=1e-6) - - -@skip_if_no_lightgbm -def test_decision_stumps(background_reg_dataset, background_clf_dataset): - """Tests weather you can explain a decision stumps with the shapiq implementation.""" - from lightgbm import LGBMClassifier, LGBMRegressor - from sklearn.ensemble import RandomForestClassifier, RandomForestRegressor - from sklearn.tree import DecisionTreeClassifier, DecisionTreeRegressor - from xgboost import XGBClassifier, XGBRegressor - - models_reg = [ - LGBMRegressor(random_state=42, n_estimators=20, max_depth=1), - XGBRegressor(random_state=42, n_estimators=20, max_depth=1), - DecisionTreeRegressor(random_state=42, max_depth=1), - RandomForestRegressor(random_state=42, n_estimators=20, max_depth=1), - ] - - models_clf = [ - LGBMClassifier(random_state=42, n_estimators=20, max_depth=1), - XGBClassifier(random_state=42, n_estimators=20, max_depth=1), - DecisionTreeClassifier(random_state=42, max_depth=1), - RandomForestClassifier(random_state=42, n_estimators=20, max_depth=1), - ] - - for model in models_reg: - X, y = background_reg_dataset - model.fit(X, y) - - explainer = TreeExplainer(model=model, max_order=3, index="k-SII") - x_explain = X[0] - explanation = explainer.explain(x_explain) - - efficiency = sum(explanation.values) - - pred = model.predict(x_explain.reshape(1, -1)) - assert pred == pytest.approx(efficiency, rel=1e-5) - - for model in models_clf: - X, y = background_clf_dataset - model.fit(X, y) - - explainer = TreeExplainer(model=model, max_order=3, index="k-SII", class_index=0) - x_explain = X[1] - explanation = explainer.explain(x_explain) - - efficiency = sum(explanation.values) - - if isinstance(model, RandomForestClassifier | DecisionTreeClassifier): - pred = model.predict_proba(x_explain.reshape(1, -1))[0, 0] - elif isinstance(model, XGBClassifier): - pred = model.predict(x_explain.reshape(1, -1), output_margin=True)[0, 0] - else: # skip lightgbm - continue - - assert pred == pytest.approx(efficiency, rel=1e-5) - - -def test_extra_trees_clf(et_clf_model, background_clf_data): - """Test the shapiq implementation of TreeSHAP vs. SHAP's implementation for Extra Trees.""" - explanation_instance = 1 - class_label = 1 - - # the following code is used to get the shap values from the SHAP implementation - """ - #import shap - # model_copy = copy.deepcopy(et_clf_model) - # explainer_shap = shap.TreeExplainer(model=model_copy) - # baseline_shap = float(explainer_shap.expected_value[class_label]) - # x_explain_shap = copy.deepcopy(background_clf_data[explanation_instance].reshape(1, -1)) - # sv_shap_all_classes = explainer_shap.shap_values(x_explain_shap) - # sv_shap = sv_shap_all_classes[0][:, class_label] - # print(sv_shap_all_classes, format(baseline_shap, '.20f')) - """ - sv_shap = [0.00207427, 0.00949552, -0.00108266, -0.03825587, -0.02694092, 0.0170296, 0.02046364] - sv_shap = np.asarray(sv_shap) - baseline_shap = 0.34000000000000002 - - # compute with shapiq - explainer_shapiq = TreeExplainer( - model=et_clf_model, max_order=1, index="SV", class_index=class_label - ) - x_explain_shapiq = copy.deepcopy(background_clf_data[explanation_instance]) - sv_shapiq = explainer_shapiq.explain(x=x_explain_shapiq) - sv_shapiq_values = sv_shapiq.get_n_order_values(1) - baseline_shapiq = sv_shapiq.baseline_value - - assert baseline_shap == pytest.approx(baseline_shapiq, rel=1e-4) - assert np.allclose(sv_shap, sv_shapiq_values, rtol=1e-5) - - -def test_extra_trees_reg(et_reg_model, background_reg_data): - """Test the shapiq implementation of TreeSHAP vs. SHAP's implementation for Extra Trees.""" - explanation_instance = 1 - - # the following code is used to get the shap values from the SHAP implementation - """ - # import shap - # model_copy = copy.deepcopy(et_reg_model) - # explainer_shap = shap.TreeExplainer(model=model_copy) - # baseline_shap = float(explainer_shap.expected_value) - # x_explain_shap = copy.deepcopy(background_reg_data[explanation_instance].reshape(1, -1)) - # sv_shap_all_classes = explainer_shap.shap_values(x_explain_shap) - # sv_shap = sv_shap_all_classes[0] - # print(sv_shap_all_classes, format(baseline_shap, '.20f')) - """ - sv_shap = [19.28673017, -19.87182634, 0.0, 10.89201698, -9.62498263, 0.35992212, 42.31290091] - sv_shap = np.asarray(sv_shap) - baseline_shap = -2.56682283435175007 - - # compute with shapiq - explainer_shapiq = TreeExplainer(model=et_reg_model, max_order=1, index="SV") - x_explain_shapiq = copy.deepcopy(background_reg_data[explanation_instance]) - sv_shapiq = explainer_shapiq.explain(x=x_explain_shapiq) - sv_shapiq_values = sv_shapiq.get_n_order_values(1) - baseline_shapiq = sv_shapiq.baseline_value - - assert baseline_shap == pytest.approx(baseline_shapiq, rel=1e-4) - assert np.allclose(sv_shap, sv_shapiq_values, rtol=1e-5) diff --git a/tests/shapiq/tests_unit/tests_explainer/tests_tree_explainer/test_tree_explainer_conversion.py b/tests/shapiq/tests_unit/tests_explainer/tests_tree_explainer/test_tree_explainer_conversion.py deleted file mode 100644 index f215552c5..000000000 --- a/tests/shapiq/tests_unit/tests_explainer/tests_tree_explainer/test_tree_explainer_conversion.py +++ /dev/null @@ -1,197 +0,0 @@ -"""This test module collects all tests for the conversions of the supported tree models for the TreeExplainer class.""" - -from __future__ import annotations - -import numpy as np -import pytest - -from shapiq import TreeExplainer -from shapiq.explainer.utils import get_predict_function_and_model_type -from shapiq.tree.base import TreeModel -from shapiq.tree.conversion.edges import create_edge_tree -from shapiq.tree.conversion.sklearn import ( - convert_isolation_forest_tree, - convert_random_forest_tree, - convert_sklearn_tree, -) -from shapiq.tree.validation import SUPPORTED_MODELS -from shapiq.utils import safe_isinstance -from tests.shapiq.conftest import TREE_MODEL_FIXTURES - - -def test_tree_model_init(): - """Test the initialization of the TreeModel class.""" - left_children = np.array([1, 2, -1, -1, -1]) - right_children = np.array([4, 3, -1, -1, -1]) - features = np.array([0, 1, -2, -3, -2]) # intentionally wrong value at index 3 - thresholds = np.array([0.5, 0.5, 0, 0, 0]) - values = np.array([100, 200, 300, 400, 500]) - sample_weights = np.array([1.0, 0.5, 0.25, 0.25, 0.5]) - tree_model = TreeModel( - children_left=left_children, - children_right=right_children, - children_missing=left_children, # intentionally set to left_children to test if it is ignored - features=features, - thresholds=thresholds, - values=values, - node_sample_weight=sample_weights, - ) - assert np.all(tree_model.children_left == np.array([1, 2, -1, -1, -1])) - assert np.all(tree_model.children_right == np.array([4, 3, -1, -1, -1])) - assert np.all(tree_model.features == np.array([0, 1, -2, -2, -2])) - assert np.isnan(tree_model.thresholds[2]) - assert np.isnan(tree_model.thresholds[3]) - # check if is_leaf is correctly computed - assert np.all(tree_model.leaf_mask == np.array([False, False, True, True, True])) - # check if empty prediction is correctly computed - assert tree_model.empty_prediction == 425.0 - - -def test_edge_tree_init(): - """Tests the initialization of the EdgeTree class.""" - # setup test data (same as in test_manual_tree of test_tree_treeshapiq.py) - children_left = np.asarray([1, 2, 3, -1, -1, -1, 7, -1, -1]) - children_right = np.asarray([6, 5, 4, -1, -1, -1, 8, -1, -1]) - features = np.asarray([0, 1, 0, -2, -2, -2, 2, -2, -2]) - thresholds = np.asarray([0, 0, -0.5, -2, -2, -2, 0, -2, -2]) - node_sample_weight = np.asarray([100, 50, 38, 15, 23, 12, 50, 20, 30]) - values = np.asarray([110, 105, 95, 20, 50, 100, 75, 10, 40]) - - tree_model = TreeModel( - children_left=children_left, - children_right=children_right, - children_missing=children_left, # intentionally set to left_children to test if it is ignored - features=features, - thresholds=thresholds, - node_sample_weight=node_sample_weight, - values=values, - ) - - max_feature_id = tree_model.max_feature_id - n_nodes = tree_model.n_nodes - - interaction_update_positions = { - 1: {0: np.array([0]), 1: np.array([1]), 2: np.array([2])}, - 2: {0: np.array([0, 1]), 1: np.array([0, 2]), 2: np.array([1, 2])}, - } - - edge_tree = create_edge_tree( - children_left=tree_model.children_left, - children_right=tree_model.children_right, - features=tree_model.features, - node_sample_weight=tree_model.node_sample_weight, - values=tree_model.values, - max_interaction=1, - n_features=max_feature_id + 1, - n_nodes=n_nodes, - subset_updates_pos_store=interaction_update_positions, - ) - - assert safe_isinstance(edge_tree, ["shapiq.tree.base.EdgeTree"]) - - -def test_sklean_dt_conversion(dt_reg_model, dt_clf_model): - """Test the conversion of a scikit-learn decision tree model.""" - # test regression model - tree_model_class_path_str = ["shapiq.tree.base.TreeModel"] - tree_model = convert_sklearn_tree(dt_reg_model) - assert safe_isinstance(tree_model, tree_model_class_path_str) - assert tree_model.empty_prediction is not None - - # test scaling - tree_model = convert_sklearn_tree(dt_reg_model, scaling=0.5) - assert safe_isinstance(tree_model, tree_model_class_path_str) - assert tree_model.empty_prediction is not None - - # test classification model with class label - tree_model = convert_sklearn_tree(dt_clf_model, class_label=0) - assert safe_isinstance(tree_model, tree_model_class_path_str) - assert tree_model.empty_prediction is not None - - # test classification model without class label - tree_model = convert_sklearn_tree(dt_clf_model) - assert safe_isinstance(tree_model, tree_model_class_path_str) - assert tree_model.empty_prediction is not None - - -def test_skleanr_rf_conversion(rf_clf_model, rf_reg_model): - """Test the conversion of a scikit-learn random forest model.""" - tree_model_class_path_str = ["shapiq.tree.base.TreeModel"] - - # test the regression model - tree_model = convert_random_forest_tree(rf_reg_model) - assert isinstance(tree_model, list) - assert safe_isinstance(tree_model[0], tree_model_class_path_str) - assert tree_model[0].empty_prediction is not None - - # test the classification model - tree_model = convert_random_forest_tree(rf_clf_model) - assert isinstance(tree_model, list) - assert safe_isinstance(tree_model[0], tree_model_class_path_str) - assert tree_model[0].empty_prediction is not None - - -def test_sklearn_if_conversion(if_clf_model): - """Test the conversion of a scikit-learn isolation forest model.""" - tree_model_class_path_str = ["shapiq.tree.base.TreeModel"] - - # test the isolation forest model - tree_model = convert_isolation_forest_tree(if_clf_model) - assert isinstance(tree_model, list) - assert safe_isinstance(tree_model[0], tree_model_class_path_str) - assert tree_model[0].empty_prediction is not None - - -@pytest.mark.external_libraries -@pytest.mark.parametrize(("model_fixture", "model_class"), TREE_MODEL_FIXTURES) -def test_conversion_predict_identity(model_fixture, model_class, background_reg_data, request): - """Tests whether the conversion of the model to a tree explainer is correct.""" - if model_class not in SUPPORTED_MODELS: - pytest.skip( - f"skipped test, {model_class} not in the supported models for the tree explainer.", - ) - else: - model = request.getfixturevalue(model_fixture) - predict_function, _ = get_predict_function_and_model_type(model, model_class) - original_pred = predict_function(model, background_reg_data) - tree_explainer = TreeExplainer(model=model, max_order=1, min_order=1, index="SV") - for index in range(len(background_reg_data)): - sv = tree_explainer.explain(background_reg_data[index]) - prediction = sum(sv.values) - if sv[()] == 0: - prediction += sv.baseline_value - original_pred_value = original_pred[index] - if pytest.approx(prediction, abs=1e-4) == original_pred_value: - assert True - else: - if True: - # xgboost sometimes predicts a different value - # see .test_tree_bugfix.test_xgb_predicts_with_wrong_leaf_node - continue - msg = "Prediction does not match the original prediction." - raise AssertionError(msg) - - -def test_tree_model_predict( - background_reg_dataset, - dt_reg_model, - background_clf_dataset, - dt_clf_model, -): - """Tests weather the tree model predict_one is correct.""" - X_reg, _ = background_reg_dataset - X_clf, _ = background_clf_dataset - predictions_reg = dt_reg_model.predict(X_reg) - predictions_clf = dt_clf_model.predict_proba(X_clf)[:, 0] - - # convert - tree_model_reg = convert_sklearn_tree(dt_reg_model) - tree_model_clf = convert_sklearn_tree(dt_clf_model, class_label=0) - - # test prediction - for i in range(len(predictions_reg)): - assert tree_model_reg.predict_one(X_reg[i]) == predictions_reg[i] - - # test prediction - for i in range(len(predictions_clf)): - assert tree_model_clf.predict_one(X_clf[i]) == predictions_clf[i] diff --git a/tests/shapiq/tests_unit/tests_explainer/tests_tree_explainer/test_tree_explainer_utils.py b/tests/shapiq/tests_unit/tests_explainer/tests_tree_explainer/test_tree_explainer_utils.py deleted file mode 100644 index 6259043f5..000000000 --- a/tests/shapiq/tests_unit/tests_explainer/tests_tree_explainer/test_tree_explainer_utils.py +++ /dev/null @@ -1,34 +0,0 @@ -"""This test module collects all tests for the utility functions of the tree explainer.""" - -from __future__ import annotations - -import numpy as np - -from shapiq.tree.utils import ( - compute_empty_prediction, - get_conditional_sample_weights, -) - - -def test_compute_empty_prediction(): - """Test the compute_empty_prediction function.""" - values = np.asarray([100, 200, 300, 400, 500]) - sample_weights = np.asarray([1.0, 0.5, 0.25, 0.25, 0.5]) - is_leaf = np.asarray([False, False, True, True, True]) - leaf_values = values[is_leaf] - leaf_sample_weights = sample_weights[is_leaf] - empty_prediction = compute_empty_prediction(leaf_values, leaf_sample_weights) - assert empty_prediction == 425.0 - - -def test_conditional_sample_weights(): - """Test the conditional sample utils function.""" - par_arr = [-1, 0, 1, 1, 0, 4, 4] - par_arr = np.asarray(par_arr) - count_arr = [100, 70, 50, 20, 30, 15, 15] - count_arr = np.asarray(count_arr) - - weights = get_conditional_sample_weights(parent_array=par_arr, sample_count=count_arr) - assert weights[0] == 1.0 - assert weights[2] == 50 / 70 - assert weights[5] == 0.5 diff --git a/tests/shapiq/tests_unit/tests_explainer/tests_tree_explainer/test_tree_explainer_validate.py b/tests/shapiq/tests_unit/tests_explainer/tests_tree_explainer/test_tree_explainer_validate.py deleted file mode 100644 index 89ed65829..000000000 --- a/tests/shapiq/tests_unit/tests_explainer/tests_tree_explainer/test_tree_explainer_validate.py +++ /dev/null @@ -1,49 +0,0 @@ -"""This test module contains all tests for the validation functions of the tree explainer implementation.""" - -from __future__ import annotations - -import pytest - -from shapiq import safe_isinstance -from shapiq.tree.validation import SUPPORTED_MODELS, validate_tree_model -from tests.shapiq.conftest import TREE_MODEL_FIXTURES - - -def test_validate_model(dt_clf_model, dt_reg_model, rf_reg_model, rf_clf_model, if_clf_model): - """Test the validation of the model.""" - class_path_str = ["shapiq.tree.base.TreeModel"] - # sklearn dt models are supported - tree_model = validate_tree_model(dt_clf_model) - assert safe_isinstance(tree_model[0], class_path_str) - tree_model = validate_tree_model(dt_reg_model) - assert safe_isinstance(tree_model[0], class_path_str) - # sklearn rf models are supported - tree_model = validate_tree_model(rf_clf_model) - for tree in tree_model: - assert safe_isinstance(tree, class_path_str) - tree_model = validate_tree_model(rf_reg_model) - for tree in tree_model: - assert safe_isinstance(tree, class_path_str) - # sklearn isolation forest is supported - tree_model = validate_tree_model(if_clf_model) - for tree in tree_model: - assert safe_isinstance(tree, class_path_str) - - # test the unsupported model - with pytest.raises(TypeError): - validate_tree_model("unsupported_model") - - -@pytest.mark.external_libraries -@pytest.mark.parametrize(("model_fixture", "model_class"), TREE_MODEL_FIXTURES) -def test_validate_model_fixtures(model_fixture, model_class, request): - """Test the validation of the model fixtures.""" - if model_class not in SUPPORTED_MODELS: - return - model = request.getfixturevalue(model_fixture) - class_path_str = ["shapiq.tree.base.TreeModel"] - tree_model = validate_tree_model(model) - if type(tree_model) is not list: - tree_model = [tree_model] - for tree in tree_model: - assert safe_isinstance(tree, class_path_str) diff --git a/tests/shapiq/tests_unit/tests_explainer/tests_tree_explainer/test_tree_treeshapiq.py b/tests/shapiq/tests_unit/tests_explainer/tests_tree_explainer/test_tree_treeshapiq.py deleted file mode 100644 index ff0b869d3..000000000 --- a/tests/shapiq/tests_unit/tests_explainer/tests_tree_explainer/test_tree_treeshapiq.py +++ /dev/null @@ -1,166 +0,0 @@ -"""This module contains all tests for the TreeExplainer class of the shapiq package.""" - -from __future__ import annotations - -import numpy as np -import pytest - -from shapiq.tree import TreeExplainer, TreeModel, TreeSHAPIQ - - -def test_init(dt_clf_model, background_clf_data): - """Test the initialization of the TreeExplainer class.""" - explainer = TreeSHAPIQ(model=dt_clf_model, max_order=1, index="SII", verbose=True) - - x_explain = background_clf_data[0] - _ = explainer.explain(x_explain) - - explainer = TreeSHAPIQ(model=dt_clf_model, max_order=1, index="k-SII") - x_explain = background_clf_data[0] - _ = explainer.explain(x_explain) - - # test with dict input as tree - tree_model = { - "children_left": np.asarray([1, 2, 3, -1, -1, -1, 7, -1, -1]), - "children_right": np.asarray([6, 5, 4, -1, -1, -1, 8, -1, -1]), - "children_missing": np.asarray([1, 2, 3, -1, -1, -1, 7, -1, -1]), - "features": np.asarray([0, 1, 0, -2, -2, -2, 2, -2, -2]), - "thresholds": np.asarray([0, 0, -0.5, -2, -2, -2, 0, -2, -2]), - "node_sample_weight": np.asarray([100, 50, 38, 15, 23, 12, 50, 20, 30]), - "values": np.asarray([110, 105, 95, 20, 50, 100, 75, 10, 40]), - } - explainer = TreeSHAPIQ(model=tree_model, max_order=1, index="SII") - x_explain = np.asarray([-1, -0.5, 1, 0]) - _ = explainer.explain(x_explain) - - assert True - - -@pytest.mark.parametrize( - ("index", "expected"), - [ - ( - "SII", - { - (0,): -10.18947368, - (1,): -13.31052632, - (2,): 3.0, - (0, 1): -11.77894737, - (0, 2): -6.0, - (1, 2): 0, - }, - ), - ( - "BII", - { - (0,): -10.18947368, - (1,): -13.31052632, - (2,): 3.0, - (0, 1): -11.77894737, - (0, 2): -6.0, - (1, 2): 0, - }, - ), - ( - "FSII", - { - (0,): -39.45789474, - (1,): -45.82105263, - (2,): 6.0, - (0, 1): -11.77894737, - (0, 2): -6.0, - (1, 2): 0, - }, - ), - ( - "STII", - { - (0,): -20.37894737, - (1,): -26.62105263, - (2,): 6.0, - (0, 1): -11.77894737, - (0, 2): -6.0, - (1, 2): 0, - }, - ), - ], -) -def test_against_old_treeshapiq_implementation(index: str, expected: dict): - """Test the tree explainer against the old TreeSHAP-IQ implementation's results.""" - # manual values for a tree to test against the original treeshapiq implementation - children_left = np.asarray([1, 2, 3, -1, -1, -1, 7, -1, -1]) - children_right = np.asarray([6, 5, 4, -1, -1, -1, 8, -1, -1]) - features = np.asarray([0, 1, 0, -2, -2, -2, 2, -2, -2]) - thresholds = np.asarray([0, 0, -0.5, -2, -2, -2, 0, -2, -2]) - node_sample_weight = np.asarray([100, 50, 38, 15, 23, 12, 50, 20, 30]) - values = np.asarray([110, 105, 95, 20, 50, 100, 75, 10, 40]) - - x_explain = np.asarray([-1, -0.5, 1, 0]) - - tree_model = TreeModel( - children_left=children_left, - children_right=children_right, - children_missing=children_left, - features=features, - thresholds=thresholds, - node_sample_weight=node_sample_weight, - values=values, - ) - - explainer = TreeSHAPIQ(model=tree_model, max_order=2, index=index) - - explanation = explainer.explain(x_explain) - - for key, value in expected.items(): - assert np.isclose(explanation[key], value, atol=1e-5) - - -def test_edge_case_params(): - """Test the TreeSHAPIQ class with edge case parameters.""" - children_left = np.asarray([1, 2, 3, -1, -1, -1, 7, -1, -1]) - children_right = np.asarray([6, 5, 4, -1, -1, -1, 8, -1, -1]) - features = np.asarray([0, 1, 0, -2, -2, -2, 2, -2, -2]) - thresholds = np.asarray([0, 0, -0.5, -2, -2, -2, 0, -2, -2]) - node_sample_weight = np.asarray([100, 50, 38, 15, 23, 12, 50, 20, 30]) - values = np.asarray([110, 105, 95, 20, 50, 100, 75, 10, 40]) - - tree_model = TreeModel( - children_left=children_left, - children_right=children_right, - children_missing=children_left, # intentionally set to left_children to test if it is ignored - features=features, - thresholds=thresholds, - node_sample_weight=node_sample_weight, - values=values, - ) - - # test with max_order = 0 - with pytest.raises(ValueError): - _ = TreeSHAPIQ(model=tree_model, max_order=0) - - -def test_no_bug_with_one_feature_tree(): - """Test that the TreeExplainer does not raise an error with a tree that has only one feature.""" - # create the dataset - X = np.array( - [ - [1, 1, 1, 1], - [1, 1, 1, 2], - [2, 1, 1, 1], - [3, 2, 1, 1], - ], - ) - - # Define simple one feature tree - tree = { - "children_left": np.array([1, -1, -1]), - "children_right": np.array([2, -1, -1]), - "children_missing": np.array([1, -1, -1]), - "features": np.array([0, -2, -2]), - "thresholds": np.array([2.5, -2, -2]), - "values": np.array([0.5, 0.0, 1]), - "node_sample_weight": np.array([14, 5, 9]), - } - tree = TreeModel(**tree) - explainer = TreeExplainer(model=tree, index="SV", max_order=1) - explainer.explain(X[2]) diff --git a/tests/shapiq/tests_unit/tests_explainer/tests_tree_explainer/test_treeshapiq_lineartreeshap.py b/tests/shapiq/tests_unit/tests_explainer/tests_tree_explainer/test_treeshapiq_lineartreeshap.py deleted file mode 100644 index 558ec5a85..000000000 --- a/tests/shapiq/tests_unit/tests_explainer/tests_tree_explainer/test_treeshapiq_lineartreeshap.py +++ /dev/null @@ -1,116 +0,0 @@ -"""This module contains all tests for the TreeSHAPIQ class of the shapiq package.""" - -from __future__ import annotations - -import numpy as np - -from shapiq.tree.linear import LinearTreeSHAP -from shapiq.tree.treeshapiq import TreeSHAPIQ - - -def test_linear_tree_shap_dt_clf(dt_clf_model, background_clf_data): - """Test the LinearTreeSHAP explainer on a simple tree model.""" - - lineartreeshap = LinearTreeSHAP(model=dt_clf_model) - treeshapiq = TreeSHAPIQ(model=dt_clf_model, max_order=1, index="SV") - x_explain = background_clf_data[0] - shap_values = lineartreeshap.explain_function(x_explain) - shap_values_treeshapiq = treeshapiq.explain(x_explain) - - for interaction, value in shap_values_treeshapiq.interactions.items(): - assert interaction in shap_values.interactions, ( - f"Interaction {interaction} is missing in LinearTreeSHAP results" - ) - assert np.isclose(shap_values.interactions[interaction], value, atol=1e-6), ( - f"Interaction {interaction} has different values: {shap_values.interactions[interaction]} vs {value}" - ) - - -def test_linear_tree_shap_dt_reg(dt_reg_model, background_reg_data): - """Test the LinearTreeSHAP explainer on a simple tree model.""" - - lineartreeshap = LinearTreeSHAP(model=dt_reg_model) - treeshapiq = TreeSHAPIQ(model=dt_reg_model, max_order=1, index="SV") - x_explain = background_reg_data[0] - shap_values = lineartreeshap.explain_function(x_explain) - shap_values_treeshapiq = treeshapiq.explain(x_explain) - - for interaction, value in shap_values_treeshapiq.interactions.items(): - assert interaction in shap_values.interactions, ( - f"Interaction {interaction} is missing in LinearTreeSHAP results" - ) - assert np.isclose(shap_values.interactions[interaction], value, atol=1e-6), ( - f"Interaction {interaction} has different values: {shap_values.interactions[interaction]} vs {value}" - ) - - -def test_linear_tree_shap_lgbm_clf(lightgbm_clf_model, background_clf_data): - """Test the LinearTreeSHAP explainer on a simple tree model.""" - - lineartreeshap = LinearTreeSHAP(model=lightgbm_clf_model) - treeshapiq = TreeSHAPIQ(model=lightgbm_clf_model, max_order=1, index="SV") - x_explain = background_clf_data[0] - shap_values = lineartreeshap.explain_function(x_explain) - shap_values_treeshapiq = treeshapiq.explain(x_explain) - - for interaction, value in shap_values_treeshapiq.interactions.items(): - assert interaction in shap_values.interactions, ( - f"Interaction {interaction} is missing in LinearTreeSHAP results" - ) - assert np.isclose(shap_values.interactions[interaction], value, atol=1e-6), ( - f"Interaction {interaction} has different values: {shap_values.interactions[interaction]} vs {value}" - ) - - -def test_linear_tree_shap_lgbm_reg(lightgbm_reg_model, background_reg_data): - """Test the LinearTreeSHAP explainer on a simple tree model.""" - - lineartreeshap = LinearTreeSHAP(model=lightgbm_reg_model) - treeshapiq = TreeSHAPIQ(model=lightgbm_reg_model, max_order=1, index="SV") - x_explain = background_reg_data[0] - shap_values = lineartreeshap.explain_function(x_explain) - shap_values_treeshapiq = treeshapiq.explain(x_explain) - - for interaction, value in shap_values_treeshapiq.interactions.items(): - assert interaction in shap_values.interactions, ( - f"Interaction {interaction} is missing in LinearTreeSHAP results" - ) - assert np.isclose(shap_values.interactions[interaction], value, atol=1e-6), ( - f"Interaction {interaction} has different values: {shap_values.interactions[interaction]} vs {value}" - ) - - -def test_linear_tree_shap_xgb_clf(xgb_clf_model, background_clf_data): - """Test the LinearTreeSHAP explainer on a simple tree model.""" - - lineartreeshap = LinearTreeSHAP(model=xgb_clf_model) - treeshapiq = TreeSHAPIQ(model=xgb_clf_model, max_order=1, index="SV") - x_explain = background_clf_data[0] - shap_values = lineartreeshap.explain_function(x_explain) - shap_values_treeshapiq = treeshapiq.explain(x_explain) - - for interaction, value in shap_values_treeshapiq.interactions.items(): - assert interaction in shap_values.interactions, ( - f"Interaction {interaction} is missing in LinearTreeSHAP results" - ) - assert np.isclose(shap_values.interactions[interaction], value, atol=1e-6), ( - f"Interaction {interaction} has different values: {shap_values.interactions[interaction]} vs {value}" - ) - - -def test_linear_tree_shap_xgb_reg(xgb_reg_model, background_reg_data): - """Test the LinearTreeSHAP explainer on a simple tree model.""" - - lineartreeshap = LinearTreeSHAP(model=xgb_reg_model) - treeshapiq = TreeSHAPIQ(model=xgb_reg_model, max_order=1, index="SV") - x_explain = background_reg_data[0] - shap_values = lineartreeshap.explain_function(x_explain) - shap_values_treeshapiq = treeshapiq.explain(x_explain) - - for interaction, value in shap_values_treeshapiq.interactions.items(): - assert interaction in shap_values.interactions, ( - f"Interaction {interaction} is missing in LinearTreeSHAP results" - ) - assert np.isclose(shap_values.interactions[interaction], value, atol=1e-6), ( - f"Interaction {interaction} has different values: {shap_values.interactions[interaction]} vs {value}" - ) diff --git a/tests/shapiq/tests_unit/tests_game_theory/__init__.py b/tests/shapiq/tests_unit/tests_game_theory/__init__.py deleted file mode 100644 index da32588c2..000000000 --- a/tests/shapiq/tests_unit/tests_game_theory/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Tests for the game theory module.""" diff --git a/tests/shapiq/tests_unit/tests_game_theory/test_aggregation.py b/tests/shapiq/tests_unit/tests_game_theory/test_aggregation.py deleted file mode 100644 index 720be56ff..000000000 --- a/tests/shapiq/tests_unit/tests_game_theory/test_aggregation.py +++ /dev/null @@ -1,71 +0,0 @@ -"""Tests the approximiation of k-SII values with PermutationSamplingSII and SHAPIQ.""" - -from __future__ import annotations - -import numpy as np -import pytest - -from shapiq.approximator import ( - SHAPIQ, - PermutationSamplingSII, -) -from shapiq.game_theory.aggregation import aggregate_to_one_dimension -from shapiq_games.synthetic import DummyGame - - -@pytest.mark.parametrize( - ("sii_approximator", "ksii_approximator"), - [ - ( - PermutationSamplingSII(7, 2, "SII", top_order=False, random_state=42), - PermutationSamplingSII(7, 2, "k-SII", top_order=False, random_state=42), - ), - ( - SHAPIQ(7, 2, "SII", top_order=False, random_state=42), - SHAPIQ(7, 2, "k-SII", top_order=False, random_state=42), - ), - ], -) -def test_k_sii_estimation(sii_approximator, ksii_approximator): - """Tests the approximation of k-SII values with PermutationSamplingSII and ShapIQ.""" - n = 7 - interaction = (1, 2) - game = DummyGame(n, interaction) - sii_estimates = sii_approximator.approximate(1_000, game) - ksii_estimates = ksii_approximator.approximate(1_000, game) - assert sii_estimates != ksii_estimates - assert ksii_estimates.index == "k-SII" - - k_sii_transformed = ksii_approximator.aggregate_interaction_values(sii_estimates) - assert k_sii_transformed.index == "k-SII" - assert k_sii_transformed == ksii_estimates # check weather transform and estimation are equal - - # k-SII values for player 1 and 2 should be approximately 0.1429 and the interaction 1.0 - assert ksii_estimates[(1,)] == pytest.approx(0.1429, 0.4) - assert ksii_estimates[(2,)] == pytest.approx(0.1429, 0.4) - assert ksii_estimates[(1, 2)] == pytest.approx(1.0, 0.2) - # the sum should be 2.0 - efficiency = np.sum(ksii_estimates.values) - assert efficiency == pytest.approx(2.0, 0.01) - - -def test_k_one_dim_aggregate(): - """Tests the aggregation of k-SII values to one dimension.""" - n = 7 - interaction = (1, 2) - game = DummyGame(n, interaction) - estimator = SHAPIQ(7, 2, "k-SII", top_order=False, random_state=42) - k_sii_estimates = estimator.approximate(2**n, game) - - efficiency = np.sum(k_sii_estimates.values) - - # check one dim transform - pos_values, neg_values = aggregate_to_one_dimension(k_sii_estimates) - assert pos_values.shape == (n,) - assert neg_values.shape == (n,) - assert np.all(pos_values >= 0) - assert np.all(neg_values <= 0) - sum_of_both = np.sum(pos_values) + np.sum(neg_values) - - assert sum_of_both == pytest.approx(efficiency, 0.01) - assert sum_of_both != pytest.approx(0.0, 0.01) diff --git a/tests/shapiq/tests_unit/tests_game_theory/test_core.py b/tests/shapiq/tests_unit/tests_game_theory/test_core.py deleted file mode 100644 index fb6306515..000000000 --- a/tests/shapiq/tests_unit/tests_game_theory/test_core.py +++ /dev/null @@ -1,197 +0,0 @@ -"""This test module tests the core calculations.""" - -from __future__ import annotations - -import numpy as np -import pytest - -import shapiq -from shapiq.game_theory.core import egalitarian_least_core -from shapiq.utils import powerset -from shapiq_games.synthetic.soum import SOUM - - -def test_core_on_soum(): - """Tests the core on a SOUM game.""" - for _ in range(20): - n = np.random.randint(low=2, high=10) - n_basis_games = np.random.randint(low=1, high=100) - soum = SOUM(n, n_basis_games=n_basis_games) - - coalition_lookup = {} - coalition_matrix = np.zeros((2**n, n), dtype=bool) - grand_coalition_set = set(range(n)) - for i, T in enumerate(powerset(grand_coalition_set, min_size=0, max_size=n)): - coalition_lookup[T] = i # set lookup for the coalition - coalition_matrix[i, T] = True # one-hot-encode the coalition - game_values = soum(coalition_matrix) # compute the game values - baseline_value = float(game_values[0]) # set the baseline value - - predicted_value = soum(np.ones(n))[0] # value of grand coalition - - egalitarian_vector, subsidy = egalitarian_least_core( - n_players=n, - game_values=game_values, - coalition_lookup=coalition_lookup, - ) - - # Assert efficiency - assert (np.sum(egalitarian_vector.values) + baseline_value - predicted_value) ** 2 < 10e-7 - - stability_equations = coalition_matrix[:-1] @ egalitarian_vector.values + subsidy - game_values = game_values[:-1] - baseline_value - - # Assert stability - assert np.all(stability_equations - game_values >= -10e-7) - - -def test_core_on_normalized_soum(): - """Tests the core on a normalized SOUM game.""" - for _ in range(20): - n = np.random.randint(low=2, high=10) - n_basis_games = np.random.randint(low=1, high=100) - soum = SOUM(n, n_basis_games=n_basis_games, normalize=True) - - coalition_lookup = {} - coalition_matrix = np.zeros((2**n, n), dtype=bool) - grand_coalition_set = set(range(n)) - for i, T in enumerate(powerset(grand_coalition_set, min_size=0, max_size=n)): - coalition_lookup[T] = i - coalition_matrix[i, T] = True # one-hot-encode the coalition - game_values = soum(coalition_matrix) # compute the game values - predicted_value = soum(np.ones(n))[0] # value of grand coalition - - egalitarian_vector, subsidy = egalitarian_least_core( - n_players=n, - game_values=game_values, - coalition_lookup=coalition_lookup, - ) - - # Assert efficiency. - assert (np.sum(egalitarian_vector.values) - predicted_value) ** 2 < 10e-7 - - stability_equations = coalition_matrix[:-1] @ egalitarian_vector.values + subsidy - game_values = game_values[:-1] - - # Assert stability - assert np.all(stability_equations - game_values >= -10e-7) - - -def test_core_political_game_empty_core(): - """Tests that core is empty for non-convex game and egalitarian least-core has subsidy=33.3. - - The political game tested here is constructed such that the core is [33.3, 33.3, 33.3] with - subsidy 33.3. This is due to all coalitions with at least two players gets 100. - - """ - - class NonConvexGame(shapiq.Game): - def __init__(self) -> None: - super().__init__(n_players=3, normalize=True, normalization_value=0) - - def value_function(self, coalitions: np.ndarray) -> np.ndarray: - coalition_values = { - (): 0, - (0,): 0, - (1,): 0, - (2,): 0, - (0, 1): 100, - (0, 2): 100, - (1, 2): 100, - (0, 1, 2): 100, - } - - return np.array([coalition_values[tuple(np.where(x)[0])] for x in coalitions]) - - game_political = NonConvexGame() - coalition_lookup = {} - coalition_matrix = np.zeros((2**game_political.n_players, game_political.n_players), dtype=bool) - grand_coalition_set = set(range(3)) - for i, T in enumerate( - powerset(grand_coalition_set, min_size=0, max_size=game_political.n_players), - ): - coalition_lookup[T] = i # set lookup for the coalition - coalition_matrix[i, T] = True # one-hot-encode the coalition - game_values = game_political(coalition_matrix) # compute the game values - baseline_value = float(game_values[0]) # set the baseline value - - predicted_value = game_political(np.ones(3))[0] # value of grand coalition - - egalitarian_vector, subsidy = egalitarian_least_core( - n_players=3, - game_values=game_values, - coalition_lookup=coalition_lookup, - ) - # Assert correct values - assert np.all(egalitarian_vector.values - np.array([100 / 3, 100 / 3, 100 / 3]) < 10e-7) - assert subsidy - 100 / 3 < 10e-7 - - # Assert efficiency - assert (np.sum(egalitarian_vector.values) + baseline_value - predicted_value) ** 2 < 10e-7 - - -def test_core_baseline_warning(): - """Tests that a warning is raised when the baseline value is not 0.""" - game_values = np.array([10, 5, 20, 100]) - - with pytest.warns(UserWarning): - egalitarian_least_core( - n_players=2, - game_values=game_values, - coalition_lookup={(): 0, (0,): 1, (1,): 2, (0, 1): 3}, - ) - - -def test_core_political_game_existing_core(): - """Tests that the ELC is equal to the core with subsidy equal to 0, due to convex game structure.""" - - class ConvexGame(shapiq.Game): - """A 3-player political game with a convex structure. - - This game is a convex game, i.e. meaning that the v(S u {i}) - v(S) <= v(T u {i}) - v(T) for - S<=T<={1,..,n} setminus {i}. The marginal contribution of a player i is always bigger if it - joins a bigger coalition. - """ - - def __init__(self) -> None: - super().__init__(n_players=3, normalize=True, normalization_value=0) - - def value_function(self, coalitions: np.ndarray) -> np.ndarray: - coalition_values = { - (): 0, - (0,): 0, - (1,): 0, - (2,): 0, - (0, 1): 100, - (0, 2): 100, - (1, 2): 100, - (0, 1, 2): 200, - } - - return np.array([coalition_values[tuple(np.where(x)[0])] for x in coalitions]) - - game_political = ConvexGame() - coalition_lookup = {} - coalition_matrix = np.zeros((2**game_political.n_players, game_political.n_players), dtype=bool) - grand_coalition_set = set(range(3)) - for i, T in enumerate( - powerset(grand_coalition_set, min_size=0, max_size=game_political.n_players), - ): - coalition_lookup[T] = i # set lookup for the coalition - coalition_matrix[i, T] = True # one-hot-encode the coalition - game_values = game_political(coalition_matrix) # compute the game values - baseline_value = float(game_values[0]) # set the baseline value - - predicted_value = game_political(np.ones(3))[0] # value of grand coalition - - egalitarian_vector, subsidy = egalitarian_least_core( - n_players=3, - game_values=game_values, - coalition_lookup=coalition_lookup, - ) - # Assert correct values - assert np.all(egalitarian_vector.values - np.array([200 / 3, 200 / 3, 200 / 3]) < 10e-7) - pytest.approx(subsidy, rel=0, abs=1e-5) - - # Assert efficiency - assert (np.sum(egalitarian_vector.values) + baseline_value - predicted_value) ** 2 < 10e-7 diff --git a/tests/shapiq/tests_unit/tests_game_theory/test_exact_computer.py b/tests/shapiq/tests_unit/tests_game_theory/test_exact_computer.py deleted file mode 100644 index 22abfe2e6..000000000 --- a/tests/shapiq/tests_unit/tests_game_theory/test_exact_computer.py +++ /dev/null @@ -1,494 +0,0 @@ -"""This test module tests the ExactComputer class.""" - -from __future__ import annotations - -import numpy as np -import pytest - -from shapiq import powerset -from shapiq.game_theory.exact import ExactComputer -from shapiq.game_theory.moebius_converter import MoebiusConverter -from shapiq_games.synthetic.soum import SOUM - - -def test_exact_computer_on_soum(): - """Tests the ExactComputer on the SOUM game.""" - for _ in range(10): - n = np.random.randint(low=2, high=10) - order = np.random.randint(low=1, high=min(n, 5)) - n_basis_games = np.random.randint(low=1, high=100) - soum = SOUM(n, n_basis_games=n_basis_games) - - predicted_value = soum(np.ones(n, dtype=bool))[0] - - # Compute via exactComputer - exact_computer = ExactComputer(game=soum, n_players=n) - - # Compute via sparse Möbius representation - moebius_converter = MoebiusConverter(soum.moebius_coefficients) - moebius_transform = exact_computer.moebius_transform - - # Assert equality with ground truth Möbius coefficients from SOUM - assert np.sum((moebius_transform - soum.moebius_coefficients).values ** 2) < 10e-7 - - # Compare ground truth via MoebiusConvert with exact computation of ExactComputer - gt = moebius_converter(index="k-SII", order=order) - exact = exact_computer.shapley_interactions(index="k-SII", order=order) - # Check equality with ground truth calculations from SOUM - assert np.sum((gt - exact).values ** 2) < 10e-7 - - jointsv = exact_computer.shapley_generalized_value(order=order) - assert (np.sum(jointsv.values) - predicted_value) ** 2 < 10e-7 # assert efficiency - - exact_computer.shapley_interactions(index="kADD-SHAP", order=order) - - for base_index in ("SII", "BII", "CHII", "Co-Moebius"): - exact_computer.shapley_base_interaction(order=order, index=base_index) - - for base_gv_index in ("SGV", "BGV", "CHGV", "IGV", "EGV"): - exact_computer.base_generalized_value(order=order, index=base_gv_index) - - sv = exact_computer.probabilistic_value(index="SV") - assert (np.sum(sv.values) - predicted_value) ** 2 < 10e-7 - - exact_computer.probabilistic_value(index="BV") - - -def test_exact_no_n_players(): - """Tests that you can create an ExactComputer without specifying n_players with a Game.""" - n = 5 - soum = SOUM(n, n_basis_games=10) - exact_computer = ExactComputer(game=soum) - assert exact_computer.n_players == n - - -def test_exact_no_n_players_error(): - """Tests that an error is raised if n_players is not specified and no game is provided.""" - - def _callable_function(x): - return np.sum(x, axis=1) - - with pytest.raises( - ValueError, match="n_players must be specified if game is not a Game object." - ): - ExactComputer(game=_callable_function) - - -@pytest.mark.parametrize( - ("index", "order"), - [("ELC", 1)], -) -def test_exact_elc_computer_call(index, order): - """Tests the call function for the ExactComputer.""" - n = 5 - soum = SOUM(n, n_basis_games=10, normalize=True) - exact_computer = ExactComputer(game=soum, n_players=n) - interaction_values = exact_computer(index=index, order=order) - if order is None: - order = n - assert interaction_values is not None # should return something - assert interaction_values.max_order == order # order should be the same - assert interaction_values.min_order == 1 # ELC only has singleton values - assert interaction_values.index == index # index should be the same - assert interaction_values.baseline_value == 0 # ELC needs baseline_value zero - assert interaction_values.estimated is False # nothing should be estimated - assert interaction_values.values is not None # values should be computed - assert exact_computer._elc_stability_subsidy is not None # ELC should have stored subsidy - - -@pytest.mark.parametrize( - ("index", "order"), - [ - ("SV", 1), - ("BV", 1), - ("SII", 2), - ("BII", 2), - ("CHII", 2), - ("Co-Moebius", 2), - ("SGV", 2), - ("BGV", 2), - ("CHGV", 2), - ("EGV", 2), - ("IGV", 2), - ("STII", 2), - ("k-SII", 2), - ("FSII", 2), - ("FBII", 2), - ("JointSV", 2), - ("kADD-SHAP", 2), - ("SII", None), - ], -) -def test_exact_computer_call(index, order): - """Tests the call function for the ExactComputer.""" - n = 5 - soum = SOUM(n, n_basis_games=10) - exact_computer = ExactComputer(game=soum, n_players=n) - interaction_values = exact_computer(index=index, order=order) - if order is None: - order = n - assert interaction_values is not None # should return something - assert interaction_values.max_order == order # order should be the same - assert interaction_values.index == index # index should be the same - assert interaction_values.estimated is False # nothing should be estimated - assert interaction_values.values is not None # values should be computed - - -def test_basic_functions(): - """Tests the basic functions of the ExactComputer.""" - n = 5 - soum = SOUM(n, n_basis_games=10) - exact_computer = ExactComputer(game=soum, n_players=n) - isinstance(repr(exact_computer), str) - isinstance(str(exact_computer), str) - - -def test_lazy_computation(): - """Tests if the lazy computation (calling without params) works.""" - n = 5 - soum = SOUM(n, n_basis_games=10) - exact_computer = ExactComputer(game=soum, n_players=n) - isinstance(repr(exact_computer), str) - isinstance(str(exact_computer), str) - sv = exact_computer("SV", 1) - assert sv.index == "SV" - assert sv.max_order == 1 - - -@pytest.fixture -def original_game(): - """This fixture returns a game function with interactions.""" - - def _game_fun(X: np.ndarray): - x_as_float = np.zeros_like(X, dtype=float) - x_as_float[X] = 1 - fist_order_coefficients = [0, 0.2, -0.1, -0.9, 0] - second_order_coefficients = np.asarray( - [ - [0, 0.4, 0, 0, 0], # interaction btw 0, 1; 1, 3 and 2, 4 - [0, 0, 0, 0.3, 0], - [0, 0, 0, 0, 1], - [0, 0, 0, 0, 0], - [0, 0, 0, 0, 0], - ], - ) - - def _interaction(arr: np.ndarray): # dtype bool - outer = np.outer(arr, arr) - interaction_array = second_order_coefficients.copy() - interaction_array[~outer] = 0 - return np.sum(interaction_array) - - value = np.sum(fist_order_coefficients * x_as_float, axis=1) - interaction_addition = np.apply_along_axis(_interaction, axis=1, arr=X) - return value + interaction_addition - - return _game_fun - - -@pytest.mark.parametrize( - ("index", "order"), - [ - ("SV", 1), - ("BV", 1), - ("SII", 2), - ("BII", 2), - ("CHII", 2), - ("Co-Moebius", 2), - ("SGV", 2), - ("BGV", 2), - ("CHGV", 2), - ("EGV", 2), - ("IGV", 2), - ("STII", 2), - ("k-SII", 2), - ("FSII", 2), - ("FBII", 2), - ("JointSV", 2), - ("kADD-SHAP", 2), - ("SII", None), - ], -) -def test_permutation_symmetry(index, order, original_game): - """This test checks that the values are invariant under permutations of the players.""" - n = 5 - if order is None: - order = n - permutation = (4, 1, 3, 2, 0) # order = 1, its own inverse - - def permutation_game(X: np.ndarray): - return original_game(X[:, permutation]) - - exact_computer = ExactComputer(game=original_game, n_players=n) - interaction_values = exact_computer(index=index, order=order) - - perm_exact_computer = ExactComputer(game=permutation_game, n_players=n) - perm_interaction_values = perm_exact_computer(index=index, order=order) - - # permutation does not matter - for coalition, value in interaction_values.dict_values.items(): - perm_coalition = tuple(sorted([permutation[player] for player in coalition])) - assert (value - perm_interaction_values[perm_coalition]) < 10e-7 - - -def test_warning_cii(): - """Checks weather a warning is raised for the CHII index and min_order = 0.""" - n = 5 - soum = SOUM(n, n_basis_games=10) - exact_computer = ExactComputer(game=soum, n_players=n) - with pytest.warns(UserWarning): - exact_computer("CHII", 0) - - # check that warning is not raised for min_order > 0 - exact_computer("CHII", 1) - - -@pytest.mark.parametrize( - ("index", "order"), - [ - ("SV", 1), - ("BV", 1), - ("SII", 2), - ("BII", 2), - ("CHII", 2), - ("Co-Moebius", 2), - ("Moebius", 2), - ("SGV", 2), - ("BGV", 2), - ("CHGV", 2), - ("EGV", 2), - ("IGV", 2), - ("STII", 2), - ("k-SII", 2), - ("FSII", 2), - ("FBII", 2), - ("JointSV", 2), - ("kADD-SHAP", 2), - ("SII", None), - ], -) -def test_player_symmetry(index, order): - """This test checks that the players with the same attribution get the same value.""" - n = 5 - if order is None: - order = n - - def _game_fun(X: np.ndarray): - x_as_float = np.zeros_like(X, dtype=float) - x_as_float[X] = 1 - fist_order_coefficients = [0.4, 0.2, -0.1, -0.9, 0.4] - second_order_coefficients = np.asarray( - [ - [0, 0.4, 0.1, 0, 0], # interaction btw 0, 1; 0, 2; 1, 4; 2, 4 - [0, 0, 0, 0, 0.4], - [0, 0, 0, 0, 0.1], - [0, 0, 0, 0, 0], - [0, 0, 0, 0, 0], - ], - ) - - def _interaction(arr: np.ndarray): # dtype bool - outer = np.outer(arr, arr) - interaction_array = second_order_coefficients.copy() - interaction_array[~outer] = 0 - return np.sum(interaction_array) - - value = np.sum(fist_order_coefficients * x_as_float, axis=1) - interaction_addition = np.apply_along_axis(_interaction, axis=1, arr=X) - return value + interaction_addition - - exact_computer = ExactComputer(game=_game_fun, n_players=n) - interaction_values = exact_computer(index=index, order=order) - - # symmetry of players with same attribution - for coalition in powerset(range(n - 2)): - coalition_with_first = (0, *tuple([player + 1 for player in coalition])) - coalition_with_last = (*tuple([player + 1 for player in coalition]), 4) - assert ( - interaction_values[coalition_with_first] - interaction_values[coalition_with_last] - ) < 10e-7 - - -@pytest.mark.parametrize( - ("index", "order"), - [ - ("SV", 1), - ("BV", 1), - ("SII", 2), - ("BII", 2), - ("CHII", 2), - ("Co-Moebius", 2), - ("STII", 2), - ("k-SII", 2), - ("FSII", 2), - ("FBII", 2), - ("kADD-SHAP", 2), - ("SII", None), - ], -) -def test_null_player(index, order): - """This test checks that the null players don't get any attribution in the values.""" - n = 5 - if order is None: - order = n - - # game with 0, 4 as null players, has interactions - def _game_fun(X: np.ndarray): - x_as_float = np.zeros_like(X, dtype=float) - x_as_float[X] = 1 - fist_order_coefficients = [0, 0.2, -0.1, -0.9, 0] - second_order_coefficients = np.asarray( - [ - [0, 0, 0, 0, 0], - [0, 0, 0, 0.3, 0], - [0, 0, 0, 0.4, 0], - [0, 0, 0, 0, 0], - [0, 0, 0, 0, 0], - ], - ) - - def _interaction(arr: np.ndarray): # dtype bool - outer = np.outer(arr, arr) - interaction_array = second_order_coefficients.copy() - interaction_array[~outer] = 0 - return np.sum(interaction_array) - - value = np.sum(fist_order_coefficients * x_as_float, axis=1) - interaction_addition = np.apply_along_axis(_interaction, axis=1, arr=X) - return value + interaction_addition - - exact_computer = ExactComputer(game=_game_fun, n_players=n) - interaction_values = exact_computer(index=index, order=order) - - # no attribution for coalitions which include the null players. - for coalition in powerset(range(n - 2)): - coalition_with_first = (0, *tuple([player + 1 for player in coalition])) - coalition_with_last = (*tuple([player + 1 for player in coalition]), 4) - assert interaction_values[coalition_with_first] < 10e-7 - assert interaction_values[coalition_with_last] < 10e-7 - - -@pytest.mark.parametrize( - ("index", "order"), - [ - ("SV", 1), - ("BV", 1), - ("SII", 2), - ("BII", 2), - ("CHII", 2), - ("Co-Moebius", 2), - ("STII", 2), - ("k-SII", 2), - ("FSII", 2), - ("FBII", 2), - ("kADD-SHAP", 2), - ("SII", None), - ], -) -def test_no_artefact_interaction(index, order): - """This test checks that the interactions are zero for the game without interactions.""" - n = 5 - if order is None: - order = n - - # game without interactions - def _game_fun(X: np.ndarray): - x_as_float = np.zeros_like(X, dtype=float) - x_as_float[X] = 1 - fist_order_coefficients = [0, 0.2, -0.1, -0.9, 0] - return np.sum(fist_order_coefficients * x_as_float, axis=1) - - exact_computer = ExactComputer(game=_game_fun, n_players=n) - interaction_values = exact_computer(index=index, order=order) - - for coalition, value in interaction_values.dict_values.items(): - if len(coalition) > 1: - assert value < 10e-7 - - -@pytest.mark.parametrize( - ("index", "order"), - [ - ("SGV", 2), - ("BGV", 2), - ("CHGV", 2), - ("EGV", 2), - ("IGV", 2), - ("JointSV", 2), - ], -) -def test_generalized_null_player(index, order): - """This test checks that the null players don't get any attribution in the generalized values.""" - # implicit in above test for the rest of the indices - n = 5 - if order is None: - order = n - - # game with 0, 4 as null players, has interactions - def _game_fun(X: np.ndarray): - x_as_float = np.zeros_like(X, dtype=float) - x_as_float[X] = 1 - fist_order_coefficients = [0, 0.2, -0.1, -0.9, 0] - second_order_coefficients = np.asarray( - [ - [0, 0, 0, 0, 0], - [0, 0, 0, 0.3, 0], - [0, 0, 0, 0.4, 0], - [0, 0, 0, 0, 0], - [0, 0, 0, 0, 0], - ], - ) - - def _interaction(arr: np.ndarray): # dtype bool - outer = np.outer(arr, arr) - interaction_array = second_order_coefficients.copy() - interaction_array[~outer] = 0 - return np.sum(interaction_array) - - value = np.sum(fist_order_coefficients * x_as_float, axis=1) - interaction_addition = np.apply_along_axis(_interaction, axis=1, arr=X) - return value + interaction_addition - - exact_computer = ExactComputer(game=_game_fun, n_players=n) - interaction_values = exact_computer(index=index, order=order) - - # no attribution for coalitions consisting of the null players. - assert interaction_values[(0, 4)] < 10e-7 - assert interaction_values[(0,)] < 10e-7 - assert interaction_values[(4,)] < 10e-7 - - -class TestWrongIndices: - """A class to test that wrong indices raise errors.""" - - exact_computer = ExactComputer(game=SOUM(5, n_basis_games=10)) - wrong_index = "WRONG_INDEX" - error_msg = f"Index {wrong_index} not supported." - - def test_call(self): - """Tests that calling with a wrong index raises an error.""" - with pytest.raises(ValueError, match="Index or value not supported."): - self.exact_computer(self.wrong_index, 2) # type: ignore[reportArgumentType] - - def test_fii(self): - """Tests that calling the FII function with a wrong index raises an error.""" - with pytest.raises(ValueError, match=self.error_msg): - self.exact_computer.compute_fii(self.wrong_index, 2) # type: ignore[reportArgumentType] - - def test_shapley_interactions(self): - """Tests that calling the shapley_interactions function with a wrong index raises an error.""" - with pytest.raises(ValueError, match=self.error_msg): - self.exact_computer.shapley_interactions(self.wrong_index, 2) # type: ignore[reportArgumentType] - - def test_probabilistic_value(self): - """Tests that calling the probabilistic_value function with a wrong index raises an error.""" - with pytest.raises(ValueError, match=self.error_msg): - self.exact_computer.probabilistic_value(self.wrong_index) # type: ignore[reportArgumentType] - - def test_private_weight_functions(self): - """Tests that calling private weight functions with a wrong index raises an error.""" - with pytest.raises(ValueError, match=self.error_msg): - self.exact_computer._base_weights(2, 2, self.wrong_index) # type: ignore[reportArgumentType] - - with pytest.raises(ValueError, match=self.error_msg): - self.exact_computer._get_fii_weights(self.wrong_index) # type: ignore[reportArgumentType] diff --git a/tests/shapiq/tests_unit/tests_game_theory/test_moebius_converter.py b/tests/shapiq/tests_unit/tests_game_theory/test_moebius_converter.py deleted file mode 100644 index 7570b0cc2..000000000 --- a/tests/shapiq/tests_unit/tests_game_theory/test_moebius_converter.py +++ /dev/null @@ -1,65 +0,0 @@ -"""This test module contains all tests regarding the Möbius converter class.""" - -from __future__ import annotations - -import numpy as np -import pytest - -from shapiq.game_theory.moebius_converter import MoebiusConverter -from shapiq_games.synthetic.soum import SOUM - - -def test_soum_moebius_conversion(): - """Test the basic funcitonality of the Möbius converter.""" - for _ in range(10): - n = np.random.randint(low=2, high=20) - order = np.random.randint(low=1, high=min(n, 5)) - n_basis_games = np.random.randint(low=1, high=100) - - soum = SOUM(n, n_basis_games=n_basis_games) - - predicted_value = soum(np.ones(n))[0] - emptyset_prediction = soum(np.zeros(n))[0] - - moebius_converter = MoebiusConverter(soum.moebius_coefficients) - - for index in ["STII", "k-SII", "FSII"]: - shapley_interactions = moebius_converter(index=index, order=order) - # Assert efficiency - assert (np.sum(shapley_interactions.values) - predicted_value) ** 2 < 10e-7 - assert (shapley_interactions[()] - emptyset_prediction) ** 2 < 10e-7 - for v in moebius_converter._computed.values(): - # check that no 0's are in the interaction lookup (except for the empty set, which is the first entry) - interactions = v.interactions - assert all(v != 0 for idx, v in enumerate(interactions.values()) if idx > 0) - - # test direct call of Möbius converter - for index in ["STII", "k-SII", "SII", "FSII"]: - moebius_converter(index=index, order=order) - - -@pytest.mark.parametrize("random_state", [10, 19, 20, 21, 23]) -def test_soum_moebius_conversion_failing_states(random_state): - """Test SOUM moebius conversion with specific failing random states.""" - order = 3 - n_basis_games = 1 - n = 7 - - soum = SOUM(n, n_basis_games=n_basis_games, random_state=random_state) - predicted_value = soum(np.ones(n))[0] - emptyset_prediction = soum(np.zeros(n))[0] - - moebius_converter = MoebiusConverter(soum.moebius_coefficients) - - for index in ["STII", "k-SII", "FSII"]: - shapley_interactions = moebius_converter(index=index, order=order) - # Assert efficiency - assert (np.sum(shapley_interactions.values) - predicted_value) ** 2 < 10e-7 - assert (shapley_interactions[()] - emptyset_prediction) ** 2 < 10e-7 - for v in moebius_converter._computed.values(): - interactions = v.interactions - # Check that no 0's are in the interaction values (except for empty set) - non_empty_values = [val for idx, val in enumerate(interactions.values()) if idx > 0] - assert all(val != 0 for val in non_empty_values), ( - f"Found zero values in non-empty interactions with random state {random_state}" - ) diff --git a/tests/shapiq/tests_unit/tests_games/__init__.py b/tests/shapiq/tests_unit/tests_games/__init__.py deleted file mode 100644 index 216bf2993..000000000 --- a/tests/shapiq/tests_unit/tests_games/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Tests for the game module.""" diff --git a/tests/shapiq/tests_unit/tests_games/test_base_game.py b/tests/shapiq/tests_unit/tests_games/test_base_game.py deleted file mode 100644 index 0ae86fa85..000000000 --- a/tests/shapiq/tests_unit/tests_games/test_base_game.py +++ /dev/null @@ -1,316 +0,0 @@ -"""This test module contains all tests for the base game class in the shapiq package.""" - -from __future__ import annotations - -import typing - -import numpy as np -import pytest - -from shapiq.game import Game -from shapiq.utils.sets import powerset, transform_coalitions_to_array -from shapiq_games.synthetic import DummyGame # used to test the base class - -if typing.TYPE_CHECKING: - from pathlib import Path - - -def test_call(): - """This test tests the call function of the base game class.""" - - class TestGame(Game): - """A simple test game that implements the value function.""" - - def __init__(self, n, **kwargs): - super().__init__(n_players=n, normalization_value=0, **kwargs) - - def value_function(self, coalition): - return np.sum(coalition) / self.n_players - - n_players = 6 - test_game = TestGame( - n=n_players, - player_names=["Alice", "Bob", "Charlie", "David", "Eve", "Frank"], - ) - - # assert that player names are correctly stored - assert test_game.player_name_lookup == { - "Alice": 0, - "Bob": 1, - "Charlie": 2, - "David": 3, - "Eve": 4, - "Frank": 5, - } - - assert test_game([]) == 0.0 - - # test coalition calls with wrong datatype - with pytest.raises(TypeError): - assert test_game([(0, 1), "Alice", "Charlie"]) - with pytest.raises(TypeError): - assert test_game([(0, 1), ("Alice",), ("Bob",)]) - with pytest.raises(TypeError): - assert test_game(("Alice", 1)) - - # test wrong coalition size in call - with pytest.raises(TypeError): - assert test_game(np.array([True, False, True])) == 0.0 - with pytest.raises(TypeError): - assert test_game(np.array([])) == 0.0 - - # test wrong method for numpy array values - with pytest.raises(TypeError): - assert test_game(np.array([1, 2, 3, 4, 5, 6])) == 0.0 - - # test wrong coalition size in shape[1] - with pytest.raises(TypeError): - assert test_game(np.array([[True, False, True]])) == 0.0 - - # test with empty coalition all call variants - test_coalition = test_game.empty_coalition - assert test_game(test_coalition) == 0.0 - assert test_game(()) == 0.0 - assert test_game([()]) == 0.0 - - # test with grand coalition all call variants - test_coalition = test_game.grand_coalition - assert test_game(test_coalition) == 1.0 - assert test_game(tuple(range(test_game.n_players))) == 1.0 - assert test_game([tuple(range(test_game.n_players))]) == 1.0 - assert test_game(tuple(test_game.player_name_lookup.values())) == 1.0 - assert test_game([tuple(test_game.player_name_lookup.values())]) == 1.0 - - # test with single player coalition all call variants - test_coalition = np.array([True] + [False for _ in range(test_game.n_players - 1)]) - assert test_game(test_coalition) - 1 / 6 < 10e-7 - assert test_game((0,)) - 1 / 6 < 10e-7 - assert test_game([(0,)]) - 1 / 6 < 10e-7 - assert test_game(("Alice",)) - 1 / 6 < 10e-7 - assert test_game([("Alice",)]) - 1 / 6 < 10e-7 - - # test string calls with missing player names - test_game2 = TestGame(n=n_players) - with pytest.raises(ValueError): - assert test_game2(("Bob",)) == 0.0 - with pytest.raises(ValueError): - assert test_game2([("Charlie",)]) == 0.0 - - -def test_precompute(): - """This test tests the precompute function of the base game class.""" - n_players = 6 - dummy_game = DummyGame(n=n_players, interaction=(0, 1)) - - assert dummy_game.n_values_stored == 0 - assert len(dummy_game.game_values) == 0 # no precomputed values - assert dummy_game.n_players == n_players # base attribute - - dummy_game.precompute() - - assert len(dummy_game.game_values) != 0 # precomputed values - assert len(dummy_game.game_values) == 2**n_players # precomputed values - assert dummy_game.n_values_stored == 2**n_players # precomputed coalitions - assert dummy_game.precomputed # precomputed flag - - # test with coalitions param provided - n_players = 6 - dummy_game = DummyGame(n=n_players, interaction=(0, 1)) - coalitions = np.array([[True for _ in range(n_players)]]) - dummy_game.precompute(coalitions=coalitions) - - assert dummy_game.n_values_stored == 1 - with pytest.raises(KeyError): # test error case where not all values are precomputed - _ = dummy_game(dummy_game.empty_coalition) - - # test with large number of players and see if it raises a warning - with pytest.warns(UserWarning): - n_players_large = 17 - dummy_game_large = DummyGame(n=n_players_large) - dummy_game_large.precompute() - assert dummy_game_large.n_values_stored == 2**n_players_large - - # test empty and grand coalition lookup - dummy_game = DummyGame(n=4, interaction=(0, 1)) - dummy_game.precompute() - assert dummy_game.empty_coalition_value == dummy_game(dummy_game.empty_coalition) - assert dummy_game.grand_coalition_value == dummy_game(dummy_game.grand_coalition) - assert dummy_game[(0, 1)] == dummy_game[(1, 0)] != 0.0 - with pytest.raises(KeyError): - _ = dummy_game[(0, 9)] # only 4 players - - -def test_core_functions(): - """This test tests the core functions of the base game class object.""" - n_players = 6 - dummy_game = DummyGame(n=n_players, interaction=(0, 1)) - - # test repr and str - string_game = str(dummy_game) - assert isinstance(repr(dummy_game), str) - assert isinstance(str(dummy_game), str) - assert repr(dummy_game) == string_game - assert dummy_game.game_name == "DummyGame_Game" - - dummy_game.normalization_value = 1.0 - assert dummy_game.normalize # should be true if normalization_value is not 0.0 - - -def test_lookup_vs_run(): - """Tests weather games are correctly evaluated by the lookup table or the value function.""" - dummy_game_precomputed = DummyGame(n=4, interaction=(0, 1)) - dummy_game_precomputed.precompute() - - dummy_game = DummyGame(n=4, interaction=(0, 1)) - - test_coalition = dummy_game.empty_coalition - assert np.allclose(dummy_game(test_coalition), dummy_game_precomputed(test_coalition)) - - test_coalition = dummy_game.empty_coalition - test_coalition[0] = True - assert np.allclose(dummy_game(test_coalition), dummy_game_precomputed(test_coalition)) - - test_coalition = dummy_game.grand_coalition - assert np.allclose(dummy_game(test_coalition), dummy_game_precomputed(test_coalition)) - - -def test_progress_bar(): - """Tests the progress bar of the game class.""" - dummy_game = DummyGame(n=5, interaction=(0, 1)) - - test_coalitions = list(powerset(range(dummy_game.n_players))) - test_coalitions = transform_coalitions_to_array(test_coalitions, dummy_game.n_players) - - # check if the progress bar is displayed - - values = dummy_game(test_coalitions, verbose=True) - assert len(values) == len(test_coalitions) - - -def test_abstract_game(): - """Tests the abstract game class.""" - from tests.shapiq.utils import get_concrete_class - - n = 6 - game = get_concrete_class(Game)(n_players=n) - with pytest.raises(NotImplementedError): - game(np.array([[True for _ in range(n)]])) - - -def test_exact_computer_call(): - """Tests the call to the exact computer in the game class.""" - game = DummyGame(n=4, interaction=(0, 1)) - - index = "SII" - order = 2 - sv = game.exact_values(index=index, order=order) - assert sv.index == index - assert sv.max_order == order - - -def test_compute(): - """Tests the compute function with and without returned normalization.""" - normalization_value = 1.0 # not zero - - n_players = 3 - game = DummyGame(n=n_players, interaction=(0, 1)) - - coalitions = np.array([[1, 0, 0], [0, 1, 1]]) - - # Make sure normalization value is added - game.normalization_value = normalization_value - assert game.normalize - - result = game.compute(coalitions=coalitions) - assert len(result[0]) == len(coalitions) # number of coalitions is correct - assert result[2] == normalization_value - assert len(result) == 3 # game_values, normalization_value and coalition_lookup - - # check if the game values are correct and that they are not normalized from compute - game_values = result[0] - assert game(coalitions[0]) + normalization_value == pytest.approx(game_values[0]) - assert game(coalitions[1]) + normalization_value == pytest.approx(game_values[1]) - - -def check_game_equality(game1: Game, game2: Game): - """Check if two games are equal.""" - assert game1.n_players == game2.n_players - assert game1.normalize == game2.normalize - assert game1.normalization_value == game2.normalization_value - assert game1.n_values_stored == game2.n_values_stored - assert game1.game_values == game2.game_values - - -class TestSavingGames: - """Tests for saving and loading games.""" - - @pytest.mark.parametrize("suffix", [".json", ".npz"]) - def test_init_from_saved_game(self, suffix, cooking_game_pre_computed: Game, tmp_path: Path): - """Test loading a game from a saved file using load_values.""" - path = tmp_path / "dummy_game" - path = path.with_suffix(suffix) - cooking_game_pre_computed.save_values(path) - loaded_game = Game(n_players=cooking_game_pre_computed.n_players) - loaded_game.load_values(path, precomputed=True) - check_game_equality(cooking_game_pre_computed, loaded_game) - - @pytest.mark.parametrize("suffix", [".json", ".npz"]) - def test_save_adds_suffix(self, cooking_game_pre_computed: Game, tmp_path: Path, suffix: str): - """Test that saving a game adds the correct suffix.""" - path = tmp_path / "dummy_game" - cooking_game_pre_computed.save_values(path, as_npz=(suffix == ".npz")) - path_with_suffix = path.with_suffix(suffix) - assert path_with_suffix.exists() - - def test_save_game_npz(self, cooking_game_pre_computed: Game, tmp_path: Path): - """Test loading a game from a saved npz file using load_values.""" - path = tmp_path / "dummy_game.npz" - cooking_game_pre_computed.save_values(path, as_npz=True) - loaded_game = Game(n_players=cooking_game_pre_computed.n_players) - loaded_game.load_values(path, precomputed=True) - check_game_equality(cooking_game_pre_computed, loaded_game) - - def test_save_and_load_json(self, cooking_game_pre_computed: Game, tmp_path: Path): - """Test saving and loading a game as JSON.""" - path = tmp_path / "dummy_game.json" - assert not path.exists() - cooking_game_pre_computed.save(path) - assert path.exists() - loaded_game = Game.load(path) - check_game_equality(cooking_game_pre_computed, loaded_game) - - @pytest.mark.parametrize("suffix", [".json", ".npz"]) - def test_save_and_load_with_normalization(self, suffix, tmp_path: Path): - """Tests weather games can be saved and loaded with normalization values correctly.""" - normalization_value = 0.25 # not zero - dummy_game_empty_output = 0.0 - - game = DummyGame(n=4, interaction=(0, 1)) - assert not game.normalize # first not normalized - game.normalization_value = normalization_value - assert game.normalization_value == normalization_value - assert game.normalize # now normalized - assert ( - not game.is_normalized - ) # the game is being normalized but the empty coalition is not 0 - - path = tmp_path / f"dummy_game.{suffix}" - game.save_values(path) - - game_loaded = Game(n_players=4) - game_loaded.load_values(path, precomputed=True) - assert game_loaded.normalize # should be normalized - assert game_loaded.normalization_value == normalization_value - empty_value = game_loaded(game_loaded.empty_coalition) - # the output should be the same as the original game with normalization (-0.25) - assert empty_value == dummy_game_empty_output - normalization_value - - # load without normalization by resetting normalization_value after loading - game_loaded = Game(n_players=4) - game_loaded.load_values(path, precomputed=True) - game_loaded.normalization_value = 0.0 - assert not game_loaded.normalize # should not be normalized - assert game_loaded.normalization_value == 0.0 - empty_value = game_loaded(game_loaded.empty_coalition) - # the output should be the same as the original game without normalization (0.0) - assert empty_value == dummy_game_empty_output diff --git a/tests/shapiq/tests_unit/tests_imputer/__init__.py b/tests/shapiq/tests_unit/tests_imputer/__init__.py deleted file mode 100644 index f2bbbec27..000000000 --- a/tests/shapiq/tests_unit/tests_imputer/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Tests for the imputer module.""" diff --git a/tests/shapiq/tests_unit/tests_imputer/test_baseline_imputer.py b/tests/shapiq/tests_unit/tests_imputer/test_baseline_imputer.py deleted file mode 100644 index e38e3174f..000000000 --- a/tests/shapiq/tests_unit/tests_imputer/test_baseline_imputer.py +++ /dev/null @@ -1,156 +0,0 @@ -"""This test module contains all tests for the baseline imputer module of the shapiq package.""" - -from __future__ import annotations - -import numpy as np -import pytest - -from shapiq.imputer import BaselineImputer - - -def test_baseline_init_background(): - """Test the initialization of the baseline imputer.""" - - def model(x: np.ndarray) -> np.ndarray: - return np.zeros(x.shape[0]) - - data = np.array([[1, 2, "a"], [2, 3, "a"], [3, 4, "b"]], dtype=object) - x = np.array([1, 2, 3]) - imputer = BaselineImputer( - model=model, - data=data, - x=x, - random_state=42, - ) - assert np.array_equal(imputer.baseline_values, np.array([[2, 3, "a"]], dtype=object)) - - baseline_values = np.zeros((1, 3)) - imputer.init_background(data=baseline_values) - assert np.array_equal(imputer.baseline_values, baseline_values) - - -def test_baseline_imputer_with_model(dt_reg_model, background_reg_dataset): - """Test the baseline imputer with a real model.""" - # create a coalitions - data, target = background_reg_dataset - x = data[0] - coalitions = [ - [False for _ in range(data.shape[1])], - [False for _ in range(data.shape[1])], - [True for _ in range(data.shape[1])], - ] - coalitions[1][0] = True # first feature is present - coalitions = np.array(coalitions) - - imputer = BaselineImputer( - model=dt_reg_model.predict, - data=data, - x=x, - random_state=42, - normalize=False, - ) - assert np.array_equal(imputer.x[0], x) - assert imputer.sample_size == 1 - assert imputer.random_state == 42 - assert imputer.n_features == data.shape[1] - imputed_values = imputer(coalitions) - assert len(imputed_values) == 3 - - -def test_baseline_imputer_background_computation(background_reg_dataset): - """Checks weather the baseline values from data are computed correctly with the mean/mode.""" - - # set up a dummy model function that returns zeros - def model_cat(x: np.ndarray) -> np.ndarray: - return np.zeros(x.shape[0]) - - # make a feature into a categorical feature - data, target = background_reg_dataset - data = np.copy(data).astype(object) - data[:, 0] = np.random.choice(["a", "b", "c"], size=data.shape[0]) - data[:, 1] = np.random.choice(["a", "b", "c"], size=data.shape[0]) - x = data[0] - - with pytest.warns(UserWarning): # we expect the warning that feature 1 is not numerical - imputer = BaselineImputer( - model=model_cat, - data=data, - x=x, - random_state=42, - categorical_features=[0], # only tell the imputer the first feature is categorical - ) - - # check if the categorical feature is correctly identified - assert imputer._cat_features == [0, 1] - - # check if modes are correct - for feature in imputer._cat_features: - val, count = np.unique(data[:, feature], return_counts=True) - mode = val[np.argmax(count)] - assert imputer.baseline_values[0, feature] == mode - - # check if the mean is correct - assert imputer.baseline_values[0, 2] == np.mean(data[:, 2]) - - -def test_baseline_value_function_imputes_correctly(): - """Test that value_function substitutes baseline values for absent features.""" - captured = [] - - def model(x: np.ndarray) -> np.ndarray: - captured.append(x.copy()) - return np.zeros(x.shape[0]) - - x = np.array([[1, 2, 3]]) - baseline = np.array([[10, 20, 30]]) - imputer = BaselineImputer(model=model, data=baseline, x=x) - - coalitions = np.array([[True, False, True], [False, True, False]]) - imputer(coalitions) - - assert len(captured) == 1 - result = captured[0] - np.testing.assert_array_equal(result[0], [1, 20, 3]) - np.testing.assert_array_equal(result[1], [10, 2, 30]) - - -def test_baseline_imputer_init(): - """Test the initialization of the marginal imputer.""" - - def model(x: np.ndarray) -> np.ndarray: - return np.sum(x, axis=1) - - # get np data set of 10 rows and 3 columns of random numbers - n_features = 3 - data = np.random.rand(10, n_features) - - # init with a baseline vector - imputer = BaselineImputer( - model=model, - data=np.zeros((n_features,)), # baseline vector of shape (n_features,) - x=np.ones((1, n_features)), - random_state=42, - ) - assert imputer.sample_size == 1 # sample size is always 1 for baseline imputer - assert imputer.random_state == 42 - assert imputer.n_features == 3 - - # call with two inputs - imputed_values = imputer(np.array([[False, False, False], [True, False, True]])) - assert len(imputed_values) == 2 - assert imputed_values[0] == imputer.empty_prediction - - # test without x - x = np.random.rand(1, 3) - imputer = BaselineImputer( - model=model, - data=data, - x=None, - random_state=42, - ) - imputer.fit(x) - assert np.array_equal(imputer.x, x) - assert imputer.n_features == 3 - assert imputer.random_state == 42 - imputer.fit(x=np.ones((n_features,))) # test with vector - assert np.array_equal(imputer.x, np.ones((1, n_features))) diff --git a/tests/shapiq/tests_unit/tests_imputer/test_conditional_imputer.py b/tests/shapiq/tests_unit/tests_imputer/test_conditional_imputer.py deleted file mode 100644 index e6a048fbf..000000000 --- a/tests/shapiq/tests_unit/tests_imputer/test_conditional_imputer.py +++ /dev/null @@ -1,77 +0,0 @@ -"""This test module contains all tests for the GenerativeConditionalImputer module of the shapiq package.""" - -from __future__ import annotations - -import numpy as np -import pytest - -from shapiq.imputer import GenerativeConditionalImputer - - -def test_conditional_imputer_init(): - """Test the initialization of the GenerativeConditionalImputer.""" - - def model(x: np.ndarray) -> np.ndarray: - return np.sum(x, axis=1) - - rng = np.random.default_rng(42) - data = rng.random((100, 3)) - x = rng.random((1, 3)) - - imputer = GenerativeConditionalImputer( - model=model, - data=data, - x=x, - sample_size=9, - random_state=42, - ) - assert np.array_equal(imputer._x, x) - assert imputer.sample_size == 9 - assert imputer.random_state == 42 - assert imputer.n_features == 3 - - # test raise warning with non generative method - with pytest.raises(ValueError): - _ = GenerativeConditionalImputer( - model=model, - data=data, - x=x, - sample_size=9, - random_state=42, - method="not_generative", - ) - - # test with conditional sample size higher than 2**n_features - with pytest.warns(UserWarning): - imputer = GenerativeConditionalImputer( - model=model, - data=data, - x=x, - sample_size=1, - conditional_budget=2 ** data.shape[1] + 1, # budget for warning here - random_state=42, - conditional_threshold=0.5, # increases the conditional samples drawn - ) - coalitions = np.zeros((1, data.shape[1]), dtype=bool) - imputer(coalitions) - - -def test_conditional_imputer_value_function(): - """Test the value function of the GenerativeConditionalImputer.""" - - def model(x: np.ndarray) -> np.ndarray: - return np.asarray([np.random.uniform(0, 1) for _ in range(x.shape[0])]) - - data = np.random.rand(100, 3) - x = np.random.rand(1, 3) - - imputer = GenerativeConditionalImputer( - model=model, - data=data, - x=x, - sample_size=11, - random_state=42, - ) - - imputed_values = imputer(np.array([[True, False, True], [False, True, False]])) - assert len(imputed_values) == 2 diff --git a/tests/shapiq/tests_unit/tests_imputer/test_gaussian_and_copula.py b/tests/shapiq/tests_unit/tests_imputer/test_gaussian_and_copula.py deleted file mode 100644 index fa0ba895b..000000000 --- a/tests/shapiq/tests_unit/tests_imputer/test_gaussian_and_copula.py +++ /dev/null @@ -1,118 +0,0 @@ -"""Tests functionality that is common to both Gaussian imputers.""" - -from __future__ import annotations - -import numpy as np -import pytest - -from shapiq.imputer import GaussianCopulaImputer, GaussianImputer -from shapiq.imputer.gaussian_imputer_exceptions import CategoricalFeatureError - - -@pytest.mark.parametrize("model_class", [GaussianImputer, GaussianCopulaImputer]) -class TestInputValidation: - """Tests that input data is handled correctly and that malformed data is detected successfully.""" - - def test_categorical_feature_check_only_continuous(self, dummy_model, model_class) -> None: - """Test that no error is raised when all features are continuous with >2 unique values.""" - data = np.array( - [ - [1.0, 2.0, 3.0], - [4.0, 5.0, 6.0], - [7.0, 8.0, 9.0], - ] - ) - x = np.array([[2.0, 3.0, 4.0]]) - # Should not raise error - model_class(model=dummy_model, data=data, x=x) - - def test_categorical_feature_check_binary_column(self, dummy_model, model_class) -> None: - """Test that an exception is raised if the background data has column containing only two unique values.""" - data = np.array( - [ - [1.0, 0, 3.0], - [2.0, 1, 4.0], - [3.0, 0, 5.0], - ] - ) - x = np.array([2.0, 1.0, 4.0]) - with pytest.raises(CategoricalFeatureError) as exc: - model_class(model=dummy_model, data=data, x=x) - msg = str(exc.value) - # The second column (index 1) should be flagged as categorical, so 'f2' should be in the message - assert "f2" in msg - # The first and third columns should not be flagged, so 'f1' and 'f3' should not be in the message - assert "f1" not in msg - assert "f3" not in msg - - def test_categorical_feature_check_string(self, dummy_model, model_class) -> None: - """Test that an exception is raised if the background data has a column containing string values.""" - data = np.array( - [ - [1.0, "a", 3.0], - [2.0, "b", 4.0], - [3.0, "a", 5.0], - ], - dtype=object, - ) - x = np.array([2.0, "b", 4.0], dtype=object) - with pytest.raises(CategoricalFeatureError) as exc: - model_class(model=dummy_model, data=data, x=x) - msg = str(exc.value) - assert "f2" in msg - assert "f1" not in msg - assert "f3" not in msg - - def test_categorical_feature_check_mixed(self, dummy_model, model_class) -> None: - """Test that an exception is raised if the background data has binary and string-valued columns.""" - data = np.array( - [ - [1.0, 0, "a", 3.0], - [2.0, 1, "b", 4.0], - [3.0, 0, "a", 5.0], - ], - dtype=object, - ) - x = np.array([2.0, 1.0, "b", 4.0], dtype=object) - with pytest.raises(CategoricalFeatureError) as exc: - model_class(model=dummy_model, data=data, x=x) - msg = str(exc.value) - # Both f2 (index 1) and f3 (index 2) must be mentioned - assert "f2" in msg - assert "f3" in msg - # f1 and f4 must not appear - assert "f1" not in msg - assert "f4" not in msg - - def test_x_explain_shapes(self, dummy_model, model_class): - """Tests that an explain point can be passed both as a vector and a matrix with one row; both when passing in the constructor and when calling the fit() method.""" - data = np.array( - [ - [1, 2, 3], - [4, 5, 6], - [7, 8, 9], - ] - ) - x_explain = np.array([3, 2, 1]) - coalitions = np.array([[False, True, False]]) - - imputer = model_class(model=dummy_model, data=data, x=x_explain.copy()) - imputer.value_function(coalitions) - - imputer = model_class(model=dummy_model, data=data, x=np.atleast_2d(x_explain.copy())) - imputer.value_function(coalitions) - - imputer = model_class(model=dummy_model, data=data) - imputer.fit(x_explain.copy()) - imputer.value_function(coalitions) - - imputer = model_class(model=dummy_model, data=data) - imputer.fit(np.atleast_2d(x_explain.copy())) - imputer.value_function(coalitions) - - def test_empty_background_data(self, dummy_model, model_class) -> None: - """Test that a ValueError is raised when instantiating the imputer with an empty background data array.""" - data = np.array([]) - x = np.array([1, 2, 3]) - with pytest.raises(ValueError, match="data.*empty"): - model_class(model=dummy_model, data=data, x=x) diff --git a/tests/shapiq/tests_unit/tests_imputer/test_gaussian_copula_imputer.py b/tests/shapiq/tests_unit/tests_imputer/test_gaussian_copula_imputer.py deleted file mode 100644 index 9b0bf80d7..000000000 --- a/tests/shapiq/tests_unit/tests_imputer/test_gaussian_copula_imputer.py +++ /dev/null @@ -1,229 +0,0 @@ -"""Tests for the GaussianCopulaImputer class. - -This module contains unit tests for the GaussianCopulaImputer class, including tests for -categorical feature detection, transformation methods, and imputation logic. -""" - -from __future__ import annotations - -import numpy as np -import pytest -from scipy.stats import norm - -from shapiq.imputer import GaussianCopulaImputer - -############################################## -# Tests for Transformation Methods --------- # -############################################## - - -def test_empirical_cdf(dummy_model) -> None: - """Tests that the empirical CDF is calculated correctly for a single column.""" - feature_values = np.array([-5, 10, 0, 3, 4]) - expected_empirical_cdf = np.array([1, 5, 2, 3, 4]) / 5 - - dummy_data = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) - imputer = GaussianCopulaImputer(model=dummy_model, data=dummy_data) - - empirical_cdf = imputer._empirical_cdf(feature_values.reshape(-1, 1)).flatten() - - assert np.allclose(empirical_cdf, expected_empirical_cdf) - - -def test_empirical_cdf_1_dimensional(dummy_model) -> None: - """Tests that the empirical CDF is raising error on one dimensional input.""" - feature_values = np.array([-5, 10, 0, 3, 4]) - - dummy_data = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) - imputer = GaussianCopulaImputer(model=dummy_model, data=dummy_data) - - with pytest.raises(ValueError, match="Expected a 2D array"): - imputer._empirical_cdf(feature_values) - - -def test_empirical_cdf_2_dimensional(dummy_model) -> None: - """Tests that the empirical CDF is raising error on three dimensional input..""" - feature_values = np.array([[[1, 2, 3], [4, 5, 6]], [[7, 8, 9], [10, 11, 12]]]) - - dummy_data = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) - imputer = GaussianCopulaImputer(model=dummy_model, data=dummy_data) - - with pytest.raises(ValueError, match="Expected a 2D array"): - imputer._empirical_cdf(feature_values) - - -def test_transform_to_gaussian(dummy_model) -> None: - """Tests transforming background data to Gaussian space.""" - data = np.array( - [ - [1.0, 2.0, 0.0], - [4.0, 8.0, -10.0], - [7.0, 5.0, 200.0], - ] - ) - imputer = GaussianCopulaImputer(model=dummy_model, data=data) - - expected_transformed_data = np.array( - [ - [norm.ppf(1 / 3), norm.ppf(1 / 3), norm.ppf(2 / 3)], - [norm.ppf(2 / 3), norm.ppf(1 - imputer.QUANTILE_CLIP_EPSILON), norm.ppf(1 / 3)], - [ - norm.ppf(1 - imputer.QUANTILE_CLIP_EPSILON), - norm.ppf(2 / 3), - norm.ppf(1 - imputer.QUANTILE_CLIP_EPSILON), - ], - ] - ) - - transformed_data = imputer._transform_to_gaussian(data) - - assert np.allclose(transformed_data, expected_transformed_data, atol=1e-3), ( - f"Expected {expected_transformed_data}, but got {transformed_data}" - ) - - -def test_transform_point_to_gaussian(dummy_model) -> None: - """Test transforming a single point to Gaussian space.""" - data = np.array( - [ - [1.0, 2.0, 3.0], - [4.0, 5.0, 6.0], - [7.0, 8.0, 9.0], - ] - ) - imputer = GaussianCopulaImputer(model=dummy_model, data=data) - - x_test = np.array([8, 2, 1]) - # Features should be mapped to ranks [3, 1, 0], meaning quantiles [3/3, 1/3, 0/3] - # The out-of-range value of 0 will be clipped according to the imputers configuration - expected_quantiles = np.array( - [1 - imputer.QUANTILE_CLIP_EPSILON, 1 / 3, imputer.QUANTILE_CLIP_EPSILON] - ) - expected_x_transformed = norm.ppf(expected_quantiles) - - x_transformed = imputer._transform_point_to_gaussian(data, x_test) - - assert x_transformed.shape == x_test.shape - assert np.allclose(x_transformed, expected_x_transformed, atol=1e-2) - - -def test_incorrect_transform_point_to_gaussian(dummy_model) -> None: - """Tests Error reaction to feature number and explanation point (x) missmatch.""" - data = np.array( - [ - [1.0, 2.0, 3.0], - [4.0, 5.0, 6.0], - [7.0, 8.0, 9.0], - ] - ) - imputer = GaussianCopulaImputer(model=dummy_model, data=data) - - x_test = np.array([8, 2]) - with pytest.raises( - ValueError, match="Background data has 3 features but point to transform has 2 features" - ): - imputer._transform_point_to_gaussian(data, x_test) - - -def test_identity_transform(dummy_model) -> None: - """Tests that transforming to Gaussian space and gives the original data.""" - data = np.array( - [ - [1.0, 2.0, 3.0], - [7.0, 2.5, 6.0], - [2.0, 8.0, -1.0], - ] - ) - - imputer = GaussianCopulaImputer(model=dummy_model, data=data) - data_transformed = imputer._transform_to_gaussian(data) - data_backtransformed = imputer._transform_from_gaussian(data_transformed) - - assert np.allclose(data, data_backtransformed) - - -def test_trasnform_from_gaussian(dummy_model) -> None: - """Test transforming from Gaussian space back to original feature space.""" - data = np.array( - [ - [1.0, 2.0, 3.0], - [4.0, 5.0, 6.0], - [7.0, 8.0, 9.0], - ] - ) - gaussian_samples = np.array( - [ - [0, 0, 0], - [1, -1, 0.5], - [-1, 1, -0.5], - ] - ) - imputer = GaussianCopulaImputer(model=dummy_model, data=data) - - original = imputer._transform_from_gaussian(gaussian_samples) - - # Check shape - assert original.shape == gaussian_samples.shape - - # Check values are within original data range - assert np.all(original >= np.min(data)) - assert np.all(original <= np.max(data)) - - -############################################## -# Tests for Imputation --------------------- # -############################################## - - -def test_copula_imputation_single_feature_known(dummy_model) -> None: - """Test imputation with a single feature known and two unknown.""" - # Create correlated data - rng = np.random.default_rng(seed=42) - data = rng.normal(size=(1000, 3)) - # Introduce correlation between features - data[:, 1] = 0.8 * data[:, 0] + 0.2 * data[:, 1] - data[:, 2] = 0.5 * data[:, 0] + 0.5 * data[:, 2] - - x_explain = np.array([1.0, np.nan, np.nan]) - coalitions = np.array([[True, False, False]]) - - imputer = GaussianCopulaImputer( - model=dummy_model, data=data, x=x_explain, sample_size=1000, random_state=42 - ) - - samples = imputer._draw_samples(x_explain, coalitions) - - assert samples.shape == (coalitions.shape[0], imputer.sample_size, x_explain.shape[0]) - samples_avg = np.mean(samples, axis=1) - - # We can't predict exact values, but they should be within a reasonable range on average - lower_bound = -2 - upper_bound = 4 - assert np.all(samples_avg[0, 1:] >= lower_bound) - assert np.all(samples_avg[0, 1:] <= upper_bound) - - -def test_copula_imputer_value_function(dummy_model) -> None: - """Test the value function of the copula imputer.""" - # Create correlated data - rng = np.random.default_rng(seed=42) - data = rng.normal(size=(1000, 3)) - # Introduce correlation between features - data[:, 1] = 0.8 * data[:, 0] + 0.2 * data[:, 1] - data[:, 2] = 0.5 * data[:, 0] + 0.5 * data[:, 2] - - x_explain = np.array([1.0, np.nan, np.nan]) - coalitions = np.array([[True, False, False]]) - - imputer = GaussianCopulaImputer( - model=dummy_model, data=data, x=x_explain, sample_size=1000, random_state=42 - ) - y_predicted = imputer.value_function(coalitions) - - assert y_predicted.shape == (coalitions.shape[0],) - # The expected value should be sum of known feature (1.0) plus the conditional means - # We can't predict exact values, but they should be within a reasonable range - imputed_lower = -2 - imputed_upper = 4 - assert np.all(y_predicted[0] >= imputed_lower) - assert np.all(y_predicted[0] <= imputed_upper) diff --git a/tests/shapiq/tests_unit/tests_imputer/test_gaussian_imputer.py b/tests/shapiq/tests_unit/tests_imputer/test_gaussian_imputer.py deleted file mode 100644 index 28b45e42d..000000000 --- a/tests/shapiq/tests_unit/tests_imputer/test_gaussian_imputer.py +++ /dev/null @@ -1,100 +0,0 @@ -"""Tests for the GaussianImputer class.""" - -from __future__ import annotations - -from typing import cast - -import numpy as np - -from shapiq.imputer import GaussianImputer - -############################################## -# Tests for Cov Mat and Mean Calculation --- # -############################################## - - -def test_calculate_mean_per_feature(dummy_model) -> None: - """Test that the mean per feature is calculated correctly.""" - rng = np.random.default_rng(seed=456) - n_samples = 200 - n_features = 10 - data = rng.normal(size=(n_samples, n_features)) - x = np.zeros(n_features) - - imputer = GaussianImputer(model=dummy_model, data=data, x=x) - expected_mean = np.mean(data, axis=0) - - np.testing.assert_allclose(imputer.mean_per_feature, expected_mean) - - -def test_calculate_covariance_matrix(dummy_model) -> None: - """Test that the covariance matrix is calculated correctly.""" - rng = np.random.default_rng(seed=456) - n_samples = 200 - n_features = 10 - data = rng.normal(size=(n_samples, n_features)) - x = np.array([2.0, 3.0, 4.0]) - - imputer = GaussianImputer(model=dummy_model, data=data, x=x) - expected_cov = np.cov(data.T) - np.testing.assert_allclose(imputer.cov_mat, expected_cov) - - -############################################## -# Tests for Imputation --- # -############################################## - - -def test_gaussian_imputation_single_feature_known(dummy_model) -> None: - """Test the imputation for a coalition with one known and two unknown features.""" - mean = np.array([0.0, 0.0, 0.0]) - cov = np.array( - [ - [1, 0.8, 0.5], - [0.8, 1, 0.3], - [0.5, 0.3, 1], - ] - ) - - rng = np.random.default_rng(seed=42) - x_train = rng.multivariate_normal(mean, cov, size=10000) - x_explain = np.array([1.0, np.nan, np.nan]) - coalitions = np.array([[True, False, False]]) - - imputer = GaussianImputer( - model=dummy_model, - data=x_train, - x=x_explain, - sample_size=1000, - ) - samples = imputer._draw_samples(x_explain, coalitions) - assert samples.shape == (coalitions.shape[0], imputer.sample_size, mean.shape[0]) - - samples_avg = np.mean(samples[0, :, ~coalitions[0]], axis=1) - - np.testing.assert_allclose(samples_avg, [0.8, 0.5], atol=0.1) - - -def test_gaussian_imputer_value_function(dummy_model): - """Tests that the value function of the Gaussian imputer gives the expected result using a dummy model.""" - mean = np.array([0.0, 0.0, 0.0]) - cov = np.array( - [ - [1, 0.8, 0.5], - [0.8, 1, 0.3], - [0.5, 0.3, 1], - ] - ) - x_explain = np.array([[1.0, np.nan, np.nan]]) - coalition = np.array([True, False, False]) - - expected_imputed = np.array([1.0, 0.8, 0.5]) - y_expected = cast("np.floating", dummy_model(expected_imputed)) - - rng = np.random.default_rng(seed=42) - x_train = rng.multivariate_normal(mean, cov, size=10000) - - imputer = GaussianImputer(data=x_train, x=x_explain[0], model=dummy_model, sample_size=1000) - y_predicted = imputer.value_function(np.atleast_2d(coalition)) - - np.testing.assert_allclose(y_predicted, y_expected, atol=0.1) diff --git a/tests/shapiq/tests_unit/tests_imputer/test_imputer_base_functionality.py b/tests/shapiq/tests_unit/tests_imputer/test_imputer_base_functionality.py deleted file mode 100644 index 24704eeff..000000000 --- a/tests/shapiq/tests_unit/tests_imputer/test_imputer_base_functionality.py +++ /dev/null @@ -1,28 +0,0 @@ -"""This test module tests base functionality of imputers.""" - -from __future__ import annotations - -import numpy as np -import pytest - -from shapiq.imputer.base import Imputer -from tests.shapiq.utils import get_concrete_class - - -def test_abstract_imputer(): - """Tests if the attributes and properties of imputers are set correctly.""" - - def model(x): - return x - - data = np.asarray([[1, 2, 3], [4, 5, 6]]) - imputer = get_concrete_class(Imputer)(model, data) - assert imputer.model == model - assert np.all(imputer.data == data) - assert imputer.n_features == 3 - assert imputer._cat_features == [] - assert imputer.random_state is None - assert imputer._rng is not None - - with pytest.raises(NotImplementedError): - imputer(np.array([[True, False, True]])) diff --git a/tests/shapiq/tests_unit/tests_imputer/test_marginal_imputer.py b/tests/shapiq/tests_unit/tests_imputer/test_marginal_imputer.py deleted file mode 100644 index cb38de44b..000000000 --- a/tests/shapiq/tests_unit/tests_imputer/test_marginal_imputer.py +++ /dev/null @@ -1,148 +0,0 @@ -"""This test module contains all tests for the marginal imputer module of the shapiq package.""" - -from __future__ import annotations - -import numpy as np -import pytest - -from shapiq.imputer import MarginalImputer - - -def test_marginal_imputer_init(): - """Test the initialization of the marginal imputer.""" - - def model(x: np.ndarray) -> np.ndarray: - return np.sum(x, axis=1) - - # get np data set of 10 rows and 3 columns of random numbers - data = np.random.rand(10, 3) - - imputer = MarginalImputer( - model=model, - data=data, - sample_size=10, - random_state=42, - ) - assert imputer.sample_size == 10 - assert imputer.random_state == 42 - assert imputer.n_features == 3 - - # test with x and normalize - x = np.random.rand(1, 3) - imputer = MarginalImputer( - model=model, - data=data, - x=x, - random_state=42, - ) - assert np.array_equal(imputer.x, x) - assert imputer.n_features == 3 - assert imputer.random_state == 42 - - # check with categorical features and a wrong numerical feature - - def model_cat(x: np.ndarray) -> np.ndarray: - return np.zeros(x.shape[0]) - - data = np.asarray([["a", "b", 1], ["c", "d", 2], ["e", "f", 3]]) - categorical_features = [0] # only first specified - imputer = MarginalImputer( - model=model_cat, - data=data, - categorical_features=categorical_features, - random_state=42, - ) - assert imputer._cat_features == [0] - - -def test_marginal_imputer_value_function(): - """Test the value function of the marginal imputer.""" - - def model(x: np.ndarray) -> np.ndarray: - return np.sum(x, axis=1) - - # get np data set of 10 rows and 3 columns of random numbers - data = np.random.rand(10, 3) - - imputer = MarginalImputer( - model=model, - data=data, - x=np.ones((1, 3)), - sample_size=8, - random_state=42, - ) - - imputed_values = imputer(np.array([[True, False, True], [False, True, False]])) - assert len(imputed_values) == 2 - - # test with normalization - imputer = MarginalImputer( - model=model, - data=data, - x=np.ones((1, 3)), - sample_size=8, - random_state=42, - normalize=True, - ) - imputed_out = imputer(np.array([[False, False, False], [False, True, False]])) - assert imputed_out[0] == 0.0 - assert imputed_out[1] != 0.0 - - -def test_joint_marginal_distribution(): - """Test weather the marginal imputer correctly samples replacement values.""" - - def model(x: np.ndarray) -> np.ndarray: - return np.sum(x, axis=1) - - data = [ - [1, 2, 3], - [4, 5, 6], - [7, 8, 9], - ] - data_as_tuples = [tuple(row) for row in data] - data = np.array(data) - x = np.array([1, 1, 1]) - - imputer = MarginalImputer( - model=model, - data=data, - x=x, - sample_size=3, - random_state=42, - joint_marginal_distribution=False, - ) - replacement_data_independent = imputer._sample_replacement_data(3) - - imputer = MarginalImputer( - model=model, - data=data, - x=x, - sample_size=3, - random_state=42, - joint_marginal_distribution=True, - ) - replacement_data_joint = imputer._sample_replacement_data(3) - for i in range(3): - assert tuple(replacement_data_joint[i]) in data_as_tuples - # the below only works because of the random seed (might break in future) - assert tuple(replacement_data_independent[i]) not in data_as_tuples - - -def test_raise_warning(): - """Test that a warning is raised when the model is not compatible with the data.""" - - def model(x: np.ndarray) -> np.ndarray: - return np.sum(x, axis=1) - - # get np data set of 10 rows and 3 columns of random numbers - data = np.random.rand(10, 3) - - with pytest.warns(UserWarning): - _ = MarginalImputer( - model=model, - data=data, - sample_size=100, - random_state=42, - joint_marginal_distribution=False, - ) diff --git a/tests/shapiq/tests_unit/tests_imputer/test_tabpfn_imputer.py b/tests/shapiq/tests_unit/tests_imputer/test_tabpfn_imputer.py deleted file mode 100644 index c2990d1d2..000000000 --- a/tests/shapiq/tests_unit/tests_imputer/test_tabpfn_imputer.py +++ /dev/null @@ -1,108 +0,0 @@ -"""This test module tests the tabpfn imputer object.""" - -from __future__ import annotations - -import numpy as np -import pytest - -from shapiq import TabPFNImputer -from shapiq.explainer.utils import get_predict_function_and_model_type -from tests.shapiq.markers import skip_if_no_tabpfn - - -@skip_if_no_tabpfn -@pytest.mark.external_libraries -def test_tabpfn_imputer(tabpfn_classification_problem): - """Test the TabPFNImputer class.""" - import tabpfn - - # setup - model, data, labels, x_test = tabpfn_classification_problem - assert isinstance(model, tabpfn.TabPFNClassifier) - if model.n_features_in_ == data.shape[1]: - model.fit(data, labels) - assert model.n_features_in_ == data.shape[1] - assert not hasattr(model, "_shapiq_predict_function") - - # setup the tabpfn imputer - prediction_function, _ = get_predict_function_and_model_type(model) - imputer = TabPFNImputer( - model=model, - x_train=data, - y_train=labels, - x_test=x_test, - predict_function=prediction_function, - ) - imputer.fit(x=x_test[0]) - - # test the imputer - out_1 = imputer(np.asarray([True, True, True])) # 3 features should now been fitted - out_2 = imputer(np.asarray([True, True, False])) # 2 features should now been fitted - out_3 = imputer(np.asarray([False, True, False])) # 1 feature should now been fitted - assert out_1 != out_2 - assert out_1 != out_3 - assert out_2 != out_3 - - -@skip_if_no_tabpfn -@pytest.mark.external_libraries -def test_empty_prediction(tabpfn_classification_problem): - """Tests the TabPFNImputer with a manual empty prediction.""" - import tabpfn - - # setup - model, data, labels, x_test = tabpfn_classification_problem - assert isinstance(model, tabpfn.TabPFNClassifier) - if model.n_features_in_ == data.shape[1]: - model.fit(data, labels) - assert model.n_features_in_ == data.shape[1] - assert not hasattr(model, "_shapiq_predict_function") - - manual_empty_prediction = 1000 - - # setup the tabpfn imputer - prediction_function, _ = get_predict_function_and_model_type(model) - imputer = TabPFNImputer( - model=model, - x_train=data, - y_train=labels, - x_test=x_test, - predict_function=prediction_function, - empty_prediction=manual_empty_prediction, - ) - - output = imputer(np.asarray([False, False, False])) - assert output[0] == manual_empty_prediction - - -@skip_if_no_tabpfn -@pytest.mark.external_libraries -def test_tabpfn_imputer_validation(tabpfn_classification_problem): - """Test that the TabPFNImputer raises a ValueError if no predict function is provided.""" - import tabpfn - - # setup - model, data, labels, x_test = tabpfn_classification_problem - assert isinstance(model, tabpfn.TabPFNClassifier) - if model.n_features_in_ == data.shape[1]: - model.fit(data, labels) - assert model.n_features_in_ == data.shape[1] - assert not hasattr(model, "_shapiq_predict_function") - - # no prediction function - with pytest.raises(ValueError): - _ = TabPFNImputer( - model=model, - x_train=data, - y_train=labels, - x_test=x_test, - predict_function=None, - ) - - # no x_test and no empty prediction - with pytest.raises(ValueError): - - def pred_fun(model, x): - return model.predict_proba(x)[0] - - _ = TabPFNImputer(model=model, x_train=data, y_train=labels, predict_function=pred_fun) diff --git a/tests/shapiq/tests_unit/tests_plots/__init__.py b/tests/shapiq/tests_unit/tests_plots/__init__.py deleted file mode 100644 index c56e0074b..000000000 --- a/tests/shapiq/tests_unit/tests_plots/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Tests for the plots module.""" diff --git a/tests/shapiq/tests_unit/tests_plots/test_bar.py b/tests/shapiq/tests_unit/tests_plots/test_bar.py deleted file mode 100644 index 3ee0e152b..000000000 --- a/tests/shapiq/tests_unit/tests_plots/test_bar.py +++ /dev/null @@ -1,53 +0,0 @@ -"""This module contains all tests for the bar plots.""" - -from __future__ import annotations - -import matplotlib.pyplot as plt -import numpy as np - -from shapiq import ExactComputer, InteractionValues, bar_plot - - -def test_bar_cooking_game(cooking_game): - """Test the bar plot function with concrete values from the cooking game.""" - exact_computer = ExactComputer(game=cooking_game, n_players=cooking_game.n_players) - sv_exact = exact_computer(index="k-SII", order=2) - bar_plot([sv_exact], show=False) - - # visual inspection: - # - Order from top to bottom: Base Value, the interactions (all equal), F0, F1, F2 - - -def test_bar_plot(interaction_values_list: list[InteractionValues]): - """Test the bar plot function.""" - n_players = interaction_values_list[0].n_players - feature_names = [f"feature-{i}" for i in range(n_players)] - feature_names = np.array(feature_names) - - axis = bar_plot(interaction_values_list, show=False, feature_names=feature_names) - - assert axis is not None - assert isinstance(axis, plt.Axes) - plt.close() - - axis = bar_plot(interaction_values_list, show=False) - assert isinstance(axis, plt.Axes) - plt.close() - - # test max_display=None - output = bar_plot(interaction_values_list, show=False, max_display=None) - assert output is not None - assert isinstance(output, plt.Axes) - plt.close("all") - - # test global = false - output = bar_plot(interaction_values_list, show=False, global_plot=False) - assert output is not None - assert isinstance(output, plt.Axes) - plt.close("all") - - # test plot_base_value = True - output = bar_plot(interaction_values_list, show=False, plot_base_value=True) - assert output is not None - assert isinstance(output, plt.Axes) - plt.close("all") diff --git a/tests/shapiq/tests_unit/tests_plots/test_beeswarm.py b/tests/shapiq/tests_unit/tests_plots/test_beeswarm.py deleted file mode 100644 index 7bd7b3998..000000000 --- a/tests/shapiq/tests_unit/tests_plots/test_beeswarm.py +++ /dev/null @@ -1,279 +0,0 @@ -"""This module contains all tests for the beeswarm plot.""" - -from __future__ import annotations - -import matplotlib.colors as mcolors -import matplotlib.pyplot as plt -import numpy as np -import pandas as pd -import pytest -from matplotlib import collections - -from shapiq.interaction_values import InteractionValues -from shapiq.plot import beeswarm_plot - -N_SAMPLES = 10 -N_PLAYERS = 5 - - -@pytest.fixture -def mock_interaction_data() -> tuple[list[InteractionValues], np.ndarray, pd.DataFrame, list[str]]: - """Creates mock data for beeswarm plot tests. - - Returns: - A tuple containing a list of InteractionValues, numpy feature data, pandas feature - data, and a list of feature names. - """ - lookup = { - (): 1, - (0,): 0, - (1,): 1, - (2,): 2, - (3,): 3, - (4,): 4, - (0, 1): 5, - (0, 2): 6, - (1, 3): 7, - (2, 4): 8, - (0, 1, 2): 9, - } - n_interactions = len(lookup) - - interaction_values_list = [] - rng = np.random.default_rng(42) - for _ in range(N_SAMPLES): - values = rng.random(n_interactions) * 2 - 1 - iv = InteractionValues( - values=values, - interaction_lookup=lookup, - index="k-SII", - min_order=1, - max_order=3, - n_players=N_PLAYERS, - baseline_value=rng.random(), - ) - interaction_values_list.append(iv) - - feature_data_np = rng.random((N_SAMPLES, N_PLAYERS)) - feature_names = [f"feature_{i}" for i in range(N_PLAYERS)] - feature_data_pd = pd.DataFrame(feature_data_np, columns=feature_names) - - return interaction_values_list, feature_data_np, feature_data_pd, feature_names - - -def test_beeswarm_plot_basic(mock_interaction_data): - """Test the basic beeswarm plot function with numpy and pandas data.""" - interaction_values_list, feature_data_np, feature_data_pd, feature_names = mock_interaction_data - - # numpy data + explicit feature names - ax = beeswarm_plot( - interaction_values_list=interaction_values_list, - data=feature_data_np, - feature_names=feature_names, - show=False, - ) - assert isinstance(ax, plt.Axes) - plt.close("all") - - # pandas data + explicit feature names - ax = beeswarm_plot( - interaction_values_list=interaction_values_list, - data=feature_data_pd, - feature_names=feature_names, - show=False, - ) - assert isinstance(ax, plt.Axes) - plt.close("all") - - # numpy data + default feature names - ax = beeswarm_plot( - interaction_values_list=interaction_values_list, - data=feature_data_np, - show=False, - ) - assert isinstance(ax, plt.Axes) - assert any("F" in label.get_text() for label in ax.get_yticklabels()) - plt.close("all") - - # data with nan values - data_with_nan = feature_data_pd.copy() - data_with_nan.iloc[0, 0] = np.nan - test_alpha = 0.8 - ax = beeswarm_plot( - interaction_values_list=interaction_values_list, - data=data_with_nan, - alpha=test_alpha, - show=False, - ) - - expected_nan_color = list(mcolors.to_rgba("#777777")) - expected_nan_alpha = test_alpha * 0.5 - expected_nan_color[3] = expected_nan_alpha - nan_points_found = False - - for collection in ax.collections: - colors = collection.get_facecolors() - if ( - isinstance(collection, collections.PathCollection) - and collection.get_alpha() == expected_nan_alpha - and np.array_equal(colors[0], expected_nan_color) - ): - nan_points_found = True - break - assert isinstance(ax, plt.Axes) - assert nan_points_found, ( - "No scatter plot collection found with the specific style for NaN values." - ) - plt.close("all") - - # data with all nan values - data_with_nan = feature_data_pd.copy() - data_with_nan.iloc[:, :] = np.nan - test_alpha = 0.8 - ax = beeswarm_plot( - interaction_values_list=interaction_values_list, - data=data_with_nan, - alpha=test_alpha, - show=False, - ) - assert isinstance(ax, plt.Axes) - plt.close("all") - - # all same value - data_with_same_value = feature_data_pd.copy() - data_with_same_value.iloc[:, 0] = 0.5 - ax = beeswarm_plot( - interaction_values_list=interaction_values_list, - data=data_with_same_value, - alpha=test_alpha, - show=False, - ) - assert isinstance(ax, plt.Axes) - plt.close("all") - - -def test_beeswarm_plot_options(mock_interaction_data): - """Test the beeswarm plot function with various options.""" - interaction_values_list, _, feature_data_pd, _ = mock_interaction_data - - # max display - max_disp = 5 - ax = beeswarm_plot( - interaction_values_list=interaction_values_list, - data=feature_data_pd, - max_display=max_disp, - show=False, - ) - assert isinstance(ax, plt.Axes) - - # count background rectangles - n_bg_rectangles = len([p for p in ax.patches if p.get_zorder() == -3]) - total_interactions_available = len(interaction_values_list[0].interaction_lookup) - expected_interactions = min(max_disp, total_interactions_available) - expected_rectangles = np.ceil(expected_interactions / 2) - assert n_bg_rectangles == expected_rectangles - plt.close("all") - - max_disp = None - ax = beeswarm_plot( - interaction_values_list=interaction_values_list, - data=feature_data_pd, - max_display=max_disp, - show=False, - ) - assert isinstance(ax, plt.Axes) - plt.close("all") - - # existing axes - _, ax_existing = plt.subplots() - ax_returned = beeswarm_plot( - interaction_values_list=interaction_values_list, - data=feature_data_pd, - ax=ax_existing, - show=False, - ) - assert ax_returned is ax_existing - plt.close("all") - - # no abbreviation - long_names = [f"a_very_long_feature_name_{i}" for i in range(N_PLAYERS)] - ax = beeswarm_plot( - interaction_values_list=interaction_values_list, - data=feature_data_pd, - feature_names=long_names, - abbreviate=False, - show=False, - ) - assert any(long_names[0] in label.get_text() for label in ax.get_yticklabels()) - plt.close("all") - - # row_height - plt.figure() - ax_large_row = beeswarm_plot( - interaction_values_list=interaction_values_list, - data=feature_data_pd, - row_height=0.8, # larger height - show=False, - ) - fig_large_height = ax_large_row.get_figure().get_size_inches()[1] - plt.close("all") - - plt.figure() - ax_small_row = beeswarm_plot( - interaction_values_list=interaction_values_list, - data=feature_data_pd, - row_height=0.2, # smaller height - show=False, - ) - fig_small_height = ax_small_row.get_figure().get_size_inches()[1] - plt.close("all") - assert fig_large_height > fig_small_height - - # alpha - test_alpha = 0.7 - ax = beeswarm_plot( - interaction_values_list=interaction_values_list, - data=feature_data_pd, - alpha=test_alpha, - show=False, - ) - main_points_found = any( - isinstance(c, collections.PathCollection) and c.get_alpha() == test_alpha - for c in ax.collections - ) - assert main_points_found, "No scatter plot collection found with the specified alpha." - plt.close("all") - - -def test_beeswarm_plot_errors(mock_interaction_data): - """Test that the beeswarm plot raises errors for invalid input.""" - interaction_values_list, feature_data_np, _, feature_names = mock_interaction_data - - # wrong lengths - with pytest.raises(ValueError, match="Length of shap_interaction_values must match"): - beeswarm_plot(interaction_values_list, feature_data_np[1:], show=False) - - # empty interactions - with pytest.raises(ValueError, match="must be a non-empty list"): - beeswarm_plot([], feature_data_np, show=False) - - # wrong data type - with pytest.raises(TypeError, match="must be a pandas DataFrame or a numpy array"): - beeswarm_plot(interaction_values_list, "not_a_valid_data_type", show=False) - - # wrong feature names length - with pytest.raises(ValueError, match="Length of feature_names must match n_players"): - beeswarm_plot( - interaction_values_list, - feature_data_np, - feature_names=feature_names[:-1], - show=False, - ) - - # invalid row height - with pytest.raises(ValueError, match="row_height must be a positive value"): - beeswarm_plot(interaction_values_list, feature_data_np, row_height=-1, show=False) - - # invalid alpha - with pytest.raises(ValueError, match="alpha must be between 0 and 1"): - beeswarm_plot(interaction_values_list, feature_data_np, alpha=-0.1, show=False) diff --git a/tests/shapiq/tests_unit/tests_plots/test_force.py b/tests/shapiq/tests_unit/tests_plots/test_force.py deleted file mode 100644 index b1a4049f2..000000000 --- a/tests/shapiq/tests_unit/tests_plots/test_force.py +++ /dev/null @@ -1,57 +0,0 @@ -"""This module contains all tests for the force plots.""" - -from __future__ import annotations - -import matplotlib.pyplot as plt -import numpy as np - -from shapiq import ExactComputer, InteractionValues, force_plot - - -def test_force_cooking_game(cooking_game): - """Test the force plot function with concrete values from the cooking game.""" - exact_computer = ExactComputer(game=cooking_game, n_players=cooking_game.n_players) - interaction_values = exact_computer(index="k-SII", order=2) - feature_names = list(cooking_game.player_name_lookup.keys()) - force_plot( - interaction_values, show=False, contribution_threshold=0.2, feature_names=feature_names - ) - plt.close() - - # visual inspection: - # - E[f(X)] = 10 - # - f(x) = 15 - # - 0, 1, and 2 should individually have negative contributions (go left) - # - all interactions should have a positive +7 contribution (go right) - # - feature 0 is too small to be displayed because of min_percentage=0.2 - - -def test_force_plot(interaction_values_list: list[InteractionValues]): - """Test the force plot function.""" - iv = interaction_values_list[0] - n_players = iv.n_players - feature_names = [f"feature-{i}" for i in range(n_players)] - feature_names = np.array(feature_names) - - fp = force_plot(iv, show=False) - assert fp is not None - assert isinstance(fp, plt.Figure) - plt.close() - - fp = force_plot(iv, show=False, abbreviate=False) - assert fp is not None - assert isinstance(fp, plt.Figure) - plt.close() - - fp = force_plot(iv, show=False, feature_names=feature_names) - assert isinstance(fp, plt.Figure) - plt.close() - - iv = iv.get_n_order(1) - fp = force_plot(iv, show=False) - assert isinstance(fp, plt.Figure) - plt.close() - - fp = iv.plot_force(show=False) - assert isinstance(fp, plt.Figure) - plt.close() diff --git a/tests/shapiq/tests_unit/tests_plots/test_network_plot.py b/tests/shapiq/tests_unit/tests_plots/test_network_plot.py deleted file mode 100644 index 42d41af7a..000000000 --- a/tests/shapiq/tests_unit/tests_plots/test_network_plot.py +++ /dev/null @@ -1,35 +0,0 @@ -"""This module contains all tests for the network plots.""" - -from __future__ import annotations - -import matplotlib.pyplot as plt -import numpy as np -import scipy as sp - -from shapiq.interaction_values import InteractionValues -from shapiq.plot import network_plot - - -def test_network_plot(): - """Tests whether the network plot can be created.""" - n_players = 5 - n_values = n_players + int(sp.special.binom(n_players, 2)) - iv = InteractionValues( - values=np.random.rand(n_values), - index="k-SII", - n_players=n_players, - min_order=1, - max_order=2, - baseline_value=0.0, - ) - fig, axes = network_plot(interaction_values=iv) - assert fig is not None - assert axes is not None - plt.close(fig) - - # TODO(advueu963): Check whether this test is still valid # noqa: TD003 - # # value error if neither first_order_values nor interaction_values are given - # with pytest.raises(TypeError): - # network_plot() # noqa: ERA001 - - assert True diff --git a/tests/shapiq/tests_unit/tests_plots/test_plot_utils.py b/tests/shapiq/tests_unit/tests_plots/test_plot_utils.py deleted file mode 100644 index a4ca23d1f..000000000 --- a/tests/shapiq/tests_unit/tests_plots/test_plot_utils.py +++ /dev/null @@ -1,25 +0,0 @@ -"""This module contains tests for the plot.utils module.""" - -from __future__ import annotations - -from shapiq.plot.utils import abbreviate_feature_names - - -def test_abbreviate(): - """Tests the abbreviate_feature_names function.""" - # test with all cases - feature_names = [ - # seperators - "feature_A", - "feature-B", - "feature.C", - "feature D", - # seperators with extra dot at the end should not be included - "feature E.", - # capital letters - "CapitalLetters", - # normal base case - "longlowercase", - ] - expected = ["FA", "FB", "FC", "FD", "FE", "CL", "lon."] - assert abbreviate_feature_names(feature_names) == expected diff --git a/tests/shapiq/tests_unit/tests_plots/test_sentence.py b/tests/shapiq/tests_unit/tests_plots/test_sentence.py deleted file mode 100644 index 77f79dddb..000000000 --- a/tests/shapiq/tests_unit/tests_plots/test_sentence.py +++ /dev/null @@ -1,56 +0,0 @@ -"""This test module contains all tests for the sentence plot.""" - -from __future__ import annotations - -import matplotlib.pyplot as plt -import numpy as np - -from shapiq.interaction_values import InteractionValues -from shapiq.plot import sentence_plot - - -def _text_values() -> tuple[list[str], InteractionValues]: - words = ["I", "really", "enjoy", "working", "with", "Shapley", "values", "in", "Python", "!"] - values = [0.45, 0.01, 0.67, -0.2, -0.05, 0.7, 0.1, -0.04, 0.56, 0.7] - iv = InteractionValues( - n_players=10, - values=np.array(values), - index="SV", - min_order=1, - max_order=1, - estimated=False, - baseline_value=0.0, - ) - return words, iv - - -def test_sentence_plot(): - """Test the sentence plot function.""" - words, iv = _text_values() - - fig, ax = sentence_plot(iv, words, show=False) - assert isinstance(fig, plt.Figure) - assert isinstance(ax, plt.Axes) - plt.close(fig) - - fig, ax = iv.plot_sentence( - words, - show=False, - connected_words=[("Shapley", "values")], - max_score=0.5, # max_score is intentionally lower than the attributions here - ) - assert isinstance(fig, plt.Figure) - assert isinstance(ax, plt.Axes) - plt.close(fig) - - fig, ax = sentence_plot( - iv, - words, - chars_per_line=100, - show=False, - connected_words=[("Shapley", "values")], - max_score=1.0, - ) - assert isinstance(fig, plt.Figure) - assert isinstance(ax, plt.Axes) - plt.close(fig) diff --git a/tests/shapiq/tests_unit/tests_plots/test_si_graph.py b/tests/shapiq/tests_unit/tests_plots/test_si_graph.py deleted file mode 100644 index 2146c7768..000000000 --- a/tests/shapiq/tests_unit/tests_plots/test_si_graph.py +++ /dev/null @@ -1,167 +0,0 @@ -"""This test module contains all tests for the explanation plot functions.""" - -from __future__ import annotations - -import matplotlib.pyplot as plt -import networkx as nx -import numpy as np -import pytest -from PIL import Image - -from shapiq.plot import si_graph_plot - - -@pytest.mark.parametrize("draw_threshold", [0.0, 0.5]) -@pytest.mark.parametrize("compactness", [0.0, 1.0, 10.0]) -@pytest.mark.parametrize("n_interactions", [3, None]) -def test_si_graph_plot( - draw_threshold, - compactness, - n_interactions, - example_values, -): - """Tests the explanation_graph_plot function.""" - - graph_tuple = [(1, 2), (2, 3), (3, 4), (2, 4), (1, 4)] - - # test without graph and from interaction values - fig, ax = example_values.plot_si_graph(show=False) - assert isinstance(fig, plt.Figure) - assert isinstance(ax, plt.Axes) - plt.close("all") - - fig, ax = si_graph_plot( - example_values, - graph=graph_tuple, - random_seed=1, - size_factor=0.7, - draw_threshold=draw_threshold, - plot_explanation=True, - n_interactions=n_interactions, - compactness=compactness, - show=False, - ) - assert isinstance(fig, plt.Figure) - assert isinstance(ax, plt.Axes) - plt.close("all") - - fig, ax = si_graph_plot( - example_values, - graph=graph_tuple, - random_seed=1, - size_factor=0.7, - draw_threshold=draw_threshold, - plot_explanation=False, - n_interactions=n_interactions, - compactness=compactness, - show=False, - ) - assert isinstance(fig, plt.Figure) - assert isinstance(ax, plt.Axes) - plt.close("all") - - edges = nx.Graph() - edges.add_edges_from([(1, 2), (2, 3), (3, 4), (2, 4), (1, 4)]) - pos = nx.spring_layout(edges, seed=1) - - fig, ax = si_graph_plot( - example_values, - graph=edges, - random_seed=1, - size_factor=0.7, - draw_threshold=draw_threshold, - plot_explanation=True, - n_interactions=n_interactions, - compactness=compactness, - feature_names=["A", "B", "C", "D"], - show=False, - ) - - assert isinstance(fig, plt.Figure) - assert isinstance(ax, plt.Axes) - plt.close("all") - - # different parameters - fig, ax = si_graph_plot( - example_values, - graph=edges, - pos=pos, - random_seed=1, - draw_threshold=draw_threshold, - plot_explanation=True, - n_interactions=n_interactions, - adjust_node_pos=True, - interaction_direction="positive", - min_max_interactions=(-0.5, 0.5), - show=False, - ) - - assert isinstance(fig, plt.Figure) - assert isinstance(ax, plt.Axes) - plt.close("all") - - fig, ax = si_graph_plot( - example_values, - graph=graph_tuple, - pos=pos, - random_seed=1, - draw_threshold=draw_threshold, - plot_explanation=True, - n_interactions=n_interactions, - adjust_node_pos=True, - interaction_direction="negative", - min_max_interactions=(-0.5, 0.5), - feature_names=["A", "B", "C", "D"], - show=False, - ) - - assert isinstance(fig, plt.Figure) - assert isinstance(ax, plt.Axes) - plt.close("all") - - -def test_feature_imgs(example_values): - random_img = np.random.randint(0, 256, (128, 128, 3), dtype=np.uint8) - img = Image.fromarray(random_img) - - n = 7 - img_list = [img for _ in range(n)] - fig, ax = example_values.plot_si_graph( - feature_image_patches=img_list, - show=False, - ) - assert isinstance(fig, plt.Figure) - assert isinstance(ax, plt.Axes) - plt.close("all") - - img_dict = {index: img_list[index] for index in range(n)} - graph = [(i, i + 1) for i in range(n - 1)] - graph.append((n - 1, 0)) - fig, ax = example_values.plot_si_graph( - feature_image_patches=img_dict, - show=False, - ) - assert isinstance(fig, plt.Figure) - assert isinstance(ax, plt.Axes) - plt.close("all") - - -def test_feature_names(example_values): - feature_names_list = ["A", "B", "C", "D"] - feature_names = {index + 1: feature_names_list[index] for index in range(4)} - fig, ax = example_values.plot_si_graph(feature_names=feature_names, show=False) - assert isinstance(fig, plt.Figure) - assert isinstance(ax, plt.Axes) - plt.close("all") - - -def test_legend(example_values): - from shapiq.plot.si_graph import get_legend - - fig, ax = example_values.plot_si_graph( - show=False, - ) - get_legend(ax) - assert isinstance(fig, plt.Figure) - assert isinstance(ax, plt.Axes) - plt.close("all") diff --git a/tests/shapiq/tests_unit/tests_plots/test_stacked_bar.py b/tests/shapiq/tests_unit/tests_plots/test_stacked_bar.py deleted file mode 100644 index bf19faa04..000000000 --- a/tests/shapiq/tests_unit/tests_plots/test_stacked_bar.py +++ /dev/null @@ -1,62 +0,0 @@ -"""This module contains all tests for the stacked bar plots.""" - -from __future__ import annotations - -import matplotlib.pyplot as plt -import numpy as np - -from shapiq.interaction_values import InteractionValues -from shapiq.plot import stacked_bar_plot - - -def test_stacked_bar_plot(): - """Tests whether the stacked bar plot can be created.""" - interaction_values = InteractionValues( - values=np.array([1, -1.5, 1.75, 0.25, -0.5, 0.75, 0.2]), - index="SII", - min_order=1, - max_order=3, - n_players=3, - baseline_value=0, - ) - feature_names = ["a", "b", "c"] - fig, axes = stacked_bar_plot( - interaction_values=interaction_values, - feature_names=feature_names, - ) - assert isinstance(fig, plt.Figure) - assert isinstance(axes, plt.Axes) - plt.close() - - fig, axes = stacked_bar_plot( - interaction_values=interaction_values, - feature_names=feature_names, - max_order=2, - title="Title", - xlabel="X", - ylabel="Y", - ) - assert isinstance(fig, plt.Figure) - assert isinstance(axes, plt.Axes) - plt.close() - - fig, axes = stacked_bar_plot( - interaction_values=interaction_values, - feature_names=None, - max_order=2, - title="Title", - xlabel="X", - ylabel="Y", - ) - assert isinstance(fig, plt.Figure) - assert isinstance(axes, plt.Axes) - plt.close() - - fig, axes = stacked_bar_plot( - interaction_values=interaction_values, - feature_names=feature_names, - show=False, - ) - assert isinstance(fig, plt.Figure) - assert isinstance(axes, plt.Axes) - plt.close() diff --git a/tests/shapiq/tests_unit/tests_plots/test_upset.py b/tests/shapiq/tests_unit/tests_plots/test_upset.py deleted file mode 100644 index a4c89a367..000000000 --- a/tests/shapiq/tests_unit/tests_plots/test_upset.py +++ /dev/null @@ -1,63 +0,0 @@ -"""This module contains all tests for the upset plot.""" - -from __future__ import annotations - -import matplotlib.pyplot as plt -import numpy as np - -from shapiq.interaction_values import InteractionValues -from shapiq.plot import upset_plot - - -def test_upset_plot(): - """Test the force plot function.""" - lookup = { - (0,): 0, - (1,): 1, - (2,): 2, - (0, 1): 3, - (0, 2): 4, - (0, 1, 2): 5, - (1, 4): 6, - (2, 3): 7, - (0, 1, 3): 8, - (0, 2, 3): 9, - (0, 1, 2, 3): 10, - (0, 1, 2, 4): 11, - (0, 1, 2, 3, 4): 12, - } - iv = InteractionValues( - values=np.array([1, 2, 1.5, -0.9, 0.1, 0.3, -0.2, 0.1, 0.11, -0.1, 0.2, 0.8, 0.05]), - interaction_lookup=lookup, - index="k-SII", - min_order=1, - max_order=5, - baseline_value=0.0, - n_players=5, - ) - n_players = iv.n_players - feature_names = [f"feature-{i}" for i in range(n_players)] - feature_names = np.array(feature_names) - - fig = upset_plot(iv, feature_names=feature_names, show=False) - assert isinstance(fig, plt.Figure) - plt.close("all") - - fig = upset_plot(iv, feature_names=feature_names, color_matrix=True, show=False) - assert isinstance(fig, plt.Figure) - plt.close("all") - - # in the following feature 3 is not shown - fig = upset_plot(iv, n_interactions=5, all_features=False, show=False) - assert isinstance(fig, plt.Figure) - plt.close("all") - - # in the following feature 3 is shown - fig = upset_plot(iv, n_interactions=5, all_features=True, show=False) - assert isinstance(fig, plt.Figure) - plt.close("all") - - # test once directly from the interaction values - fig = iv.plot_upset(feature_names=feature_names, show=False) - assert isinstance(fig, plt.Figure) - plt.close("all") diff --git a/tests/shapiq/tests_unit/tests_plots/test_utils.py b/tests/shapiq/tests_unit/tests_plots/test_utils.py deleted file mode 100644 index df4db3b9b..000000000 --- a/tests/shapiq/tests_unit/tests_plots/test_utils.py +++ /dev/null @@ -1,37 +0,0 @@ -"""This test module tests all plotting utilities.""" - -from __future__ import annotations - -from shapiq.plot.utils import abbreviate_feature_names, format_labels, format_value - - -def test_format_value(): - """Test the format_value function.""" - assert format_value(1.0) == "1" - assert format_value(1.234) == "1.23" - assert format_value(-1.234) == "\u22121.23" - assert format_value("1.234") == "1.234" - - -def test_format_labels(): - """Test the format_labels function.""" - feature_mapping = {0: "A", 1: "B", 2: "C"} - assert format_labels(feature_mapping, (0, 1)) == "A x B" - assert format_labels(feature_mapping, (0,)) == "A" - assert format_labels(feature_mapping, ()) == "Base Value" - assert format_labels(feature_mapping, (0, 1, 2)) == "A x B x C" - - -def test_abbreviate_feature_names(): - """Tests the abbreviate_feature_names function.""" - # check for splitting characters - feature_names = ["feature-0", "feature_1", "feature 2", "feature.3"] - assert abbreviate_feature_names(feature_names) == ["F0", "F1", "F2", "F3"] - - # check for long names - feature_names = ["longfeaturenamethatisnotshort", "stilllong"] - assert abbreviate_feature_names(feature_names) == ["lon.", "sti."] - - # check for abbreviation with capital letters - feature_names = ["LongFeatureName", "Short"] - assert abbreviate_feature_names(feature_names) == ["LFN", "Sho."] diff --git a/tests/shapiq/tests_unit/tests_plots/test_waterfall.py b/tests/shapiq/tests_unit/tests_plots/test_waterfall.py deleted file mode 100644 index 37d8cb58a..000000000 --- a/tests/shapiq/tests_unit/tests_plots/test_waterfall.py +++ /dev/null @@ -1,57 +0,0 @@ -"""This module contains all tests for the waterfall plots.""" - -from __future__ import annotations - -import matplotlib.pyplot as plt -import numpy as np - -from shapiq import ExactComputer, InteractionValues, waterfall_plot - - -def test_waterfall_cooking_game(cooking_game): - """Test the waterfall plot function with concrete values from the cooking game.""" - exact_computer = ExactComputer(game=cooking_game, n_players=cooking_game.n_players) - interaction_values = exact_computer(index="k-SII", order=2) - waterfall_plot(interaction_values, show=False) - plt.close("all") - - # visual inspection: - # - E[f(X)] = 10 - # - f(x) = 15 - # - 0, 1, and 2 should individually have negative contributions (go left) - # - all interactions should have a positive +7 contribution (go right) - - waterfall_plot(interaction_values, show=False, max_display=2) - # visual inspection: - # - E[f(X)] = 10 - # - f(x) = 15 - # - 0x1 should have +7 contribution (go right) - # - remaining 5 interactions should have -2 negative contributions (go left) - # - Nowhere should there be any cutoffs - plt.close("all") - - -def test_waterfall_plot(interaction_values_list: list[InteractionValues]): - """Test the waterfall plot function.""" - iv = interaction_values_list[0] - n_players = iv.n_players - feature_names = [f"feature-{i}" for i in range(n_players)] - feature_names = np.array(feature_names) - - wp = waterfall_plot(iv, show=False) - assert wp is not None - assert isinstance(wp, plt.Axes) - plt.close() - - wp = waterfall_plot(iv, show=False, feature_names=feature_names) - assert isinstance(wp, plt.Axes) - plt.close() - - iv = iv.get_n_order(1) - wp = waterfall_plot(iv, show=False) - assert isinstance(wp, plt.Axes) - plt.close() - - wp = iv.plot_waterfall(show=False) - assert isinstance(wp, plt.Axes) - plt.close() diff --git a/tests/shapiq/tests_unit/tests_utils/__init__.py b/tests/shapiq/tests_unit/tests_utils/__init__.py deleted file mode 100644 index 3d55c807c..000000000 --- a/tests/shapiq/tests_unit/tests_utils/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Tests for utility functions.""" diff --git a/tests/shapiq/tests_unit/tests_utils/test_saving.py b/tests/shapiq/tests_unit/tests_utils/test_saving.py deleted file mode 100644 index bc8e9cabd..000000000 --- a/tests/shapiq/tests_unit/tests_utils/test_saving.py +++ /dev/null @@ -1,131 +0,0 @@ -"""Tests for the io utils module.""" - -from __future__ import annotations - -import datetime -from importlib.metadata import version - -import pytest - -from shapiq import KernelSHAP as ApproximatorForTest -from shapiq.utils.saving import ( - dict_to_lookup_and_values, - lookup_and_values_to_dict, - make_file_metadata, - safe_str_to_tuple, - safe_tuple_to_str, -) - - -class TestInteractionConversion: - """Tests converting interaction lookup and values to a dictionary and back.""" - - def test_interactions_to_dict(self, iv_7_all): - """Test converting interaction lookup and values to a dictionary.""" - interaction_lookup, interaction_values = iv_7_all.interaction_lookup, iv_7_all.values - interaction_dict = lookup_and_values_to_dict(interaction_lookup, interaction_values) - - # Check if the dictionary has the correct keys and values - for tup in interaction_lookup: - assert safe_tuple_to_str(tup) in interaction_dict - assert ( - interaction_dict[safe_tuple_to_str(tup)] - == interaction_values[interaction_lookup[tup]] - ) - - def test_dict_to_interactions(self, iv_7_all): - """Test converting a dictionary of interaction values back to lookup and values.""" - interaction_lookup, interaction_values = iv_7_all.interaction_lookup, iv_7_all.values - interaction_dict = lookup_and_values_to_dict(interaction_lookup, interaction_values) - - new_lookup, new_values = dict_to_lookup_and_values(interaction_dict) - - # Check if the new lookup matches the original - assert new_lookup == interaction_lookup - - # Check if the new values match the original - for interaction in interaction_lookup: - assert ( - new_values[interaction_lookup[interaction]] - == interaction_values[interaction_lookup[interaction]] - ) - - -class TestTupleConversion: - """Tests for tuple conversion functions.""" - - data_to_test = ( - ((1, 2, 3), "1,2,3"), - ((1, 2, 3, 4), "1,2,3,4"), - ((10, 20), "10,20"), - ((0, 0, 0), "0,0,0"), # testing with same integers - ((3, 2, 1), "3,2,1"), # tuples are not sorted - ((-1, -2, -3), "-1,-2,-3"), # negative integers work (not important, but good to test) - ((100,), "100"), # single element tuple - ((), "Empty"), # Empty tuple case - ) - - @pytest.mark.parametrize("tup, expected_str", data_to_test) - def test_safe_tuple_to_str(self, tup, expected_str): - """Test converting a tuple of integers to a string.""" - assert safe_tuple_to_str(tup) == expected_str - - @pytest.mark.parametrize("tup, string_data", data_to_test) - def test_safe_str_to_tuple(self, tup, string_data): - """Test converting a string representation of integers back to a tuple.""" - assert safe_str_to_tuple(string_data) == tup - - -class TestMetadataBlock: - """Tests for metadata block creation.""" - - def test_meta_data_defaults(self, iv_7_all): - """Tests creating a metadata block with default values.""" - metadata = make_file_metadata(iv_7_all) - assert metadata["version"] == version("shapiq") - assert metadata["data_type"] is None - assert metadata["created_from"] is None - assert metadata["description"] is None - assert metadata["parameters"] == {} - - def test_meta_data_time(self, iv_7_all): - """Tests if the timestamp is created correctly.""" - now = datetime.datetime.now(tz=datetime.UTC).isoformat() + "Z" - metadata = make_file_metadata(iv_7_all) - now_metadata = metadata["timestamp"] - assert now_metadata.startswith(now[:20]) # check if timestamp is almost equal to now - - @pytest.mark.parametrize( - "object_fixture, expected_name", - [ - ("iv_7_all", "InteractionValues"), - ("cooking_game_pre_computed", "CookingGame"), - ], - ) - def test_make_metadata_block(self, object_fixture, expected_name, request): - """Test creating a metadata block.""" - - object_to_store = request.getfixturevalue(object_fixture) - - desc = "This is a test description." - parameters = {"param1": "value1", "param2": 42} - - metadata = make_file_metadata( - object_to_store, - desc=desc, - parameters=parameters, - data_type="game", - created_from=ApproximatorForTest, - ) - - # check version is correct - assert isinstance(metadata["version"], str) # Version should be a string - assert metadata["version"] == version("shapiq") - - # check if rest is correct - object_name = metadata["object_name"] - assert object_name == expected_name - assert metadata["data_type"] == "game" - assert metadata["description"] == desc - assert metadata["created_from"] == repr(ApproximatorForTest) - assert metadata["parameters"] == parameters diff --git a/tests/shapiq/tests_unit/tests_utils/test_utils_modules.py b/tests/shapiq/tests_unit/tests_utils/test_utils_modules.py deleted file mode 100644 index cd1723ac0..000000000 --- a/tests/shapiq/tests_unit/tests_utils/test_utils_modules.py +++ /dev/null @@ -1,33 +0,0 @@ -"""This test module contains tests for utils.modules.""" - -from __future__ import annotations - -import pytest -from sklearn.tree import DecisionTreeRegressor - -from shapiq.utils import check_import_module, safe_isinstance - - -def test_safe_isinstance(): - """Test the safe_isinstance function.""" - model = DecisionTreeRegressor() - - assert safe_isinstance(model, "sklearn.tree.DecisionTreeRegressor") - assert safe_isinstance( - model, - ["sklearn.tree.DecisionTreeClassifier", "sklearn.tree.DecisionTreeRegressor"], - ) - assert safe_isinstance(model, ("sklearn.tree.DecisionTreeRegressor",)) - with pytest.raises(ValueError): - safe_isinstance(model, "DecisionTreeRegressor") - with pytest.raises(ValueError): - safe_isinstance(model, None) - assert not safe_isinstance(model, "my.made.up.module") - assert not safe_isinstance(model, ["sklearn.ensemble.DecisionTreeRegressor"]) - - -def test_check_import_module(): - """Test check_import_module function.""" - check_import_module("sklearn") - with pytest.raises(ImportError): - check_import_module("my.made.up.module", functionality="something") diff --git a/tests/shapiq/tests_unit/tests_utils/test_utils_sets.py b/tests/shapiq/tests_unit/tests_utils/test_utils_sets.py deleted file mode 100644 index 9a8985906..000000000 --- a/tests/shapiq/tests_unit/tests_utils/test_utils_sets.py +++ /dev/null @@ -1,211 +0,0 @@ -"""This test module contains the test cases for the utils sets module.""" - -from __future__ import annotations - -import numpy as np -import pytest - -from shapiq.utils import ( - count_interactions, - generate_interaction_lookup, - generate_interaction_lookup_from_coalitions, - get_explicit_subsets, - pair_subset_sizes, - powerset, - split_subsets_budget, - transform_array_to_coalitions, - transform_coalitions_to_array, -) - - -@pytest.mark.parametrize( - ("iterable", "min_size", "max_size", "expected"), - [ - ([1, 2, 3], 0, None, [(), (1,), (2,), (3,), (1, 2), (1, 3), (2, 3), (1, 2, 3)]), - ([1, 2, 3], 1, None, [(1,), (2,), (3,), (1, 2), (1, 3), (2, 3), (1, 2, 3)]), - ([1, 2, 3], 0, 2, [(), (1,), (2,), (3,), (1, 2), (1, 3), (2, 3)]), - ( - ["A", "B", "C"], - 0, - None, - [(), ("A",), ("B",), ("C",), ("A", "B"), ("A", "C"), ("B", "C"), ("A", "B", "C")], - ), - ], -) -def test_powerset(iterable, min_size, max_size, expected): - """Tests the powerset function.""" - assert list(powerset(iterable, min_size, max_size)) == expected - - -@pytest.mark.parametrize( - ("order", "n", "expected"), - [ - (1, 5, ([(1, 4), (2, 3)], None)), - (2, 5, ([(2, 3)], None)), - (3, 5, ([], None)), - (1, 6, ([(1, 5), (2, 4)], 3)), - (2, 6, ([(2, 4)], 3)), - (3, 6, ([], 3)), - ], -) -def test_pairing(order, n, expected): - """Tests the get_paired_subsets function.""" - assert pair_subset_sizes(order, n) == expected - - -@pytest.mark.parametrize( - ("order", "n", "budget", "q", "expected"), - [ - (1, 6, 100, [0, 1, 1, 1, 1, 1, 0], ([1, 5, 2, 4, 3], [], 38)), - (1, 6, 60, [0, 1, 1, 1, 1, 1, 0], ([1, 5, 2, 4], [3], 18)), - (1, 6, 100, [0, 0, 0, 0, 0, 0, 0], ([], [1, 2, 3, 4, 5], 100)), - ], -) -def test_split_subsets_budget(budget, order, n, q, expected): - """Tests the split_subsets_budget function.""" - sampling_weights = np.asarray(q, dtype=float) - assert split_subsets_budget(order, n, budget, sampling_weights) == expected - assert ( - split_subsets_budget(order=order, n=n, budget=budget, sampling_weights=sampling_weights) - == expected - ) - - -@pytest.mark.parametrize( - ("n", "subset_sizes", "expected"), - [ - (3, [1, 2], [(0,), (1,), (2,), (0, 1), (0, 2), (1, 2)]), - (3, [1, 2, 3], [(0,), (1,), (2,), (0, 1), (0, 2), (1, 2), (0, 1, 2)]), - ], -) -def test_get_explicit_subsets(n, subset_sizes, expected): - """Tests the get_explicit_subsets function.""" - - def check_correctness(subsets, expected): - assert len(subsets) == len(expected) - expected_array = np.zeros((len(expected), n), dtype=bool) - for i, subset in enumerate(expected): - expected_array[i, subset] = True - assert np.all(subsets == expected_array) - - explicit_subsets = get_explicit_subsets(n, subset_sizes) # without parameter names - check_correctness(explicit_subsets, expected) - explicit_subsets = get_explicit_subsets(n=n, subset_sizes=subset_sizes) # with parameter names - check_correctness(explicit_subsets, expected) - - -@pytest.mark.parametrize( - ("n", "min_order", "max_order", "expected"), - [ - (3, 1, 1, {(0,): 0, (1,): 1, (2,): 2}), - (3, 2, 2, {(0, 1): 0, (0, 2): 1, (1, 2): 2}), - (3, 3, 3, {(0, 1, 2): 0}), - (3, 1, 2, {(0,): 0, (1,): 1, (2,): 2, (0, 1): 3, (0, 2): 4, (1, 2): 5}), - (3, 1, 3, {(0,): 0, (1,): 1, (2,): 2, (0, 1): 3, (0, 2): 4, (1, 2): 5, (0, 1, 2): 6}), - (["A", "B", "C"], 1, 1, {("A",): 0, ("B",): 1, ("C",): 2}), - ({1, 5, 8}, 1, 2, {(1,): 0, (5,): 1, (8,): 2, (1, 5): 3, (1, 8): 4, (5, 8): 5}), - ], -) -def test_generate_interaction_lookup(n, min_order, max_order, expected): - """Tests the generate_interaction_lookup function.""" - assert generate_interaction_lookup(n, min_order, max_order) == expected - - -@pytest.mark.parametrize( - ("coalitions", "expected"), - [ - ( - np.array([[1, 0, 1], [0, 1, 1], [1, 1, 0], [0, 0, 1]]), - {(0, 2): 0, (1, 2): 1, (0, 1): 2, (2,): 3}, - ), - ( - np.array([[1, 1, 1], [0, 1, 0], [1, 0, 0], [0, 0, 1]]), - {(0, 1, 2): 0, (1,): 1, (0,): 2, (2,): 3}, - ), - ( - np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]]), - {(0,): 0, (1,): 1, (2,): 2}, - ), - ( - np.array([[1, 1, 0, 1], [0, 0, 1, 1], [1, 0, 1, 0]]), - {(0, 1, 3): 0, (2, 3): 1, (0, 2): 2}, - ), - ( - np.array([[0, 0, 0], [1, 1, 1]]), - {(): 0, (0, 1, 2): 1}, - ), - ], -) -def test_generate_interaction_lookup_from_coalitions(coalitions, expected): - """Tests the generate_interaction_lookup_from_coalitions function.""" - result = generate_interaction_lookup_from_coalitions(coalitions) - assert result == expected - - -@pytest.mark.parametrize( - ("coalitions", "n_player", "expected"), - [ - ( - [(0,), (1,), (2,), (0, 1), (0, 2), (1, 2), (0, 1, 2)], - None, - np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1], [1, 1, 0], [1, 0, 1], [0, 1, 1], [1, 1, 1]]), - ), - ( - [(0, 1), (1, 2), (0, 2)], - 3, - np.array([[1, 1, 0], [0, 1, 1], [1, 0, 1]]), - ), - ( - [(0, 1), (1, 2), (0, 2)], - 4, - np.array([[1, 1, 0, 0], [0, 1, 1, 0], [1, 0, 1, 0]]), - ), - ], -) -def test_transform_coalitions_to_array(coalitions, n_player, expected): - """Tests the transform_coalitions_to_array function.""" - assert np.all(transform_coalitions_to_array(coalitions, n_player) == expected) - - -@pytest.mark.parametrize( - ("coalitions", "expected"), - [ - ( - np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1], [1, 1, 0], [1, 0, 1], [0, 1, 1], [1, 1, 1]]), - [(0,), (1,), (2,), (0, 1), (0, 2), (1, 2), (0, 1, 2)], - ), - ( - np.array([[1, 1, 0], [0, 1, 1], [1, 0, 1]]), - [(0, 1), (1, 2), (0, 2)], - ), - ( - np.array([[1, 1, 0, 0], [0, 1, 1, 0], [1, 0, 1, 0]]), - [(0, 1), (1, 2), (0, 2)], - ), - ( - np.array([[False, False, False], [True, True, True]]), - [(), (0, 1, 2)], - ), - ], -) -def test_transform_array_to_coalitions(coalitions, expected): - """Tests the transform_array_to_coalitions function.""" - assert transform_array_to_coalitions(coalitions) == expected - - -@pytest.mark.parametrize( - ("n", "max_order", "min_order", "expected"), - [ - (3, None, 0, 8), - (3, 1, 1, 3), - (3, 2, 1, 6), - (3, 2, 0, 7), - (3, 3, 1, 7), - (3, 3, 2, 4), - ], -) -def test_count_interactions(n, max_order, min_order, expected): - """Tests the count_interactions function.""" - count = count_interactions(n, max_order, min_order) - assert count == expected - assert isinstance(count, int) diff --git a/tests/shapiq/utils.py b/tests/shapiq/utils.py deleted file mode 100644 index 44370a529..000000000 --- a/tests/shapiq/utils.py +++ /dev/null @@ -1,47 +0,0 @@ -"""This module contains utility functions for testing purposes.""" - -from __future__ import annotations - -from typing import TYPE_CHECKING - -import pytest - -from shapiq.game_theory import index_generalizes_bv, index_generalizes_sv - -if TYPE_CHECKING: - from shapiq.typing import IndexType - - -def get_concrete_class(abclass): - """Class decorator to create a concrete class from an abstract class. - - The function is used to test abstract classes and their methods. - Directly taken from https://stackoverflow.com/a/37574495. - - Args: - abclass: The abstract class to create a concrete class from. - - Returns: - The concrete class. - - """ - - class concreteCls(abclass): - pass - - concreteCls.__abstractmethods__ = frozenset() - return type("DummyConcrete" + abclass.__name__, (concreteCls,), {}) - - -def get_expected_index_or_skip(index: IndexType, order: int) -> IndexType: - """Get the expected index based on the order and index.""" - expected_index = index - if order == 1: - expected_index = "BV" if index_generalizes_bv(index) else expected_index - expected_index = "SV" if index_generalizes_sv(index) else expected_index - - # skip tests for indices that are not possible - if expected_index in ["BV", "SV"] and order > 1: - pytest.xfail("Indices BV and SV are not possible for order > 1") - - return expected_index