Confidence intervals
Wilson score interval
Implemented
confidence.wilsonDefinition
Confidence interval for a binomial proportion with good coverage for small samples and extreme proportions.
Formula
(p̂ + z²/2n ± z√(p̂(1 − p̂)/n + z²/4n²)) / (1 + z²/n)
Inputs and outputs
- successes k
- trials n
- confidence level
Returns: ConfidenceInterval
Assumptions
No assumptions beyond valid, aligned inputs of the documented types.
Limitations
No metric-specific limitations are documented yet. Interpret the value alongside the task, data, and other metrics.
Python API
import evalsuite as es
es.proportion_ci(8, 10, method="wilson")
es.accuracy_ci(y_true, y_pred)References
- Wilson, E. B. (1927). Probable inference, the law of succession, and statistical inference. Journal of the American Statistical Association, 22(158), 209–212.