svmvia

Description:
An optimized C++ program for finding the full regularization path for the support vector machine. This implementation is derived from R code accompanying this article:
T. Hastie, S. Rosset, R. Tibshirani and J. Zhu. "The entire regularization path for the support vector machine." Journal of Machine Learning Research. 5:1391-1415, 2004.
svmvia consists of two programs: svmvia-train and svmvia-predict.

Usage: svmvia-train [options] -train <training file> -val <validation file> -model <model file name>
Required arguments:
Options:

Usage: svmvia-predict <model file> <source data file> <destination for predictions file>

Required arguments:


File formats

Data file format
These files are specified using the -train and -val arguments. The first line of svmvia data files has the number of examples in the file and the number of attributes in each example. The remaining lines each describe a particular training example. Each of these lines starts with the class of the example, a value of either 1 or -1. The remainder of the line defines the attribute values for that example. An attribute is specified by its integer index (starting with 0), a colon and then the value of that attribute. A sample line is shown below with class -1, attribute 0 set to .5 and attribute 1 set to 3:
-1 0:.5 1:3
Although the class must be the first item on the line, attributes may be set out of order in this manner, as shown by the following equivalent line:
-1 1:3 0:.5
Attributes not initialized for an example will be set to 0.
Model file format
A model file is created where specified by the -model argument. This file first contains the kernel type, 0 for radial basis and 1 for polynomial. If the kernel type was radial basis, then the gamma parameter is next. On the other hand, if the file was polynomial, then the bias and degree are next in the file. Next a C style boolean value specifies whether caching was used, followed by the number of training examples and the number of attributes for each example. The next line contains the optimal λ = 1/C parameter chosen, defining the hardness of the margin. Each following line presents the Lagrangian multiplier for that training example, the class of the training example, and the attribute values for the training example. The number of these lines will be equal to the number of examples specified. After the last line, the bias will be stored. If the -primal-hyperplane option is used on a polynomial kernel of degree 1, then the file will have one more line, describing the hyperplane in the primal form. This line will define coefficients for each of the attributes. The bias is the same for the primal form.