Question

The opencv SVM implementation takes a parameter labeled as "SVM type" which must be used in the CVSVMParams structure used in training the SVM. All the explanation I can find is:

// SVM type
enum { C_SVC=100, NU_SVC=101, ONE_CLASS=102, EPS_SVR=103, NU_SVR=104 };

Anyone know what these different values represent?

Was it helpful?

Solution

In general:

  • Classification SVM Type 1 (also known as C-SVM classification)
  • Classification SVM Type 2 (also known as nu-SVM classification)
  • Regression SVM Type 1 (also known as epsilon-SVM regression)
  • Regression SVM Type 2 (also known as nu-SVM regression)

Details can be found on page SVM

OTHER TIPS

They are different formulations of SVM. At the heart of SVM is an mathematical optimization problem. This problem can be stated in different ways.

C-SVM uses C as the tradeoff parameter between the size of margin and the number of training points which are misclassified. C is just a number, the useful range depends on the dataset and it can range from very small (like 10-5) to very large (like 10^5), depending on your data.

nu-SVM uses nu instead of C. nu is roughly a percentage of training points which will end up as support vectors. The more support vectors, the wider your margin is, the more training points which will be misclassified. nu ranges from 0.1 to 0.8 - at 0.1 roughly 10% of training points will be support vectors, at 0.8, more like 80%. I say roughly because its just correlated that way - its not exact.

epsilon-SVR and nu-SVR use SVM for regression. Instead of doing binary classification by finding a maximum margin hyperplane, instead the concept is used to find a hypertube which best fits the data in order to use it to predict future models. They differ in the way they are parameterized (like nu-SVM and C-SVM differ).

One-Class SVM is novelty detection. Rather than binary classification, or predicting a value, instead you give the SVM a training set and it attempts to train a model to wrap around that set so that a future instance can be classified as part of the class or outside the class (novel or outlier).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top