how to display the class result in knn classification?
1 次查看(过去 30 天)
显示 更早的评论
hello everyone
I would like to display the 4 class of image classification results with KNN but I always got 2 class how a can display the 4 class this is my code :
C=[1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 4 4 4 4 4 ];
T=[MA1;MA2;MA3;MA4;MA5;MB1;MB2;MB3;MB4;MB5;MC1;MC2;MC3;MC4;MC5;MD1;MD2;MD3;MD4;MD5];
model=ClassificationKNN.fit(T,C,'NumNeighbors',2);
[~,result1]=predict(model,x);
img1= reshape(result1(:,2),nn,mm);
0 个评论
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!