1
這些LIBSVM封裝選項:箱約束(比較MATLAB fitcsvm和LIBSVM選項)
options:
-s svm_type : set type of SVM (default 0)
0 -- C-SVC
1 -- nu-SVC
2 -- one-class SVM
3 -- epsilon-SVR
4 -- nu-SVR
-t kernel_type : set type of kernel function (default 2)
0 -- linear: u'*v
1 -- polynomial: (gamma*u'*v + coef0)^degree
2 -- radial basis function: exp(-gamma*|u-v|^2)
3 -- sigmoid: tanh(gamma*u'*v + coef0)
-d degree : set degree in kernel function (default 3)
-g gamma : set gamma in kernel function (default 1/num_features)
-r coef0 : set coef0 in kernel function (default 0)
-c cost : set the parameter C of C-SVC, epsilon-SVR, and nu-SVR (default 1)
-n nu : set the parameter nu of nu-SVC, one-class SVM, and nu-SVR (default 0.5)
-p epsilon : set the epsilon in loss function of epsilon-SVR (default 0.1)
-m cachesize : set cache memory size in MB (default 100)
-e epsilon : set tolerance of termination criterion (default 0.001)
-h shrinking: whether to use the shrinking heuristics, 0 or 1 (default 1)
-b probability_estimates: whether to train a SVC or SVR model for probability estimates, 0 or 1 (default 0)
-wi weight: set the parameter C of class i to weight*C, for C-SVC (default 1)
哪一個是SVM箱約束?是-c
?如果不是,我該如何計算?目前我正在將我的LIBSVM代碼轉換爲MATLAB fitcsvm
函數。我們在MATLAB這些選項:
'Cost' — Misclassification cost
square matrix | structure array
Misclassification cost, specified as the comma-separated pair consisting of 'Cost' and a square matrix or structure. If you specify:
The square matrix Cost, then Cost(i,j) is the cost of classifying a point into class j if its true class is i (i.e., the rows correspond to the true class and the columns correspond to the predicted class). To specify the class order for the corresponding rows and columns of Cost, additionally specify the ClassNames name-value pair argument.
The structure S, then it must have two fields:
S.ClassNames, which contains the class names as a variable of the same data type as Y
S.ClassificationCosts, which contains the cost matrix with rows and columns ordered as in S.ClassNames
For two-class learning, if you specify a cost matrix, then the software updates the prior probabilities by incorporating the penalties described in the cost matrix. Subsequently, the cost matrix resets to the default. For more details on the relationships and algorithmic behavior of BoxConstraint, Cost, Prior, Standardize, and Weights, see Algorithms.
The defaults are:
For one-class learning, Cost = 0.
For two-class learning, Cost(i,j) = 1 if i ~= j, and Cost(i,j) = 0 if i = j.
Example: 'Cost',[0,1;2,0]
Data Types: double | single | struct
///
'BoxConstraint' — Box constraint
1 (default) | positive scalar
Box constraint, specified as the comma-separated pair consisting of 'BoxConstraint' and a positive scalar.
For one-class learning, the software always sets the box constraint to 1.
For more details on the relationships and algorithmic behavior of BoxConstraint, Cost, Prior, Standardize, and Weights, see Algorithms.
Example: 'BoxConstraint',100
Data Types: double | single
什麼是cost
和BoxConstraint
之間的差異比較上述libsvm的封裝選項?