SVM參數尋優:grid search


grid search和窮舉法比較類似。就是找到所有的組合一一實驗。cross validation就比如五層交叉驗證,每次拿樣本的1/5測試,其他都拿去訓練。循環五次之后求平均值。bestcg就是通過grid search找到最小cross validation誤差的那一組cg.

使用svm,無論是libsvm還是svmlight,都需要對參數進行設置。以RBF核為例,在《A Practical Guide to Support Vector Classi cation》一文中作者提到在RBF核中有2個參數:C和g。對於一個給定的問題,我們事先不知道C和g取多少最優,因此我們要進行模型選擇(參數搜索)。這樣做的目標是找到好的(C, g)參數對,使得分類器能夠精確地預測未知的數據,比如測試集。需要注意的是在在訓練集上追求高精確度可能是沒用的(意指泛化能力)。根據前一部分所說的,衡量泛化能力要用到交叉驗證。
在文章中作者推薦使用“網格搜索”來尋找最優的C和g。所謂的網格搜索就是嘗試各種可能的(C, g)對值,然后進行交叉驗證,找出使交叉驗證精確度最高的(C, g)對。“網格搜索”的方法很直觀但是看起來有些原始。事實上有許多高級的算法,比如可以使用一些近似算法或啟發式的搜索來降低復雜度。但是我們傾向於使用“網格搜索”這一簡單的方法。

英語論文表達:

To choose parameters of the model, this paper adopted the method of cross validation based on grid search, avoiding the arbitrary and capricious behav 

To acquire accuracy and stability, we apply 10-fold cross validation and a grid-search technique to 

The selection of the kernel parameters in SVM is a long-standing question. Empirically, cross-validation with grid-search is the most popular method 

Based on the validation set, the best pair of parameters is grid-searched in the range of [2 −2 ,2 2 ] and [θ 0 ,θ 1 ], respectively, for γ and θ.

C and the kernel width parameter γ were optimized using a grid search approach.

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM