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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user