0

i've been trying to find this information around and couldnt found any help. What i want to do is get a float number as output from sklearn svm in order to work as input for a sub classifier.

Is it possible to get output from svm like 0,89898 instead of 1, given that a class is more closely to be classified as 1?

Thank you

Igor Cruz
  • 63
  • 2
  • 6

1 Answers1

0

Platt scaling can help to achieve what you want. It fits a logistic sigmoid curve on top of the output of SVM in a post-hoc fashion.

To do this in sklearn, you'll need to fit your SVM with probability parameter set to True. Then, you can use the fitted model's predict_proba() method to get a floating point output. More documentations can be found here. You'll also find related discussions in this thread.

Community
  • 1
  • 1
Moses Xu
  • 2,140
  • 4
  • 24
  • 35