Solved – How to identify support vectors in SGD svm

machine learningscikit learnsvm

I am using SGD svm from scikit learn. I find that unlike SVC who has support_ as a member of the model to store the index of the support vectors, SGDClassifier only gives me the weight of the decision boundary. Is there any way that I can identify support vectors within each class while using SGD support vector machine?

Best Answer

You may have some mis-understanding of SVM types. There is no SGD SVM. See this post.

Difference between the types of SVM

Stochastic gradient descent (SGD) is an algorithm to train the model. According to the documentation, SGD algorithm can be used to train many models. SVM is just one special case. More information about SGD, can be found here.

How could stochastic gradient descent save time comparing to standard gradient descent?

Therefore, SGD will not affect what is inside of SVM. If you are using SVC (C-Support Vector Classification) and use SGD for learning, you should still have everything about SVC. The $\alpha$ will tell you where are the "support vectors" as usual.

In python, it is possible they use some object oriented design that hide some fields if you are using SGD classifiers. But that should be a stack overflow question.

Related Question