wilson_interval
def wilson_interval(successes: int, n: int, z: float = 1.96) -> tuple[float, float]
from compileml.fairness import wilson_interval
Wilson score interval — behaves sanely on small groups, unlike normal.
A fairness report is read group by group, and the smallest group is the one most likely to drive a finding. A normal-approximation interval on forty applicants produces confident nonsense; this does not.
Parameters#
| Name | Type | Default | Kind |
|---|---|---|---|
| successes | int | required | positional |
| n | int | required | positional |
| z | float | 1.96 | positional |
Returns#
tuple[float, float]