-
Notifications
You must be signed in to change notification settings - Fork 22
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
Add UniformBinning to schemav2 #186
Conversation
579f7aa
to
42bc652
Compare
When defining a Binning, the `edges` attribute can now be either a list of floats (like before) or an instance of UniformBinning(n, low, high). When using the latter option, the Binning correction is optimized to use a simple arithmetic formula rather than binary search to look up the bin index.
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.
Yeah this is the right approach I think.
Looks good, some small extra validation comments only
It should already count as out of bounds for consistency with current behavior.
Addressed review comments, added some tests for Binning+UniformBinning, fixed a bug in an edge case that the test found. I will work on adding support for MultiBinning as well as soon as possible (could also be a separate PR). |
I'm fine to wait for MultiBinning in this PR |
f0b2191
to
3c2030f
Compare
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.
Looks great! Thanks so much for this addition, and sorry I didn't review it sooner
When defining a Binning, the
edges
attribute can now be either a list of floats (like before) or an instance of UniformBinning(n, low, high). When using the latter option, the Binning correction is optimized to use a simple arithmetic formula rather than binary search to look up the bin index.This is a fresh (better) take on #181 .
Example usage:
To do: