Statistical Thresholds & Wilson CI
AI Governance, Fairness & Regulated Assurance β Day 1
Evaluate credit underwriting and claims triage decisions against golden datasets using Wilson score confidence bounds, FP/FN cost trade-offs, and multi-run repeatability variance gates.
Point accuracy estimates hide sample-size risk: scoring 9 out of 10 on a tiny test set yields a 95% Wilson lower bound below 60%. Today you will validate golden datasets with Wilson binomial confidence intervals, asymmetric false-positive/false-negative cost ceilings, and multi-run repeatability variance gates.
The official reference codebase for Day 1 is hosted in the repository. Clone the repository and navigate to day-1-statistical-thresholds/test_day1.py to run the working solution.
git clone https://github.com/777abhi/ai-governance-qe-roadmap.git
cd ai-governance-qe-roadmap/day-1-statistical-thresholds/test_day1.pyRun & Inspect Statistical Threshold Gates
Clone the companion repository and run the Day 1 zero-dependency Python test suite.
git clone https://github.com/777abhi/ai-governance-qe-roadmap.git
cd ai-governance-qe-roadmap
npm run test:day1def wilson_confidence_interval(successes: int, total: int, confidence: float = 0.95):
z = Z_SCORES[confidence]
p = successes / total
z2 = z * z
denom = 1.0 + z2 / total
center = (p + z2 / (2.0 * total)) / denom
margin = (z * math.sqrt((p * (1.0 - p) + z2 / (4.0 * total)) / total)) / denom
return (round(max(0.0, center - margin), 6), round(min(1.0, center + margin), 6))- Computed deterministic confusion matrices (accuracy, precision, recall, FPR, FNR, F1) on golden datasets.
- Enforced 95% Wilson score lower bounds so undersized test samples cannot silently pass release gates.
- Bounded asymmetric FP/FN error costs and verified multi-run repeatability variance.
π§ Knowledge Check
Why should regulated AI release gates assert against the Wilson score lower confidence bound instead of raw point accuracy alone?