Issue
I was wondering if the support vector classifier below from scikit learn is of hard margin or soft margin?
from sklearn import svm
clf = svm.SVC()
Solution
I think it is hard margin by default but has the provision for the soft margin as well. Quoting from the documentation:
But problems are usually not always perfectly separable with a hyperplane, so we allow some samples to be at a distance from their correct margin boundary. The penalty term C controls the strengh of this penalty, and as a result, acts as an inverse regularization parameter (see note below).
Since C is set as 1 by default, so we can say that default SVM implementation is hard margin (but we can change it by changing the value of C
)
Answered By - Failed Scientist
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.