필터 지우기
필터 지우기

Grouping variable must be a vector or a character array.

조회 수: 5 (최근 30일)
Hazel Sialongo
Hazel Sialongo 2017년 1월 9일
답변: Walter Roberson 2017년 1월 10일
This is my code:
load classify_data
itr = 500;
hWaitBar = waitbar(0,'Image is still classifying...');
for i = 1:itr
data = train_feat;
groups = ismember(test_label,0);
[train,test] = crossvalind('HoldOut',groups);
svmStruct = svmtrain(data(train,:),groups(train),'showplot',false,'kernel_function','linear');
classes = svmclassify(svmStruct,data(test,:),'showplot',false);
end

답변 (1개)

Walter Roberson
Walter Roberson 2017년 1월 10일
All I can think of is that you might be generating only 0 or 1 train members, in which case groups(train) would be empty or a scalar.

Community Treasure Hunt

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

Start Hunting!

Translated by