Skip to content

Fix/stats exact quantiles - #168

Merged
Quafadas merged 4 commits into
mainfrom
fix/stats-exact-quantiles
Oct 26, 2026
Merged

Quafadas merged 4 commits into
mainfrom
fix/stats-exact-quantiles

Conversation

@Quafadas

Copy link
Copy Markdown
Owner

No description provided.

SireSimon and others added 4 commits October 26, 2026 12:12
Expected values follow numpy/pandas default linear interpolation (type 7).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
t-digest (compression 100) gave badly wrong quartiles for small samples,
e.g. median([1,100]) = 100. Replace it with an exact accumulator that
stores non-missing values in a primitive array, sorts once, and uses
linear interpolation (Hyndman-Fan type 7, the numpy/pandas default).
Drop the now-unused com.tdunning:t-digest dependency.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Exact quantiles need every value, so numericSummary on an Iterator held
O(n) doubles per numeric column. QuantileSketch now buffers up to 1000
values (exact, type 7 interpolation) and on the 1001st flushes them into
a t-digest (compression 200) and streams from then on. min and max stay
exact. Restores the t-digest dependency.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…iles

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@Quafadas
Quafadas merged commit 890b68d into main Oct 26, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants