SVM2 | ![]() |
Learning of binary SVM classifier with L2-soft margin.
Synopsis:
model = svm2(data)
model = svm2(data,options)
Description:
This function learns binary Support Vector Machines
classifier with L2-soft margin. The corresponding quadratic
programming task is solved by one of the following
algorithms:
mdm ... Mitchell-Demyanov-Malozemov (MDM) algorithm.
imdm ... Improved MDM algorithm.
Input:
data [struct] Training data:
.X [dim x num_data] Training vectors.
.y [1 x num_data] Labels must equal 1 and/or 2.
options [struct] Control parameters:
.ker [string] Kernel identifier. See 'help kernel'.
.arg [1 x nargs] Kernel argument(s).
.C [1x1] Regularization constant.
.qp [string] QP solver to use: 'mdm', 'imdm' (default).
.tmax [1x1] Maximal number of iterations.
.tolabs [1x1] Absolute tolerance stopping condition (default 0.0).
.tolrel [1x1] Relative tolerance stopping condition (default 1e-3).
.cache [1x1] Number of columns of kernel matrix to be cached.
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 [1x1] Number of kernel evaluations.
.trnerr [1x1] Classification error on training data.
.options [struct] Copy of used options.
.cputime [1x1] Used CPU time in seconds (meassured by tic-toc).
.qp_stat [struct] Statistics about QP optimization:
.access [1x1] Number of requested columns of matrix H.
.t [1x1] Number of iterations.
.UB [1x1] Upper bound on optimal value of criterion.
.LB [1x1] Lower bound on optimal value of criterion.
.LB_History [1x(t+1)] LB with respect to iteration.
.UB_History [1x(t+1)] UB with respect to iteration.
.NA [1x1] Number of non-zero entries in solution.
Example:
data = load('riply_trn');
options = struct('ker','rbf','arg',1,'C',1);
model = svm2(data,options )
figure; ppatterns(data); psvm( model );
See also
SVMCLASS, SVMLIGHT, SMO.
About: Statistical Pattern Recognition Toolbox
(C) 1999-2004, Written by Vojtech Franc and Vaclav Hlavac
Czech Technical University Prague
Faculty of Electrical Engineering
Center for Machine Perception
Modifications:
29-nov-2004, VF