![]() Volume 10, Issue 1 Articles Trott's Corner New Products New Publications Calendar News Bulletins New Resources Classifieds Download This Issue Editorial Policy Staff and Contributors Submissions Subscriptions Advertising Back Issues Contact Information |
A Flexible Implementation for Support Vector Machines
Solving the Optimization ProblemThe Primal ProblemIt turns out that the optimal separating hyperplane solving (1) can be found as the solution to the equivalent optimization problem
referred to as the primal problem. Typically, only a small subset of the data points will attain equality in the constraint; these are termed support vectors since they are "supporting" (constraining) the hyperplane (Figure 1). In fact, the solution The Dual ProblemFor reasons that will become clear later,
where
The variable Having solved the dual problem for
where in (5) A Simple SVM ExampleEnough theory--let us generate some data and solve a simple SVM problem using MathSVM.
For this elementary problem, we use the simple SVM formulation (2) provided in MathSVM by the SeparableSVM function.
The returned vector
The support vectors are immediately identifiable as the nonzero
A plot similar to Figure 1 is produced by the SVMPlot function. As in Figure 1, the solid line marks the optimal hyperplane, and dotted lines mark the width of the corridor that joins support vectors (highlighted in blue).
Nonseparable DataOften the assumption of separable training data is not reasonable (it may fail even for the preceding simple example). In such cases, NonseparableSVM should be used. This SVM variant takes a parameter
Large
Getting QP FormulationsSometimes it is interesting to examine what the QP problem looks like for a given SVM formulation. Using the option FormulationOnly, we can inspect the various parameters instead of actually solving the QP. This can, for example, be used to study expressions analytically.
The parameters are given in the order corresponding to the arguments of QPSolve.
|
||||||||
About Mathematica | Download Mathematica Player © 2006 Wolfram Media, Inc. All rights reserved. |