SVMLIGHT |
Interface to SVM^{light} software.
Synopsis:
model = svmlight(data)
model = svmlight(data,options)
Description:
This function serves as an interface between Matlab
and SVM^{light} (Version: 5.00) optimizer which trains
the Support Vector Machines classifier.
The executable file 'svm_learn' must be in the path.
The SVM^{light} software can be downloaded from:
http://svmlight.joachims.org/
This function creates temporary files 'tmp_alphaXX.txt',
'tmp_examplesXX.txt', 'tmp_modelXX.txt' and 'tmp_verbXX.txt' for
comunication with the SVM^{light} software. The XX=datestr(now)
is string consisting of current date and time.
Input:
data [struct] Labeled binary data:
.X [dim x num_data] Training vectors.
.y [1 x num_data] Labels of training data (1 or 2).
options [struct] Control parameters:
.ker [string] Kernel identifier:
'linear' (default),'rbf' and 'poly'.
.arg [1x1] Kernel argument (default []).
.C [1x1] SVM regularization constant (default C=inf).
.mC [1x1] if mC is given then C is set to mC/length(data.y).
.j [1x1] Cost-factor, by which training errors on
positive examples outweight errors on negative examples (default 1).
.eps [1x1] Tolerance of KKT-conditions (default eps=0.001).
.b [1x1] if 1 (default) then finds w'*x +b else b = 0;
.keep_files [1x1] If ==1 then keeps temporary files otherwise
erase them.
.svm_command [string] Path to SVM^{light} solver (default "svm_learn")
Output:
model [struct] Binary SVM classifier:
.Alpha [nsv x 1] Weights of support vectors.
.b [1x1] Bias of decision function.
.sv.X [dim x nsv] Support vectors.
.sv.inx [1 x nsv] Indices of SVs (model.sv.X = data.X(:,inx)).
.nsv [int] Number of Support Vectors.
.kercnt [int] Number of kernel evaluations used by the SVM^{light}.
.trnerr [real] Classification error on training data.
.margin [real] Margin of found classifier.
.options [struct] Copy of used options.
.cputime [real] Used CPU time in seconds.
Example:
data=load('riply_trn');
model=svmlight(data,struct('ker','rbf','C',10,'arg',1))
figure; ppatterns(data); psvm(model);
See also
SVMCLASS, XY2SVMLIGHT.
About: Statistical Pattern Recognition Toolbox
(C) 1999-2003, Written by Vojtech Franc and Vaclav Hlavac
Czech Technical University Prague
Faculty of Electrical Engineering
Center for Machine Perception
Modifications:
09-sep-2007, VF, -b option added
21-may-2007, VF, -q 42 (size of QP subproblem) added based on Soeren's suggestion
20-nov-2006, VF, added optional parameter mC
10-oct-2006, VF, "svm_command" option added
09-feb-2006, VF, added date_str(findstr(date_str,':')) = '.'; based on
M.Urban comment.
16-may-2004, VF
15-jan-2004, VF, handling argument of poly kernel repared
10-oct-2003, VF, computation of lin model added
29-aug-2003, VF, seconds are added to the name of temporary files
12-may-2003, VF, 1st 3 lines of verb_file are skiped
31-jan-2003, VF, added option 'j'
28-Jan-2003, VF
20-jan-2003, VF, temporary files are unique and are deleted at the end
14-Jan-2003, VF
26-sep-2002, VF
3-Jun-2002, V.Franc