Grouping variable must be a vector or a character array.
3 ビュー (過去 30 日間)
古いコメントを表示
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
0 件のコメント
回答 (1 件)
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.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Classification Trees についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!