10000 Make _binary_clf_curve a "public" method? · Issue #16470 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

Make _binary_clf_curve a "public" method? #16470

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

Open
Kornel opened this issue Feb 18, 2020 · 13 comments · May be fixed by #30134
Open

Make _binary_clf_curve a "public" method? #16470

Kornel opened this issue Feb 18, 2020 · 13 comments · May be fixed by #30134
Labels
Easy Well-defined and straightforward way to resolve help wanted module:metrics

Comments

@Kornel
Copy link
Kornel commented Feb 18, 2020

Currently sklearn.metrics.ranking._binary_clf_curve is (the way I understand the underscore) an internal API method.

Whenever there is a need to work with a different tradeoff than precision / recall or roc or when you need custom metrics for all thresholds, this method is a perfect fit, and the underscore in front of it makes me wonder if I can be confident it will not change in future versions :-)

I need to compute for instance (FP+TN)/(TN+FN+FP) at different thresholds and other use cases could be e.g. these)

I think making this method part of the public API would be beneficial for the community.

p.s.
Tensorflow used to have e.g. tensorflow.contrib.metrics.python.ops.metric_ops.precision_recall_at_equal_thresholds now they have https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/ops/metrics_impl.py#L1792 etc.

@Kornel Kornel changed the title Make _binary_clf_curve a "public" method Make _binary_clf_curve a "public" method? Feb 18, 2020
@swchoi727
Copy link

maybe i'm missing something but doesn't scikitlearn.metrics._ranking.roc_curve also return what you need?

@Kornel
Copy link
Author
Kornel commented Mar 5, 2020

roc_curve returns the rates, not the values. In theory you can compute tp's from tpr's but practically that could be subject to numerical errors. _binary_clf_curve returns exactly what I need.

@jnothman
Copy link
Member
jnothman commented Mar 5, 2020 via email

@Kornel
Copy link
Author
Kornel commented Mar 6, 2020 via email

@Erotemic
Copy link
Contributor

I would be in favor of this being a public method. Having access to raw fps and tps is very useful.

@hellenesherman
Copy link

I would be in favor of this being a public method. Having access to raw fps and tps is very useful.

Same here - making it more flexible to create custom plots and metrics to supplement ROC and Precision-Recall.

@Kornel
Copy link
Author
Kornel commented Mar 2, 2021

@jnothman any thoughts on the above?

@liudongmiao
Copy link

Currently, there are three public curve use _binary_clf_curve:

  • det_curve, introduces in 41d648e, after this issue
  • precision_recall_curve
  • roc_curve

I have a homework for ks_curve, using total rate instead of thresholds in abscissa, requires this method too.

So, I think this internal api should be public.

And, the history of _binary_clf_curve:

@adrinjalali
Copy link
Member

@scikit-learn/core-devs there's been requests to make this public every now and then. WDYT?

@glemaitre
Copy link
Member
glemaitre commented Jan 24, 2024

I am not against making it public. However, I don't like the current name if we need go public (clf would not make sense to everyone).

@thomasjpfan
Copy link
Member

I am okay with making it public with the name binary_classification_curve.

@adrinjalali adrinjalali added Easy Well-defined and straightforward way to resolve help wanted labels Oct 18, 2024
@SuccessMoses
Copy link
Contributor

@adrinjalali I am interested in working on this

@adrinjalali
Copy link
Member

Sure, give it a go @SuccessMoses

@SuccessMoses SuccessMoses linked a pull request Oct 22, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Easy Well-defined and straightforward way to resolve help wanted module:metrics
Projects
None yet
Development

Successfully merging a pull request may close this issue.

0