feat: citations, eval sidecar/pvalue/trace, nomic prefixes
mcp 2.x already on main. Does not replace the variety chunker (one chunk per variety is the anti-hallucination contract). - Numbered [1] citations on search_docs / search_trials - Eval JSONL sidecar, k-curve, eval.pvalue, eval.trace - Nomic prefixes at embed time only; stored text unprefixed Closes #25
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