Skip to content

Commit 6a5b1cf

Browse files
authored
Merge pull request #335 from mmschlk/fix_stacked_bar_plot
bug fix for stacked_bar plot
2 parents 30a305e + 4189b23 commit 6a5b1cf

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
- removes `sample_replacements` parameter from `MarginalImputer` and removes the DeprecationWarning for it
55
- adds a trivial computation to `TreeSHAP-IQ` for trees that use only one feature in the tree (this works for decision stumps or trees splitting on only one feature multiple times). In such trees, the computation is trivial as the whole effect of $\nu(N) - \nu(\emptyset)$ is all on the main effect of the single feature and there is no interaction effect. This expands on the fix in v1.2.1 [#286](https://github.com/mmschlk/shapiq/issues/286).
66
- fixes a bug with xgboost where feature names where trees that did not contain all features would lead `TreeExplainer` to fail
7+
- fixes a bug with `stacked_bar_plot` where the higher order interactions were inflated by the lower order interactions, thus wrongly showing the higher order interactions as higher than they are
78

89
### v1.2.2 (2025-03-11)
910
- changes python support to 3.10-3.13 [#318](https://github.com/mmschlk/shapiq/pull/318)

shapiq/interaction_values.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ def get_n_order_values(self, order: int) -> "np.ndarray":
469469
raise ValueError("Order must be greater or equal to 1.")
470470
values_shape = tuple([self.n_players] * order)
471471
values = np.zeros(values_shape, dtype=float)
472-
for interaction in powerset(range(self.n_players), min_size=1, max_size=order):
472+
for interaction in powerset(range(self.n_players), min_size=order, max_size=order):
473473
# get all orderings of the interaction (e.g. (0, 1) and (1, 0) for interaction (0, 1))
474474
for perm in permutations(interaction):
475475
values[perm] = self[interaction]

0 commit comments

Comments
 (0)