compileml.fairness

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#

NameTypeDefaultKind
successesintrequiredpositional
nintrequiredpositional
zfloat1.96positional

Returns#

tuple[float, float]