Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
adamgayoso committed Dec 28, 2023
1 parent 78aaca2 commit 578e5c1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/test_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ def test_lisi_knn():
harmonypy_lisi_res = harmonypy_lisi(
X, pd.DataFrame(labels, columns=["labels"]), label_colnames=["labels"], perplexity=10
)[:, 0]
np.testing.assert_allclose(lisi_res, harmonypy_lisi_res)
# Slight numerical differences arise due to how self edges are handled. With approximate nearest
# neighbors methods, there is no guarantee that the self edge is the first edge. To accomodate this,
# we mask out self edges internally in lisi computation which causes slight numerical differences.
np.testing.assert_allclose(lisi_res, harmonypy_lisi_res, rtol=5e-5, atol=5e-5)


def test_ilisi_clisi_knn():
Expand Down

0 comments on commit 578e5c1

Please sign in to comment.