Problem in svmtrain : Help
조회 수: 1 (최근 30일)
이전 댓글 표시
I want to use SVMStruct = svmtrain(Training,Group) for classification But each element in the Training matrix is represented by cell array so after run that I got this error :
*Error using svmtrain (line 241)
TRAINING must be a numeric matrix.*
Could anyone guide how to correct this error,thank you.
댓글 수: 0
답변 (1개)
the cyclist
2014년 4월 19일
One way to convert cell array categories to numerical categories is illustrated by the followign example:
Training = {'A','B','B','A','C','C'};
uniqueTraining = unique(Training);
[~,numericalTraining] = ismember(Training,uniqueTraining)
댓글 수: 2
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!