source: orange/docs/widgets/rst/classify/svm.rst @ 11778:ecd4beec2099

Revision 11778:ecd4beec2099, 5.0 KB checked in by Ales Erjavec <ales.erjavec@…>, 5 months ago (diff)

Use new SVG icons in the widget documentation.

Line 
1.. _SVM:
2
3SVM Learner
4===========
5
6.. image:: ../../../../Orange/OrangeWidgets/Classify/icons/SVM.svg
7
8Support vector machine learner (classification)
9
10Signals
11-------
12
13Inputs:
14
15
16   - Examples
17      A table with training examples
18
19
20Outputs:
21
22
23   - Learner
24      The support vector machine learning algorithm with settings as specified
25      in the dialog.
26
27   - Classifier
28      Trained SVM classifier
29
30   - Support Vectors
31      A subset of data instances from the training set that were used as
32      support vectors in the trained classifier
33
34
35
36Description
37-----------
38
39Support vector machines (SVM) is a popular classification technique that will
40construct a separating hyperplane in the attribute space which maximizes the
41margin between the instances of different classes. The technique often yields
42supreme predictive performance results. Orange embeds a popular implementation
43of SVM in `LIBSVM`_ package, and this widget provides for a graphical user
44interface to its functionality. It also behaves like a typical Orange
45learner widget: on its output, it presents an object that can learn and is
46initialized with the setting specified in the widget, or, given the input
47data set, also a classifier that can be used to predict classes and class
48probabilities given a set of new examples.
49
50.. image:: images/SVM.png
51   :alt: Support vector machines widget
52
53Learner can be given a name under which it will appear in other widgets that
54use its output, say, in :ref:`Test Learners`. The default name is simply "SVM".
55
56The next block of options deals with kernel, that is, a function that
57transforms attribute space to a new feature space to fit the maximum-margin
58hyperplane, thus allowing the algorithm to create non-linear classifiers.
59The first kernel in the list, however, is a :obj:`Linear` kernel that does
60not require this trick, but all the others (:obj:`Polynomial`, :obj:`RBF`
61and :obj:`Sigmoid`) do. Specific functions that specify the kernel are
62presented besides their names, and the constants involved:
63
64:obj:`g` for the gamma constant in kernel function (the recommended value
65is 1/k, where k is the number of the attributes, but since there may be no
66training set given to the widget the default is 0 and the user has to set
67this option manually), :obj:`d`) for the degree of the kernel (default 3),
68and :obj:`c` for the constant c0 in the kernel function (default 0).
69
70:obj:`Options` control other aspects of the SVM learner.
71:obj:`Model complexity (C)` (penalty parameter), :obj:`Tolerance (p)` and
72:obj:`Numeric precision (eps)` are options that define the optimization
73function; see `LIBSVM`_ for further details. The other three options are used
74to instruct the learner to prepare the classifier such that it would estimate
75the class probability values (:obj:`Estimate class probabilities`), constrain
76the number of the support vectors which define the maximum-margin hyperplane
77(:obj:`Limit the number of support vectors`) and normalize the training and
78later the test data (:obj:`Normalize data`). The later somehow slows down the
79learner, but may be essential in achieving better classification performance.
80
81The last button in the SVM dialog is :obj:`Automatic parameter search`. This
82is enabled when the widget is given a data set, and uses `LIBSVM`_'s procedures
83to search for the optimal value of learning parameters. Upon completion, the
84values of the parameters in the SVM dialog box are set to the parameters found
85by the procedure.
86
87Examples
88--------
89
90There are two typical uses of this widget, one that uses it as a classifier
91and the other one that uses it to construct an object for learning. For the
92first one, we have split the data set to two data sets (:obj:`Sample` and
93:obj:`Remaining Examples`). The sample was sent to :obj:`SVM` which produced
94a :obj:`Classifier`, that was then used in :ref:`Predictions` widget to
95classify the data in :obj:`Remaning Examples`. A similar schema can be
96used if the data would be already separated in two different files; in
97this case, two :ref:`File` widgets would be used instead of the
98:ref:`File` - :ref:`Data Sampler` combination.
99
100.. image:: images/SVM-Predictions.png
101   :alt: SVM - a schema with a classifier
102
103The second schema shows how to use the :obj:`SVM` widget to construct the
104learner and compare it in cross-validation with :ref:`Majority` and
105:ref:`k-Nearest Neighbours` learners.
106
107.. image:: images/SVM-Evaluation.png
108   :alt: SVM and other learners compared by cross-validation
109
110The following schema observes a set of support vectors in a :ref:`Scatter Plot`
111visualization.
112
113.. image:: images/SVM-SupportVectors.png
114   :alt: Visualization of support vectors
115
116For the above schema to work correctly, the channel between :ref:`SVM`
117and :ref:`Scatter Plot` widget has to be set appropriately. Set the channel
118between these two widgets by double-clinking on the green edge between the
119widgets, and use the settings as displayed in the dialog below.
120
121.. image:: images/SVM-SupportVectorsOutput.png
122   :alt: Channel setting for communication of support vectors
123
124
125.. _LIBSVM: http://www.csie.ntu.edu.tw/~cjlin/libsvm/
Note: See TracBrowser for help on using the repository browser.