0
$\begingroup$

I'm new to SVM models. I took custom SVM classifier from the github. In there standard predict function was overwritten by custom predict function.

def predict(self, instances):
   predictions = []
   for instance in instances:
       predictions.append((int)(np.sign(self.weight_vector.dot(instance.T)[0] + self.bias)))#class is determined based on the sign -1,1

I want to get prediction probability of each class. [-1 probability, 1 probability] I know from standard SVM predict_proba function I can get the probability. Since this is a customized SVM how do I get that? Can somebody help me.

Thank you

$\endgroup$

1 Answer 1

0
$\begingroup$

I have followed scikit-learn https://github.com/scikit-learn/scikit-learn/blob/fd237278e/sklearn/linear_model/_base.py#L293 link and was able to get predicted probabilities.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.