Skip to content

Commit

Permalink
Adapt to changes in scipy 1.13
Browse files Browse the repository at this point in the history
  • Loading branch information
juhoinkinen committed Aug 21, 2024
1 parent 3f79248 commit 70f7e8b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/test_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,17 @@ def test_false_negatives():

# DCG@6 example from https://en.wikipedia.org/wiki/Discounted_cumulative_gain
def test_dcg():
y_true = csr_array([3, 2, 3, 0, 1, 2])
y_pred = csr_array([6, 5, 4, 3, 2, 1])
y_true = csr_array([[3, 2, 3, 0, 1, 2]])
y_pred = csr_array([[6, 5, 4, 3, 2, 1]])
dcg = annif.eval.dcg_score(y_true, y_pred, 6)
assert dcg > 6.86
assert dcg < 6.87


# iDCG@6 example from https://en.wikipedia.org/wiki/Discounted_cumulative_gain
def test_dcg_ideal():
y_true = csr_array([3, 3, 3, 2, 2, 2, 1, 0])
y_pred = csr_array([8, 7, 6, 5, 4, 3, 2, 1])
y_true = csr_array([[3, 3, 3, 2, 2, 2, 1, 0]])
y_pred = csr_array([[8, 7, 6, 5, 4, 3, 2, 1]])
dcg = annif.eval.dcg_score(y_true, y_pred, 6)
assert dcg > 8.74
assert dcg < 8.75
Expand Down

0 comments on commit 70f7e8b

Please sign in to comment.