MATLAB Answers


How does SVMTRAIN determine Polynomial and RBF Kernel parameters (gamma,C) in the Bioinformatics Toolbox 3.5 (R2010a)?

Asked by Prabhakar on 18 Jan 2011
Latest activity Commented on by Adnan iqbal on 23 Aug 2017
I am using SVMTRAIN from the Bioinformatic Toolbox 3.5 (R2010a) and I would like to know if SVMTRAIN chooses the Kernel parameters (gamma,C), e.g. for the Polynomial or the RBF Kernel by itself. Is it possible to set these parameters manually?


Sign in to comment.

1 Answer

Answer by Adity
on 18 Jan 2011

MATLAB. SVMTRAIN uses a default value of 1, but you can set this value (e.g. to 0.8) by your own by using:
svmstruct = svmtrain(data, groups, 'Kernel_Function', 'rbf', 'RBF_Sigma', 0.2, 'BoxConstraint', 0.8)
If you want to find the optimal values for (sigma,C) you use cross validation and grid search. The idea is the following: 1. generate disjunct subsets A_i from the main set A, such that the union of the A_i equals A (see CROSSVALIND in Matlab help) 2. in a loop try parameters for (sigma,C) (so called grid search) 3. generate for each subset A_i a support vector machine svm_i with the test parameter pair (sigma,C) 4. test each svm_i with the remaining subsets A_j, j not equal to i 5. take a look on the error rate and take the pair (sigma,C) with the lowest error rate for all pairs (sigma,C) you have tested (see SVMCLASSIFY and CLASSPERF in MATLAB help) 6. calculate the final svm with the so found pair (sigma,C) based on the whole set A You have still some parameters to choose, e.g. the number of subsets A_i and the stepsize for C and sigma. These parameters depends on your given data set and problem, so it is up to you.