mirror of
https://github.com/obra/superpowers.git
synced 2026-05-10 19:19:03 +08:00
Lift drill into evals/ at 013fcb8b7dbefd6d3fa4653493e5d2ec8e7f985b
rsync of obra/drill@013fcb8b7d into superpowers/evals/, excluding .git/, .venv/, results/, .env/, __pycache__/, *.egg-info/, .private-journal/. The drill repo is unaffected by this commit; archival is a separate manual step after this PR merges. Source SHA recorded at evals/.drill-source-sha for divergence detection.
This commit is contained in:
committed by
Drew Ritter
parent
2e46e9590d
commit
3b412a3836
17
evals/drill/stats.py
Normal file
17
evals/drill/stats.py
Normal file
@@ -0,0 +1,17 @@
|
||||
"""Statistical utilities for drill result analysis."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import math
|
||||
|
||||
|
||||
def wilson_ci(passed: int, total: int, z: float = 1.96) -> tuple[float, float]:
|
||||
if total == 0:
|
||||
return (0.0, 0.0)
|
||||
if passed > total:
|
||||
passed = total
|
||||
p = passed / total
|
||||
denom = 1 + z**2 / total
|
||||
center = (p + z**2 / (2 * total)) / denom
|
||||
margin = (z / denom) * math.sqrt(p * (1 - p) / total + z**2 / (4 * total**2))
|
||||
return (max(0.0, center - margin), min(1.0, center + margin))
|
||||
Reference in New Issue
Block a user