아래 [1] 주소에 나와있는대로, rbf 커널로 하고, boxconstraintrbf_sigma 를 설정한다. 이때, fitcsvm함수에서의 rbf_sigma값은 'KernelScale'로 설정한다 [2]. [2]에서 The software divides all elements of the predictor matrix X by the value of KernelScale.라고 돼 있는데, 이게 sigma인 이유는 [3]에서 매트릭스를 둘다 나눈 것은 결국 sigma역할을 하므로.

 

[1] http://www.mathworks.com/help/releases/R2013a/stats/support-vector-machines-svm.html#bsr5o3f

 

 

  • Start with Kernel_Function set to 'rbf' and default parameters.

  • Try different parameters for training, and check via cross validation to obtain the best parameters.

The most important parameters to try changing are:

  • boxconstraint — One strategy is to try a geometric sequence of the box constraint parameter. For example, take 11 values, from 1e-5 to 1e5 by a factor of 10.

  • rbf_sigma — One strategy is to try a geometric sequence of the RBF sigma parameter. For example, take 11 values, from 1e-5 to 1e5 by a factor of 10.

 

[2]https://www.mathworks.com/help/stats/fitcsvm.html#bt7oo83-5

'KernelScale' — Kernel scale parameter
1 (default) | 'auto' | positive scalar

Kernel scale parameter, specified as the comma-separated pair consisting of 'KernelScale' and 'auto' or a positive scalar. The software divides all elements of the predictor matrix X by the value of KernelScale. Then, the software applies the appropriate kernel norm to compute the Gram matrix.

  • If you specify 'auto', then the software selects an appropriate scale factor using a heuristic procedure. This heuristic procedure uses subsampling, so estimates can vary from one call to another. Therefore, to reproduce results, set a random number seed using rng before training.

  • If you specify KernelScale and your own kernel function, for example, kernel, using 'KernelFunction','kernel', then the software throws an error. You must apply scaling within kernel.

Example: 'KernelScale',''auto'

Data Types: double | single | char

 

 

 

[3] https://www.mathworks.com/matlabcentral/newsreader/view_thread/339612

 

Doc says that for these 3 kernels "the software divides all elements of
the predictor matrix X by the value of KernelScale". The unscaled
Gaussian (aka RBF) kernel is

G(x,z) = exp(-(x-z)'*(x-z))

for column-vectors x and z. If KernelScale is s, its scaled version is

G(x,z) = exp(-(x/s-z/s)'*(x/s-z/s))

or equivalently

G(x,z) = exp(-(x-z)'*(x-z)/s^2)

Setting KernelScale sets the RBF sigma.

-Ilya

 

 

[4]http://stackoverflow.com/questions/40226658/change-the-value-of-sigma-using-the-fitcsvm-function-in-matlab

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Posted by uniqueone
,