# Support Vector Machines (svm)

The module for Support Vector Machine (SVM) classification is based on the popular LibSVM and LIBLINEAR libraries. It provides several learning algorithms:

## SVM learners (from LibSVM)

:class:SVMLearner uses the standard LibSVM learner. It supports several built-in kernel types and user-defined kernels functions written in Python. The kernel type is denoted by constants Linear, Polynomial, RBF, Sigmoid and Custom defined in Orange.classification.svm.kernels. A custom kernel function must accept two data instances and return a float. See :ref:kernel-wrapper for examples.

The class also supports several types of optimization: C_SVC, Nu_SVC (default), OneClass, Epsilon_SVR and Nu_SVR (defined in Orange.classification.svm.SVMLearner).

Class :obj:SVMLearner works on non-sparse data and :class:SVMLearnerSparse class works on sparse data sets, for instance data from the basket format).

The example below compares the performances of :obj:SVMLearnerEasy with automatic data preprocessing and parameter tuning and :obj:SVMLearner with the default :obj:~SVMLearner.nu and :obj:~SVMLearner.gamma:

## Linear SVM learners (from LIBLINEAR)

Linear SVM learners are more suitable for large scale problems since they are significantly faster then :class:SVMLearner and its subclasses. A down side is that they support only a linear kernel and can not estimate probabilities.

The classifier returned by LIBLINEAR based learners.

## Utility functions

The following example shows how to get linear SVM weights:

## Kernel wrappers

Kernel wrappers are helper classes for building custom kernels for use with :class:SVMLearner and subclasses. They take and transform one or two Python functions (attributes :obj:wrapped or :obj:wrapped1 and :obj:wrapped2). The function must be a positive definite kernel that takes two arguments of type :class:Orange.data.Instance and returns a float.

Example:

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.