August 24, 2020

Support Vector Machines

In scikit-learn, support vector machines are called Support Vector Classifiers (SVC)

  1. Bild Model

    1. The model needs to be trained on a list of data points and labels.

  2. Fit Model

    1. 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.

  3. Predict

    1. We can view the support vectors of the model

      1. 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.

Previous
Previous

August 24, 2020

Next
Next

August 23, 2020