Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Precomputation of histogram tails #431

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

RamSaw
Copy link
Collaborator

@RamSaw RamSaw commented Apr 20, 2023

Description

A histogram has a sequence of bins. In many situations it is useful to be able to have some aggregated statistics given a bin.lower (aka bin id). In this cl we will introduce aggregations over the tail. For example, given bin.lower = k, what is the total sum of counts from bins with bin.lower >= k.

Checklist

@@ -98,6 +98,18 @@ def quantiles(self, q: List[float]) -> List[int]:
return result[::-1]


def histogram_precomputed_tails(hist: Histogram):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

compute_percentage_dropped_for_threshold? (and then to update computations)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, but what do you want to return then? Only one value? or two values: accumulated_weight / total_weight and accumulated_count / total_count?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIU we can return something like
(bin.lower, ratio_data_dropped) (i.e. ratio data dropped with fixed lower).
If needed absolute numbers, we can return total_data
WDYT?

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