Port docs-mcp-template upgrades (eval, citations, prefixes) (#26)
Image rebuild (skip scrape) / build (push) Successful in 3m58s
Image rebuild (skip scrape) / build (push) Successful in 3m58s
Co-authored-by: claude <[email protected]>
This commit was merged in pull request #26.
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
"""Stdlib tests for the permutation test. No Chroma."""
|
||||
from __future__ import annotations
|
||||
|
||||
import unittest
|
||||
|
||||
from eval.pvalue import paired_permutation
|
||||
|
||||
|
||||
class PermutationTests(unittest.TestCase):
|
||||
def test_identical_is_not_significant(self) -> None:
|
||||
a = [1.0, 0.5, 0.0, 1.0]
|
||||
r = paired_permutation(a, list(a), n_resamples=200, seed=0)
|
||||
self.assertEqual(r["Diff(A-B)"], 0.0)
|
||||
self.assertFalse(r["significant"])
|
||||
|
||||
def test_large_shift_is_significant(self) -> None:
|
||||
a = [1.0] * 20
|
||||
b = [0.0] * 20
|
||||
r = paired_permutation(a, b, n_resamples=500, seed=0)
|
||||
self.assertTrue(r["significant"])
|
||||
self.assertLess(r["p_value"], 0.05)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user