1. biolab
  2. Untitled project
  3. orange

Source

orange / docs / reference / rst / Orange.classification.svm.rst

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.

SVM Based feature selection and scoring

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: