Skip to content

Commit

Permalink
change test to detect dataset changes
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbkoch committed Jan 14, 2025
1 parent 8df7c6b commit 16b7694
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions python/interpret-core/tests/glassbox/ebm/test_ebm.py
Original file line number Diff line number Diff line change
Expand Up @@ -1255,6 +1255,7 @@ def test_identical_classification():
set_option("acceleration", 0)

for iteration in range(3):
tot = 0.0
total = 0.0
seed = 0
for i in range(10):
Expand All @@ -1263,6 +1264,13 @@ def test_identical_classification():
)
seed += 1

for idx, val in enumerate(y):
tot += val * idx

for idx1, row in enumerate(X):
for idx2, val in enumerate(row):
tot += idx1 * idx2 * val

ebm = ExplainableBoostingClassifier(
names, types, random_state=seed, max_rounds=10, interactions=0
)
Expand All @@ -1271,9 +1279,9 @@ def test_identical_classification():
pred = ebm.eval_terms(X)
total += np.sum(pred)

expected = -6.314393452555578e-16
if total != expected:
assert total == expected
expected = 5490822946.805637
if tot != expected:
assert tot == expected
break

set_option("acceleration", original)

0 comments on commit 16b7694

Please sign in to comment.