1. 程式人生 > >SVM的高斯kernel 引數c和gamma說明

SVM的高斯kernel 引數c和gamma說明

The SVM with a Gaussian kernel function has two such training parameters: C which controls overfitting of the model, and gamma (γ) which controls the degree of nonlinearity of the model. Gamma is inversely related to sigma which is a degree for spread around a mean in statistics: the higher the value of gamma, the lower the value of sigma, thus the less spread or the more nonlinear the behavior of the kernel. The values of these training parameters C and gamma are determined by grid search and cross validation: the model with the highest estimated performance determines the selected training parameters. Then, the performance of the constructed model is estimated by using 5-fold cross validation on the training data. Finally, the constructed model is validated by predicting the validation data and comparing these predictions with the real observations by means of ROC curves.

gamma(或Epsilon ε)---不敏感損失函式的引數,gamma越大,支援向量越少,gamma值越小,支援向量越多,RBF寬度越大

C 懲罰係數,C過大或過小,泛化能力變差
對應matlab libSVM中的 引數 -c和-g
舉例如下:
model = svmtrain(train_label,train_feature,'-t 2 -c 2 -g 0.07'); 
[predict_label,accuracy]=svmpredict(test_label,test_feature,model);