refactor(b2): tilt uses statistics.median for consistency

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
jgrusewski
2026-06-16 17:33:11 +02:00
parent 9e4379a3e8
commit 98e264f14c

View File

@@ -70,7 +70,7 @@ def construction_weights(scores: list[float], construction: str, quantile: float
if n == 0:
return []
if construction == "tilt":
med = sorted(scores)[n // 2]
med = median(scores)
pos = [max(0.0, s - med) for s in scores]
tot = sum(pos)
return [p / tot for p in pos] if tot > 0 else [1.0 / n] * n