2013-12-21 43 views
1
I am using rbf,Support Vector machine for large training set=1135x9 matrix and test set{95x9}. 

I am using C=20 and gamma=0.0001 
'the result are as follows 
optimization finished, iter = 3904 
nu = 0.187228 
obj = -2499.485353, rho = -0.072050 
nSV = 852, nBSV = 48 
Total nSV = 852 
<Accuracy = 63.1579% (60/95) (classification) 

我要問什麼應該是最佳的S &伽馬該數據集高斯SVM參數C和伽瑪

+0

像lennon310在他的回答中說,你可以做一個網格搜索來找出好的參數。他們可以爲每個數據集不同,所以你真的需要自己找到它們。 – Sentry

回答

4

使用網格搜索方法,雖然速度可能是一個問題。

如果您正在使用MATLAB,從FAQ page下面的代碼可能工作:

bestcv = 0; 
for log2c = -1:3, 
    for log2g = -4:1, 
    cmd = ['-v 5 -c ', num2str(2^log2c), ' -g ', num2str(2^log2g)]; 
    cv = svmtrain(label, training_set, cmd); 
    if (cv >= bestcv), 
     bestcv = cv; bestc = 2^log2c; bestg = 2^log2g; 
    end 
    fprintf('%g %g %g (best c=%g, g=%g, rate=%g)\n', log2c, log2g, cv, bestc, bestg, bestcv); 
    end 
end 

如果您正在使用Python,檢查本pagegridrepression.py使用。