trains a linear model
model = libsvm_lintrain(training_label_vector, training_instance_matrix) model = libsvm_lintrain(training_label_vector, training_instance_matrix, 'liblinear_options') model = libsvm_lintrain(training_label_vector, training_instance_matrix, 'liblinear_options', 'col') model = libsvm_lintrain(weight_vector, training_label_vector, training_instance_matrix, ['liblinear_options', 'col'])
set type of solver (default 1)
L2-regularized logistic regression (primal)
L2-regularized L2-loss support vector classification (dual)
L2-regularized L2-loss support vector classification (primal)
L2-regularized L1-loss support vector classification (dual)
multi-class support vector classification by Crammer and Singer
L1-regularized L2-loss support vector classification
L1-regularized logistic regression
L2-regularized logistic regression (dual)
L2-regularized L2-loss epsilon support vector regression (primal)
L2-regularized L2-loss epsilon support vector regression (dual)
L2-regularized L1-loss epsilon support vector regression (dual)
set the parameter C (default 1)
set the epsilon in loss function of epsilon-SVR (default 0.1)
set tolerance of termination criterion
|f'(w)|_2 <= eps*min(pos,neg)/l*|f'(w0)|_2
|f'(w)|_2 <= eps*|f'(w0)|_2 (default 0.001)
Dual maximal violation <= eps; similar to libsvm (default 0.1)
|f'(w)|_inf <= eps*min(pos,neg)/l*|f'(w0)|_inf, where f is the primal function (default 0.01)
|f'(alpha)|_1 <= eps |f'(alpha0)|,where f is the dual function (default 0.1)
if bias >= 0, instance x becomes [x; bias]; if < 0, no bias term added (default -1)
weights adjust the parameter C of different classes (see README for details)
n-fold cross validation mode
quiet mode (no outputs)
if 'col' is setted, training_instance_matrix is parsed in column format, otherwise is in row format
Parameters
number of classes, is 2 for regression
number of features in training data (without including the bias term)
If >= 0, we assume one additional feature is added to the end of each data instance.
label of each class; is empty for regression
a nr_w-by-n matrix for the weights, where n is nr_feature or nr_feature+1 depending on the existence of the bias term. nr_w is 1 if nr_class=2 and -s is not 4 (i.e., not multi-class svm by Crammer and Singer). It is nr_class otherwise.
The 'libsvm_lintrain' function returns a model which can be used for future prediction. It is a structure and is organized as [Parameters, nr_class, nr_feature, bias, Label, w]
If the '-v' option is specified, cross validation is conducted and the returned model is just a scalar: cross-validation accuracy.
For a large data set train may be faster then svmtrain. Normally,if the data sets are not large, svmtrain should be the first choice.