# Choosing correct C and g parameters for libsvm

libsvm 3.18
Features: 10


I have used following, parameter range:

C-parameters: 2^-3  , 2^-2  .. 2^11,
g-parameters: 2^-11 , 2^-10 .. 2^-3,


with 10-fold cross validation(-v 10).

Maximum accuracy(81.8646%) at c-value 2048 and g-value 0.125.

When I used default c and g: 80.9531% accuracy is noticed.

Question 1:

If high values of C and g parameters caused any over-fitting and increased accuracy ?

Question 2:

Should I change the grid size for rescanning ?

Question 3:

Can I proceed with the c and g of 2048 and 0.125 ?

Your results seem fine, except for the fact that the best value of $\gamma$ you found in cross-validation happens to be on the border of your search-grid ($\gamma=2^{-3}$). I suggest expanding your grid to include $2^{-4}$ up to $2^{-6}$ or so.

Whenever one of the hyperparameters in the optimal tuple you obtain lies on the edge of a search grid, it is a good idea to expand the grid, since maybe the true optimal value lies beyond what you considered.

If high values of C and g parameters caused any over-fitting and increased accuracy ?

High values of $C$ and $\gamma$ can lead to overfitting. Since you are using cross-validation for model selection, this is not an issue to worry about. This is one of the reasons why using cross-validation is so important.

Should I change the grid size for rescanning ?

See above.

Can I proceed with the c and g of 2048 and 0.125 ?

Test for smaller values of $\gamma$ first.

• after rescanning I got the best @ above mentioned C and g parameters. for c= 2048 and g = 0.0625, accuracy is reported as 81.7751%. slightly decreased. – aravind ramesh May 12 '14 at 5:03