Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Binary vectors as y_score argument of roc_curve

The sklearn roc_curve docstring states:

"y_score : array, shape = [n_samples] Target scores, can either be probability estimates of the positive class, confidence values, or binary decisions."

In what situation it would make sense to set y_score to a binary vector ("binary decisions")? Wouldn't that result in a ROC curve with one point on it which kind of defies the point?

like image 294
Chris Gorgolewski Avatar asked Oct 01 '22 13:10

Chris Gorgolewski


1 Answers

If you are using a classifier that does not output probability scores (e.g. svm.SVC without an explicit probability=True), there isn't a way to compute a ROC curve. As an API designer, you have two choices: raise an exception and provide the user no useful information, or plot a degenerate curve with one data point. I would argue the latter is more useful.

like image 69
mbatchkarov Avatar answered Oct 06 '22 19:10

mbatchkarov