-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
FEA Add cumulative gain curve metric #18479
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
base: main
Are you sure you want to change the base?
Conversation
@@ -968,6 +968,75 @@ def roc_curve(y_true, y_score, *, pos_label=None, sample_weight=None, | |||
|
|||
return fpr, tpr, thresholds | |||
|
|||
def cumulative_gain_curve(y_true, y_score, pos_label=None): | |||
"""This function generates the points necessary to plot the Cumulative Gain for each ten percent of the samples | |||
Note: This implementation is restricted to the binary classification task. |
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.
Each line should be less than 80 char, and the first sentence of the docstring should be a 1 line summary.
non-thresholded measure of decisions (as returned by | ||
decision_function on some classifiers). | ||
pos_label (int or str, default=None): Label considered as positive and | ||
others are considered negative |
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.
See the docstring formatting of other functions in this module.
The original issue #10003 is about both cumulative gains and lift curves. |
@reshamas and I fixed Doc test errors |
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.
Correct docstring formatting @rth
@Alit10 thanks for your work so far and for your patience! If you are still interested in working on this do you mind synchronizing with upstream? Thanks! |
5875a77
to
d538225
Compare
@cmarmo Hello, Done ! Is everything ok for the merge ? |
Thanks @Alit10 ! I believe something went wrong with the synchronization. |
Yes, it is. |
Reference Issues/PRs
Closes #10003
What does this implement/fix? Explain your changes.
Add a new metric for binary classification known as cumulative_gain_curve
Any other comments?