📄 sv_user.html
字号:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.0//EN"><!--Converted with LaTeX2HTML 96.1-h (September 30, 1996) by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds --><HTML><HEAD><TITLE>Support Vector Machine - User Manual</TITLE><META NAME="description" CONTENT="Support Vector Machine - User Manual"><META NAME="keywords" CONTENT="sv_user"><META NAME="resource-type" CONTENT="document"><META NAME="distribution" CONTENT="global"><LINK REL=STYLESHEET HREF="sv_user.css"></HEAD><BODY LANG="EN" > <IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="file:/usr/lib/latex2html/icons/next_motif.gif"> <IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="file:/usr/lib/latex2html/icons/up_motif_gr.gif"> <IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="file:/usr/lib/latex2html/icons/previous_motif.gif"> <BR><BR> <P><P><H1 ALIGN=CENTER>Support Vector Machine - User Manual</H1><P ALIGN=CENTER><STRONG>C. Saunders</STRONG></P><P><P><H1><A NAME="SECTION00010000000000000000">Getting Started</A></H1><P>The Support Vector Machine (SVM) program allows a user to carry out varioustasks including pattern recognition and regression estimation, usingsupport vector techniques on some given data. It is assumed that thereader is somewhat familiar with support vector techniques as noexplanation is given here. (You are not required to be an expert,knowledge of kernels, and the effect of the regularising parameter C onthe output is sufficient).<P>The SVM is run from the command line, and has the following syntax :<P>sv <Training File> <Test File> [Parameter File]<P>The training and testing files both follow the same format. This is :<P>Number of Examples <BR> Number of attributes (n) <BR> 1 <BR> <IMG WIDTH=65 HEIGHT=16 ALIGN=MIDDLE ALT="tex2html_wrap_inline32" SRC="img1.gif"> <BR> . <BR> . <BR> .<P>where <IMG WIDTH=57 HEIGHT=15 ALIGN=MIDDLE ALT="tex2html_wrap_inline34" SRC="img2.gif"> are the attributes and <I>y</I> is theclassification.<P>Note that in the pattern recognition case, because you are interestedin splitting two classes, <I>y</I> will always be one of two values.The values used for <I>y</I> to distinguish between the two classeshave to be -1 and 1.<P>As an example, below is a file which has 2 training examples in it,each with 16 attributes. The attributes could correspond a 4x4 gridof pixels, and the task is a pattern recognition problem to seperatethe digit 1 from the digit 0. Obviously, you would usually have many training examples, but the short file below should give you an idea ofwhats expected.<P><PRE>21610 0 1 0 0 0 1 00 0 1 00 0 1 0 11 1 1 11 0 0 11 0 0 11 1 1 1 -1</PRE><P>Specifying a parameter file is optional (See next section for moreinformation about parameter files). If no parameter file isspecified, then the user will be presented with a set of menus, whichwill allow the user to define a set of parameters to be used.<P>After calculating a decision rule based on the training set, each ofthe test examples are evaluated and the program outputs a list ofstatistics. The exact nature of the programs output is discussed insection 3, but for now we present a rough guide to the main points.<P>The output from the program will depend on whether the user is usingthe SV machine for pattern recognition, regression estimation, or someother task. First of all the ouput from the optimiser is given,followed by a list of which examples inthe training set are actually support vectors. For the patternrecognition case two lists are given, a list of positive SupportVectors and Negative support vectors. Performance statisticsinvolving the error on the training and testing sets are then given. Following this, each support vector is listed along with the value ofits Lagrange multiplier (alpha value), and its deviation from the boundary.<P><H1><A NAME="SECTION00020000000000000000">Parameter Files</A></H1><P>When using the support vector machine for any given task, it is alwaysnecessary to specify a set of parameters. These parameters indicatethe specifics of what you want the program to do, and includeinformation such as whether you are interested in pattern recognitionor regression estimation, what kernel you are using, what scaling isto be done on the data, etc... When the SVM programis run, if no parameter file is specified on the command line, thenthe user will be presented with a series of menus which will allowthem to define the parameters they wish to use. Having to type inparamters every time you run the program would soon become verytiresome, especially if you are using the same or very similarparameters each time. This can be avoided by specifying a parameterfile as one of the command line options, and the program used togenerate parameter files is called paragen.<P>paragen is run by the following command line :<P>paragen [ [load parameter file] [save paramter file] ]<P>The parameter file is optional, and obviously cannot be included thefirst time you run paragen as you have not created a parameter filebefore. If however, you have a a parameter file which is similar tothe one you want to use, by specifying that file as part of thecommand line the program will start with all of the parameters set tothe relevant values, allowing you to make a couple of changes andthen save the file under a different name. The second option is tospecify the name of the file you want to save the paramters to. Thiscan also be done by selecting a menu option within paragen. One thingto note is that when you enter parameters directly into the SVMprogram, they are saved in a file named tmp.params. This allows youto run the SV machine again, or modify the parameters using paragen.<P>Whether you use the paragen program to create a file, or set theparameters from within the SVM program itself, the process ofsetting the paramters is acheived through a simple text basedmenu system. If the user is using paragen, then the first menu givesyou the option of displaying, entering, or saving parameters. Whenrunning the paragen program you will first be asked for the number of parametersets you wish to have, just enter 1 here. When the menu appears, if youchoose the enter parameters option, this process is identical tospecifying parameters at run time. If you choose to enter parameters,then you are faced with a list of the current parameter settings, and amenu. An example of which is shown below :<P><PRE> SV Machine parameters ===================== No kernel specified Alphas unbounded Input values will not be scaled. Training data will not be posh chunked. Training data will not be sporty chunked. Number of SVM: 1 Number of parameter sets: 1 Optimizer: 2 SV zero threshold: 1e-16 Margin threshold: 0.1 Objective zero tolerance: 1e-07 1. Set the SV Machine type 2. Set the Kernel type 3. Set general parameters 4. Set kernel specific parameters 5. Set expert parameters 0. Exit Please enter your choice:</PRE><P>Each of these menu options allow the users to specify differentaspects of the Support Vector Machine that they wish to use, and eachone will now be dealt with in turn.<P><H2><A NAME="SECTION00021000000000000000">Setting the Machine Type</A></H2><P>When option 1 is chosen, another menu magically appears, this one hasthe following appearance :<P><PRE> Type of SV machine ================== 1 Pattern Recognition 2 Regression Estimation 3 Density Estimation 4 Linear Operator Equations 5 Multiresolution Regression 6 Multiclass Pattern Recognition Please enter the machine type: (0)</PRE><P>Not all types of the SV machine have been fully implemented yet, so itis best to stick with either pattern recognition, or regressionestimation. Both of which are sufficiently complicated to cover allaspects of the SVM programs operation, and in many cases are all thatis required when solving a problem.<P>After entering 1 or 2 the prompt (and pressing return), you are giventhe top-level parameter menu again. If you look at the line below``SV Machine Parameters'', the type of SV machine which was selectedshould be displayed.<P>After selecting the SV machine type, the user must decide which kernelto use.<P><H2><A NAME="SECTION00022000000000000000">Setting the Kernel Type</A></H2><P>Selecting option 2 from the SVM paramter menu gives you a list ofpossible kernels you can use. Describing the nature of all of thesekernels is beyond the scope of this document, but it is worthmentioning a few of them. Different kernels correspond to differentmappings into a feature space, and therefore will give differentresults on the same set of data. The first kernel on the list is asimple dot product - where a simple dot product is calculated and nomapping is carried out.<P>As another example, kernel number 6 corresponds to a two layer neuralnetwork, this has the following formula :<P><DIV ALIGN=CENTER><P ALIGN=CENTER>K(<IMG WIDTH=29 HEIGHT=14 ALIGN=MIDDLE ALT="tex2html_wrap_inline42" SRC="img3.gif">) = tanh <IMG WIDTH=90 HEIGHT=24 ALIGN=MIDDLE ALT="tex2html_wrap_inline44" SRC="img4.gif"></P></DIV><P>And number 5, the radial basis function looks like this:<P><DIV ALIGN=CENTER><P ALIGN=CENTER>K(<IMG WIDTH=29 HEIGHT=14 ALIGN=MIDDLE ALT="tex2html_wrap_inline42" SRC="img3.gif">) = exp <IMG WIDTH=79 HEIGHT=38 ALIGN=MIDDLE ALT="tex2html_wrap_inline48" SRC="img5.gif"></P></DIV><P>A list of other kernel functions is included in appendix A.<P>Unfortunately there is no set rule for selecting the right kernel. Asa starting point however, the user may wish to experiment with any of thefirst 8 kernels to see how they affect results on different types ofdata.<P><H2><A NAME="SECTION00023000000000000000">Setting the General Parameters</A></H2><P>Option 3 of the SVM parameter menu allows the user to set some generalparameters of the SV machine. The parameters available will obviously
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -