How to use rbf_kernel parameters with svmtrain() and svmclassify() for svm classification
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
By using linear kernel I got the result using svmtrain() and svmclassify() function. But the result obtained is not so accurate. When I used rbf_kernel I got an error as follows. Please help me how to use parameters with example
>> load fisheriris >> data = [meas(:,1), meas(:,2)]; >> groups = ismember(species,'setosa'); >> [train, test] = crossvalind('holdOut',groups); >> cp = classperf(groups); >> svmStruct = svmtrain(data(train,:),groups(train),'showplot',true);
//Error below
>> svmStruct = svmtrain(data(train,:),groups(train),'kernel_function','1'); ??? Error using ==> svmtrain at 266 Unknown Kernel Function 1.
0 Commenti
Risposte (3)
Tom Lane
il 28 Mar 2012
From your description, it sounds like you intended
svmStruct = svmtrain(data(train,:),groups(train),'kernel_function','rbf');
In any case, the error message simply means that '1' isn't a valid value to follow the 'kernel_function' parameter name.
1 Commento
Yasir Mohammed
il 30 Mag 2016
svmStruct =svmtrain(data(train,:),groups(train),'kernel_function','rbf'); i used this but i also have the same error
Error using svmclassify (line 75) Unknown parameter name: kernel_function.
Error in SVMtest (line 14) testresult = svmclassify(svmStructSurprise,testone,'kernel_function','rbf' );
>>
Pratik Oak
il 22 Mar 2013
Use this:
svmStruct = svmtrain(data(train,:),groups(train),'RBF_Sigma','1')
name of kernel function should be added
0 Commenti
Farman Shah
il 14 Ago 2018
Modificato: Farman Shah
il 14 Ago 2018
_ _ _ _ _ _ _ _ _ _ _ * * * * * * * * * *svmStruct =svmtrain(data(train,:),groups(train),'kernel_function','rbf'); i used this but i also have the same error
Error using svmclassify (line 75) Unknown parameter name: kernel_function.
Error in SVMtest (line 14) testresult = svmclassify(svmStructSurprise,testone,'kernel_function','rbf' );
>>**********____
Dear you are getting the error because you are adding 'Kernel_Function', 'polynomial', 'Polyorder', 4 to svmclassify.Add this kernal parameter to the trainsvm function instead..i.e
SVMStruct = svmtrain(features_train,labels_train,'Kernel_Function', 'polynomial', 'Polyorder', 4);
and it will work... _____
1 Commento
Tsalsabilla Winny Junika
il 29 Mag 2019
what about the svmclassify? Is that any change for that code???
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!