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)對。「網格搜索」的方法很直觀可是看起來有些原始。事實上有許多高級的算法,好比可使用一些近似算法或啓發式的搜索來下降複雜度。可是咱們傾向於使用「網格搜索」這一簡單的方法。算法

英語論文表達:app

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

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 ui

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 θ.this

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

相關文章
相關標籤/搜索