Support Vector Machines (svm)
:obj:`SVMLearner`, a general SVM learner;
- :obj:`SVMLearnerEasy`, which is similar to the svm-easy.py script
from the LibSVM distribution and helps with the data normalization and parameter tuning;
- :obj:`LinearSVMLearner`, a fast learner useful for data sets with a large
number of features.
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).
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
The following example shows how to get linear SVM weights:
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.