how to fix the below error

2 vues (au cours des 30 derniers jours)
khalil ur Rehman
khalil ur Rehman le 29 Avr 2019
[fs,history] = sequentialfs(fun, X_train, Y_train, 'cv',c, 'options', opts, 'nfeatures' ,2);
  2 commentaires
KSSV
KSSV le 29 Avr 2019
Where/ what error?
khalil ur Rehman
khalil ur Rehman le 30 Avr 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);

Connectez-vous pour commenter.

Réponses (0)

Produits


Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by