how to fix the below error

3 Ansichten (letzte 30 Tage)
khalil ur Rehman
khalil ur Rehman am 29 Apr. 2019
Kommentiert: khalil ur Rehman am 30 Apr. 2019
[fs,history] = sequentialfs(fun, X_train, Y_train, 'cv',c, 'options', opts, 'nfeatures' ,2);
  2 Kommentare
KSSV
KSSV am 29 Apr. 2019
Where/ what error?
khalil ur Rehman
khalil ur Rehman am 30 Apr. 2019
THis is my Code:
Error using crossval>evalFun (line 488)
The function
'@(train_data,train_labels,test_data,test_labels)sum(predict(fitcsvm(train_data,train_labels,'KernelFunction','rbf'),test_data)~=test_labels)'
generated the following error:
You cannot train an SVM model for more than 2 classes.
Error in crossval>getFuncVal (line 505)
funResult = evalFun(funorStr,arg(:));
Error in crossval (line 351)
funResult = getFuncVal(1, nData, cvp, data, funorStr, []);
Error in sequentialfs>callfun (line 496)
funResult = crossval(fun,x,other_data{:},...
Error in sequentialfs (line 364)
crit(k) = callfun(fun,x,other_data,cv,mcreps,ParOptions);
Error in Transport_SVM (line 27)
[fs,history] = sequentialfs(fun, X_train, Y_train, 'cv',c, 'options', opts, 'nfeatures' ,2);
Below is error
Error using crossval>evalFun (line 488)
The function
'@(train_data,train_labels,test_data,test_labels)sum(predict(fitcsvm(train_data,train_labels,'KernelFunction','rbf'),test_data)~=test_labels)'
generated the following error:
You cannot train an SVM model for more than 2 classes.
Error in crossval>getFuncVal (line 505)
funResult = evalFun(funorStr,arg(:));
Error in crossval (line 351)
funResult = getFuncVal(1, nData, cvp, data, funorStr, []);
Error in sequentialfs>callfun (line 496)
funResult = crossval(fun,x,other_data{:},...
Error in sequentialfs (line 364)
crit(k) = callfun(fun,x,other_data,cv,mcreps,ParOptions);
Error in Transport_SVM (line 27)
[fs,history] = sequentialfs(fun, X_train, Y_train, 'cv',c, 'options', opts, 'nfeatures' ,2);

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Standalone Applications finden Sie in Help Center und File Exchange

Produkte


Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by