diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4a45a0d..f56a39f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -119,5 +119,4 @@ jobs: run: | pytest Tests/eval -v \ --ignore=Tests/eval/test_joint_embedding.py \ - --deselect Tests/eval/test_eval_stats.py::test_mann_whitney_u_disjoint \ --deselect Tests/eval/test_embedding_space.py::test_cka_independent diff --git a/Tests/eval/test_eval_stats.py b/Tests/eval/test_eval_stats.py index ba00050..ac3d6a7 100644 --- a/Tests/eval/test_eval_stats.py +++ b/Tests/eval/test_eval_stats.py @@ -42,9 +42,15 @@ def test_cohens_d_large_nondegenerate_effect(): def test_mann_whitney_u_disjoint(): - result = mann_whitney_u([1, 2, 3], [10, 11, 12]) + # Four per group, not three: with n1 = n2 = 3 the smallest attainable + # two-sided p is 2/20 = 0.1, so no correct implementation can clear 0.05 + # there however cleanly the groups separate. At four per group the exact + # minimum is 2/70 = 0.029. + result = mann_whitney_u([1, 2, 3, 4], [10, 11, 12, 13]) + assert result["u_statistic"] == 0.0 assert result["p_value"] < 0.05 - assert "u_statistic" in result + assert result["n_a"] == 4 + assert result["n_b"] == 4 def test_bonferroni_correct():