Skip to content

Commit

Permalink
Merge pull request #579 from aai-institute/fix/474-inconsistent-test
Browse files Browse the repository at this point in the history
Add a temporary fix to handle an edge case in the test test_classwise…
  • Loading branch information
schroedk authored May 7, 2024
2 parents 8e211dc + 84c42b6 commit c194d4d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
`torch.linalg.eigh`, so the user can check if it is related to a known
issue
[PR #578](https://github.com/aai-institute/pyDVL/pull/578)
- Fix an edge case (empty train data) in the test
`test_classwise_scorer_accuracies_manual_derivation`, which resulted
in undefined behavior (`np.nan` to `int` conversion with different results
depending on OS)
[PR #579](https://github.com/aai-institute/pyDVL/pull/579)

### Changed

Expand Down
8 changes: 8 additions & 0 deletions tests/value/shapley/test_classwise.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,14 @@ def test_classwise_scorer_accuracies_manual_derivation(
for set_zero_idx in range(len(subsets_zero)):
for set_one_idx in range(len(subsets_one)):
indices = list(subsets_zero[set_zero_idx] + subsets_one[set_one_idx])

# TODO the powersets subsets_zero, subsets_one contain the empty set, having
# this leads to an empty index set with the consequence of undefined
# behavior (due to nan values). This is NOT the correct fix, this test
# must be completely revised!
if len(indices) == 0:
continue

(
x_train,
y_train,
Expand Down

0 comments on commit c194d4d

Please sign in to comment.