-
-
Notifications
You must be signed in to change notification settings - Fork 125
Pcurve + Rcurve #620
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
Pcurve + Rcurve #620
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #620 +/- ##
==========================================
+ Coverage 99.46% 99.46% +0.01%
==========================================
Files 15 15
Lines 3298 3312 +14
Branches 446 446
==========================================
+ Hits 3280 3294 +14
Misses 12 12
Partials 6 6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
sadrasabouri
left a comment
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.
Minor changes and a question raised:
pycm/curve.py
Outdated
| for c in self.classes: | ||
| self.data[c][self.plot_x_axis].insert(0, 0) | ||
| self.data[c][self.plot_y_axis].insert(0, 0) |
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.
Do we actually need this? why?
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.
README.md
Outdated
| ``` | ||
| ### Precision curve | ||
|
|
||
| `PCurve`, added in `version 4.6`, is devised to compute the Precision curve in which the Y axis represents the Precision, and the X axis represents the discrimination thresholds applied to a classifier. Thus, the ideal point is located at the top left of the curve, and a larger area under the curve represents better performance. Precision curve is a graphical representation of binary classifiers' performance. In PyCM, `PCurve` binarizes the output based on the "One vs. Rest" strategy to provide an extension of this curve for multi-class classifiers. Getting the actual labels vector, the target probability estimates of the positive classes, and the list of ordered labels of classes, this method is able to compute and plot Precision per different discrimination thresholds and compute the area under the curve. |
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.
We shouldn't talk about the ideal point for this curve ig; I don't think top-left is the ideal point, nor the area under the curve represents anything meaningful (robustness to threshold or something like this at most if it backs up with literature)
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 guess ideally, top right would be the best precision, but not necessarily the ideal point.
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.
fixed in 2e60f64
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.
BTW, I think we need to add 0 and 1 to the thresholds list to include the full spectrum for plotting the curves.
README.md
Outdated
| ``` | ||
| ### Recall curve | ||
|
|
||
| `RCurve`, added in `version 4.6`, is devised to compute the Recall curve in which the Y axis represents the Recall, and the X axis represents the discrimination thresholds applied to a classifier. Thus, the ideal point is located at the top right of the curve, and a larger area under the curve represents better performance. Recall curve is a graphical representation of binary classifiers' performance. In PyCM, `RCurve` binarizes the output based on the "One vs. Rest" strategy to provide an extension of this curve for multi-class classifiers. Getting the actual labels vector, the target probability estimates of the positive classes, and the list of ordered labels of classes, this method is able to compute and plot Recall per different discrimination thresholds and compute the area under the curve. |
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.
same for here; except I think the highest recall happens in the top-left, but that's not the ideal point.
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.
fixed in 2e60f64
Introduced:
PCurveclass to add Precision Curve.RCurveclass to add Recall Curve.