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()
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()
Though very late, I don't agree with the answer that was provided for the following reasons:
SVC() is that of a 'rbf' kernel and not of a linear kernel);This formulation - which in literature identifies the optimization problem for a soft margin classifier - makes it work also for non-linearly separable datasets and introduces:
zeta_i, which measures how much instance i is allowed to violate the margin (the functional margin can be less than 1 in passing from the first to the second formulation);C, which is a portion of the "penalty" imposed to the objective function for permitting instances to have functional margin less than 1.Eventually, as you might see in sklearn doc, hyperparameter C must be strictly positive, which enforces the idea that SVC() does provide soft margin classification. Here is another SO reference.