feat: add quantile confidence intervals and reliability gating#85
Open
acere wants to merge 1 commit into
Open
Conversation
…bs#59) Add confidence interval estimation for quantile statistics using the exact binomial method (zero external dependencies). When enabled via `confidence` parameter on `summary_stats_from_list`, unreliable quantiles are omitted and CI bounds are attached to reliable ones. Changes: - New module `llmeter/quantile_ci.py` with `quantile_ci()` and `can_estimate_quantile()` functions - Extended `summary_stats_from_list` with opt-in `confidence` parameter - Added `RunningStats.snapshot()` for live progress display - Added user guide and API reference documentation - Wired new docs pages into mkdocs.yml nav Closes awslabs#59
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds confidence interval estimation for quantile statistics using the exact binomial method, addressing #59.
When enabled via the
confidenceparameter onsummary_stats_from_list, unreliable quantiles (where sample size is too small to form a meaningful CI) are omitted from output, and CI bounds are attached to reliable ones.Changes
llmeter/quantile_ci.py— pure-Python implementation usingmath.lgamma(zero external deps)quantile_ci(data, quantile, confidence)→(lower, upper)orNonecan_estimate_quantile(n, quantile, confidence)→ boolean gatesummary_stats_from_listwith opt-inconfidence: float | Noneparameter (backward-compatible)RunningStats.snapshot()for live progress displayMinimum sample sizes (95% confidence)
Testing
tests/test_quantile_ci.py— unit tests for binomial internals and public APItests/test_utils_ci_gating.py— integration tests for gated behavior insummary_stats_from_listCloses #59