1

I am using SVM classifier for multi class classification.

I want svc.predict to return the result along with probabilities for the other classes also.

The result i got is like this:

print(svclassifier.predict([[79,93,60,50,50,80,81,88,87,100,100,71,100,83,100,100,75,70,100,60]]))

Expected OutPut is the category number= 27

Output Obtained is: 27

But I want the output in the form of probabilities....

Akhil
  • 31
  • 6

1 Answers1

1

Yes, you can use predict_proba method (see documentation).

Please also consider the note seen in documentation:

The probability model is created using cross validation, so the results can be slightly different than those obtained by predict. Also, it will produce meaningless results on very small datasets

Szymon Maszke
  • 22,747
  • 4
  • 43
  • 83