• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mmschlk / shapiq / 16350591025

17 Jul 2025 04:26PM UTC coverage: 93.901% (+16.3%) from 77.589%
16350591025

Pull #416

github

web-flow
Merge 158d774a2 into 82c8f7562
Pull Request #416: moves benchmark and games out of shapiq core

25 of 44 new or added lines in 14 files covered. (56.82%)

4 existing lines in 1 file now uncovered.

4927 of 5247 relevant lines covered (93.9%)

0.94 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

94.12
/src/shapiq/__init__.py
1
"""shapiq: Shapley Interactions for Machine Learning.
2

3
shapiq is a library creating explanations for machine learning models based on
4
the well established Shapley value and its generalization to interaction.
5
"""
6

7
from __future__ import annotations
1✔
8

9
from typing import TYPE_CHECKING
1✔
10

11
if TYPE_CHECKING:
1✔
NEW
12
    from types import ModuleType
×
13

14
# approximator classes
15
from ._deprecated_redirects import try_import_deprecated
1✔
16
from .approximator import (
1✔
17
    SHAPIQ,
18
    SPEX,
19
    SVARM,
20
    SVARMIQ,
21
    InconsistentKernelSHAPIQ,
22
    KernelSHAP,
23
    KernelSHAPIQ,
24
    OwenSamplingSV,
25
    PermutationSamplingSII,
26
    PermutationSamplingSTII,
27
    PermutationSamplingSV,
28
    RegressionFBII,
29
    RegressionFSII,
30
    StratifiedSamplingSV,
31
    UnbiasedKernelSHAP,
32
    kADDSHAP,
33
)
34

35
# dataset functions
36
from .datasets import load_adult_census, load_bike_sharing, load_california_housing
1✔
37

38
# explainer classes
39
from .explainer import (
1✔
40
    AgnosticExplainer,
41
    Explainer,
42
    TabPFNExplainer,
43
    TabularExplainer,
44
    TreeExplainer,
45
)
46

47
# game classes
48
from .game import Game
1✔
49

50
# exact computer classes
51
from .game_theory.exact import ExactComputer
1✔
52

53
# imputer classes
54
from .imputer import BaselineImputer, ConditionalImputer, MarginalImputer, TabPFNImputer
1✔
55

56
# base classes
57
from .interaction_values import InteractionValues
1✔
58

59
# plotting functions
60
from .plot import (
1✔
61
    bar_plot,
62
    beeswarm_plot,
63
    force_plot,
64
    network_plot,
65
    sentence_plot,
66
    si_graph_plot,
67
    stacked_bar_plot,
68
    upset_plot,
69
    waterfall_plot,
70
)
71

72
# public utils functions
73
from .utils import (  # sets.py  # tree.py
1✔
74
    get_explicit_subsets,
75
    powerset,
76
    safe_isinstance,
77
    split_subsets_budget,
78
)
79

80
__all__ = [
1✔
81
    # base
82
    "InteractionValues",
83
    "ExactComputer",
84
    "Game",
85
    # approximators
86
    "PermutationSamplingSII",
87
    "PermutationSamplingSTII",
88
    "PermutationSamplingSV",
89
    "StratifiedSamplingSV",
90
    "OwenSamplingSV",
91
    "KernelSHAP",
92
    "RegressionFSII",
93
    "RegressionFBII",
94
    "KernelSHAPIQ",
95
    "InconsistentKernelSHAPIQ",
96
    "SHAPIQ",
97
    "SVARM",
98
    "SVARMIQ",
99
    "kADDSHAP",
100
    "UnbiasedKernelSHAP",
101
    "SPEX",
102
    # explainers
103
    "Explainer",
104
    "TabularExplainer",
105
    "TreeExplainer",
106
    "TabPFNExplainer",
107
    "AgnosticExplainer",
108
    # imputers
109
    "MarginalImputer",
110
    "BaselineImputer",
111
    "ConditionalImputer",
112
    "TabPFNImputer",
113
    # plots
114
    "network_plot",
115
    "stacked_bar_plot",
116
    "force_plot",
117
    "bar_plot",
118
    "si_graph_plot",
119
    "waterfall_plot",
120
    "sentence_plot",
121
    "upset_plot",
122
    "beeswarm_plot",
123
    # public utils
124
    "powerset",
125
    "get_explicit_subsets",
126
    "split_subsets_budget",
127
    "safe_isinstance",
128
    # datasets
129
    "load_bike_sharing",
130
    "load_adult_census",
131
    "load_california_housing",
132
]
133

134

135
def __getattr__(name: str) -> ModuleType | None:
1✔
136
    """Redirect deprecated imports to the new module."""
137
    return try_import_deprecated(name)
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc