The following MATLAB code trains a MATLAB binary classifier given a set of vectors and tests another set of vectors in that classifier:
%Número mínimo de iterações
optSVM = statset('MaxIter', 1000000);
%treino do classificador
SVMtrainModel = svmtrain(training_vectors_matrix(:,2:end), training_vectors_matrix(:,1), 'kernel_function' , 'linear', 'options', optSVM, 'tolkkt', 0.01);
%lê os vetores de teste
TestV = csvread(test_file);
%Testa os vetores no classificador
TestAttribBin = svmclassify(SVMtrainModel, TestV(:,2:end))
That is, it is a simple code that would run without problems. But here the training works normally, but when I test, MATLAB gives me the following error:
Subscript indices must either be real positive integers or logicals.
Error in svmclassify (line 140)
outclass= glevels(outclass(~unClassified),:);
What would be the cause of this problem? I already looked for NaN values in the training and the test and nothing. This code would normally run under normal conditions. What do I have that might be causing this?
Crosspost: Matlab Stats Svm error in testing