-
Notifications
You must be signed in to change notification settings - Fork 26
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
Allow for event weights when calculating percentile cuts #225
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #225 +/- ##
==========================================
+ Coverage 92.46% 92.62% +0.15%
==========================================
Files 49 49
Lines 2005 2048 +43
==========================================
+ Hits 1854 1897 +43
Misses 151 151
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
@@ -44,9 +92,14 @@ def calculate_percentile_cut( | |||
min_events: int | |||
Bins with less events than this number are replaced with ``fill_value`` | |||
""" | |||
|
|||
if weights is None: |
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.
I'd prefer it (and it's probably also faster) if the weights=None
case would use the existing code instead of the weighted_quantile
method with weights=1.
Pull request implementing issue #224 . Solution as described there, the weighted quantile function is custom.