Skip to content

Workflow🔗

An SVM classifier is created from labeled feature vectors and can subsequently be used to classify unknown samples. During training, the SVM determines separating hypersurfaces between the classes using the selected kernel and the available training samples.

The following section introduces the general workflow for SVM classification.

General workflow🔗

Most SVM classification tasks follow the same workflow:

  1. Create the classifier.
  2. Add training samples.
  3. Train the classifier.
  4. Classify unknown samples.
  5. Evaluate the result.

Create the classifier🔗

This step prepares the classifier and defines the properties that are required for the subsequent training and classification steps.

The classifier is created with

The returned classifier handle is required for all following steps.

Add training samples🔗

Training samples are provided as feature vectors together with their class labels.

Training samples can be added with

The feature vector contains the numeric features that describe the sample. The feature vector must consist of real-valued features and the same features must be used consistently during training and classification.

Several training samples are added by successively calling add_sample_class_svm with different feature vectors and class IDs.

The quality and representativeness of the training samples have a direct influence on the classification result. The training data should therefore cover the relevant variation within each class.

Train the classifier🔗

After all training samples have been added, the classifier is trained. During training, the function defining the class boundaries is optimized based on the available training samples.

Training is performed with

After training, the classifier contains the information required to separate the classes and classify unknown data.

Further information on parameter optimization can be found in the Optimization chapter.

Classify unknown samples🔗

Unknown objects are represented by feature vectors and classified according to the class boundaries determined during training.

Classification is performed with

Depending on the selected classification mode, the operator returns the best-rated classes or, for novelty detection, indicates whether the feature vector belongs to the trained class or to the rejection class.

Evaluate the result🔗

After training and classification, the classifier performance should be evaluated using representative test data that was not used during training.

Evaluating the classifier helps to assess the classification performance and compare different parameter settings.

In particular, the evaluation can be used to determine whether the selected kernel, kernel parameters, regularization, and preprocessing provide sufficient classification performance.

Further recommendations on classifier evaluation and parameter optimization can be found in the Optimization chapter.