# Is there any classification algorithm that doesn't give probability?

I'm studying the ROC Curve, and I was wondering if there is any classification algorithm that doesn't return the output class as a result of a certain threshold from the probabilities of the algo?

Because if there is one, how could you have a ROC Curve if you can't use thresholds to draw it, as it gives the output class as a certainty?

• SVM doesn't, for one. Feb 21, 2020 at 14:01
• @user2974951 SVMs have the signed distance to the margin, which are usually used to draw ROCs. Feb 21, 2020 at 14:10
• Naïve Bayes with dependant variables gives also uncalibrated probabilities. Feb 25, 2020 at 22:03

TLDR: probabilities are not required to build a ROC curve, only a numerical scale supporting the decision.

I'm studying the ROC Curve, and I was wondering if there is any classification algorithm that doesn't return the output class as a result of a certain threshold from the probabilities of the algo?

I previously let this question slip because I focused on what's the actual problem. Many algorithms do not output probabilities at all (it's one of their main selling points actually). SVMs and K-NNs, for example.

Below I'll explain why this is not a problem to build a ROC curve.

Because if there is one, how could you have a ROC Curve if you can't use thresholds to draw it, as it gives the output class as a certainty?

If your algorithm does not give you any other numerical scale of support for the decision, then your ROC curve has only one point.

It's not a wrong ROC, per se, but its usefulness is dubious.

So I'd say that if you don't have this scale (continuous or not), then you can't draw a ROC curve.

Luckly, most algorithms do have this scale. In SVMs it's the distance to the margin, in logistic regression it's the output probability, in decision trees it's the leaf probability, in K-NNs it's the neighborhood voting proportions, etc.

Support Vector Machines and $$k$$-Nearest Neighbors come to mind.

(See here for a motivation for short answers. Longer answers are always welcome.)

• Because if there is one, how could you have a ROC Curve if you can't use thresholds to draw it, as it gives the output class as a certainty? Feb 21, 2020 at 14:04
• SVM gives a distance to a hyper plane. ROC curves only care about tanks. You can order distances, so you can make a ROC curve for an SVM.
– Sycorax
Feb 21, 2020 at 14:58
• k NN can return "probability" or scores at a granularity of 1/k, though. Feb 21, 2020 at 22:34
• * And we only care about the ranking, not probabilities, because a ROC curve is solely a rank-based method, so any monotonic transformation of the SVM's output of distances (Platt scaling, isotonic regression) that does not change the sign of the distances, will not change the ROC curve. (A monotonic transformation that changes the sign, such as negating all signed distances, will "flip" the ROC curve.)
– Sycorax
Feb 22, 2020 at 14:48
• sklearn KNeighborsClassifier has predict_proba method, it returns class proportions that are of the specified number of closest neighbors. Isn't that predicting probabilities of an observation being of a class? Feb 22, 2020 at 19:19