Gaussian kernel scale for RBF SVM

Hi All, I'm using RBF SVM from the classification learner app (statistics and machine learning toolbox 10.2), and I'm wondering if anyone knows how Matlab came up with the idea that the kernel scale is proportional to the sqrt(P) where P is the number of predictors. Additionally, it says "The software divides all elements of the predictor matrix X by the value of KernelScale", does this mean the kernel scale is simply 1/sigma^2? source: https://www.mathworks.com/help/stats/templatesvm.html#input_argument_namevalue_KernelScale. Thanks!

 採用された回答

Akira Agata
Akira Agata 2017 年 3 月 9 日

5 投票

Assuming the RBF kernel function with scaling parameter (gamma) as follows:
Then, the SVM model should be set using "KernelScale" like this.
mdlSVM = fitcsvm(..., 'KernelScale', 1/sqrt(gamma));

7 件のコメント

vince65201
vince65201 2017 年 3 月 9 日
Awesome! Thanks.
Jorge Pesantez
Jorge Pesantez 2018 年 11 月 3 日
I hope I can get an answer from this thread. How do you define gamma using fitcsvm?. I've been looking for a name-value and there is no gamma definition. Thanks
Akira Agata
Akira Agata 2018 年 11 月 5 日
編集済み: Akira Agata 2018 年 11 月 5 日
Hi Jorge-san,
In fitcsvm function, default value of gamma is 1. If you want to use other value, you should define gamma by yourself, like:
gamma = 0.8;
mdlSVM = fitcsvm(..., 'KernelScale', 1/sqrt(gamma));
Zee Idrees
Zee Idrees 2018 年 12 月 9 日
Can you please share the code of above equation? I need that code for my project... I need help
Akira Agata
Akira Agata 2018 年 12 月 9 日
fitcsvm is one of many useful functions which the "Statistics and Machine Learning Toolbox" provides. More details and some sample code can be found in the following documentation page.
Tsalsabilla Winny Junika
Tsalsabilla Winny Junika 2019 年 6 月 1 日
what about the svm classify?
Walter Roberson
Walter Roberson 2019 年 6 月 1 日

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by