Hello,
I am using the command
cl = fitcsvm(X,Y,'KernelFunction','rbf',...
'BoxConstraint',Inf,'ClassNames',[-1,1]);
in my program. How do I go about changing the 'rbf'?

 Accepted Answer

Walter Roberson
Walter Roberson on 23 Oct 2016

1 vote

6 Comments

I tried
cl = fitcsvm(X,Y,'KernelFunction',2, 'BoxConstraint',Inf,'ClassNames',[-1,1]);
but I got the error:
Error using classreg.learning.modelparams.SVMParams.make (line 217) You must pass 'KernelFunction' as a string.
That is correct, the parameter you give after the 'KernelFunction' keyword needs to be a string naming the function that will be called by the kernel.
What function are you trying to use as your kernel?
Hello, I wanted to use 'rbf' with different sigma values. I also tried:
cl = fitcsvm(X,Y,'KernelFunction','rbf', 'rbf_Sigma',2, 'BoxConstraint',Inf,'ClassNames',[-1,1]);
but that also did not work.
Thanks for your time and help!
Hello, the fitcsvm help does not tell me how to vary the sigma. I tried
cl3 = fitcsvm(X,Y,'KernelFunction','rbf', ...
'Standardize',true,'BoxConstraint',10,'ClassNames',[-1,1]);
but do not yet know how to add and then vary sigma. Thanks!
Create your own RBF routine that has a sigma built in to it.
Or possibly the KernelScaling might be what is needed, but the documentation for how that all worked is long and it was not clear to me how the various aspects work together.
How to make the code implementation Multiquadric RBF on 1d heat equation.

Sign in to comment.

Categories

Find more on Statistics and Machine Learning Toolbox in Help Center and File Exchange

Products

Tags

Community Treasure Hunt

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

Start Hunting!