Clear Filters
Clear Filters

Is it possible to see which instances are classified incorrectly for the trainImage​CategoryCl​assifier example?

4 views (last 30 days)
I'm getting some good results going through the steps in the trainImageCategoryClassifier example (https://www.mathworks.com/help/vision/ref/trainimagecategoryclassifier.html?s_tid=doc_ta). However, all I can see at the moment is the confusion matrix. I'd like to know which of my testing samples are being misclassified so that I can evaluate them and see if there is anything that is obvious about them that might warrant further study.

Accepted Answer

Michael Cooper-Stachowsky
I've answered my own question with a bit of searching, sorry!
%output classifications
for i = 1:length(testSet.Files)
[idx,score] = predict(categoryClassifier,readimage(testSet,i));
if (testSet.Labels(i) ~= categoryClassifier.Labels(idx))
i %just output the index, do interesting things with it later
end
end

More Answers (0)

Community Treasure Hunt

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

Start Hunting!