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'?

 채택된 답변

Walter Roberson
Walter Roberson 2016년 10월 23일

1 개 추천

댓글 수: 6

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.
Walter Roberson
Walter Roberson 2016년 10월 24일
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!
Walter Roberson
Walter Roberson 2016년 10월 24일
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.
Hassan Raza
Hassan Raza 2023년 11월 15일
How to make the code implementation Multiquadric RBF on 1d heat equation.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

카테고리

도움말 센터File Exchange에서 Statistics and Machine Learning Toolbox에 대해 자세히 알아보기

제품

태그

질문:

2016년 10월 23일

댓글:

2023년 11월 15일

Community Treasure Hunt

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

Start Hunting!

Translated by