August 24, 2020
Support Vector Machines
In scikit-learn, support vector machines are called Support Vector Classifiers (SVC)
Bild Model
The model needs to be trained on a list of data points and labels.
Fit Model
The model is then used to predict the label of a point or many points. Even if you only have a single point, it must be in a list.
Predict
We can view the support vectors of the model
classifier.support_vectors_
Outliers may cause problems with SVM. For this, we allow the decision boundary to have a margin of error. It is defined by the parameter C. If C is large, this is considered a hard margin. If C is small, it is considered a soft margin.
- classifier = svc(c = 0.01)
The best strategy is to validate your model by testing many values for C.