libsvm 引數說明【中英文雙語版本】
阿新 • • 發佈:2019-01-27
svm型別,三個分類的svc區別主要是:所解決的目標函式的形式不一樣
c-svc和
nu-svc本質差不多
c-svc中c的範圍是1到正無窮
nu-svc中nu的範圍是0到1,還有nu是錯分樣本所佔比例的上界,支援向量所佔比列的下界。
這裡還有個教程:
《Learn
SVM Step by Step 》系列視訊
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)
4 -- precomputed kernel (kernel values in training_instance_matrix)
-d degree : set degree in kernel function (default 3)
-g gamma : set gamma in kernel function (default 1/k)
-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)
-v n: n-fold cross validation mode
==========================================================
Chinese:
Options:可用的選項即表示的涵義如下
-s svm型別:SVM設定型別(預設0)
0 -- C-SVC
1 --v-SVC
2 – 一類SVM
3 -- e -SVR
4 -- v-SVR
-t 核函式型別:核函式設定型別(預設2)
0 – 線性:u'v
1 – 多項式:(r*u'v + coef0)^degree
2 – RBF函式:exp(-gamma|u-v|^2)
3 –sigmoid:tanh(r*u'v + coef0)
-d degree:核函式中的degree設定(針對多項式核函式)(預設3)
-g r(gama):核函式中的gamma函式設定(針對多項式/rbf/sigmoid核函式)(預設
1/ k)
-r coef0:核函式中的coef0設定(針對多項式/sigmoid核函式)((預設0)
-c cost:設定C-SVC,e -SVR和v-SVR的引數(損失函式)(預設1)
-n nu:設定v-SVC,一類SVM和v- SVR的引數(預設0.5)
-p p:設定e -SVR 中損失函式p的值(預設0.1)
-m cachesize:設定cache記憶體大小,以MB為單位(預設40)
-e eps:設定允許的終止判據(預設0.001)
-h shrinking:是否使用啟發式,0或1(預設1)
-wi weight:設定第幾類的引數C為weight*C(C-SVC中的C)(預設1)
-v n: n-fold互動檢驗模式,n為fold的個數,必須大於等於2
其中-g選項中的k是指輸入資料中的屬性數。option -v 隨機地將資料剖分為n部
分並計算互動檢驗準確度和均方根誤差。以上這些引數設定可以按照SVM的型別和核函
數所支援的引數進行任意組合,如果設定的引數在函式或SVM型別中沒有也不會產生影
響,程式不會接受該引數;如果應有的引數設定不正確,引數將採用預設值。