-
-
Notifications
You must be signed in to change notification settings - Fork 77
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
Logarithmic histograms for sum #533
Conversation
NUMBER_OF_BUCKETS) | ||
col = backend.to_multi_transformable_collection(col) | ||
|
||
return backend.flatten((_compute_frequency_histogram_per_key( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe extract and save results of _compute_frequency_histogram_per_key
into variables to improve readability a little
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, thx, done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for review!
NUMBER_OF_BUCKETS) | ||
col = backend.to_multi_transformable_collection(col) | ||
|
||
return backend.flatten((_compute_frequency_histogram_per_key( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, thx, done
The current implementation of sum histogram uses linear buckets, namely 10^4 buckets between
[min_value, max_value]
. In practice significant downsides where found:This PR inroduces logarithmic histograms for sum, which has the following buckets:
[buckets_for_negative] + [bucket_for_zero] + [buckets_for_positive]
.The number is assigned to Bucket(lower=get_lower(x), upper=get_upper(x))
where:
for x > 0:
get_lower(x)
- returns the number with 2 digits the same as in x, andget_upper
is the next 2 digits number e.g.get_lower(123) == 120, get_upper(123) == 130
,get_lower(0.1234) == 0.12,get_upper(0.1234) == 0.13
The old histograms will be removed in future, when they will be used everywhere