How I can write code for training and then do classification using naive Bayes either image is noisy or not ?
2 次查看(过去 30 天)
显示 更早的评论
I am a new user of MATLAB and want to do training and classification using naive Bayes. I have done it with confusion matrix but want to take result in the form of image. I am dealing with noisy images and want to classify either a given image is noisy or not?
I have matrix of features and matrix of (defined) Labels, How I can train and then do classification (using some sample image) either is it noisy or not ?
Please help, I shall be very thankful to you. Waiting for your kind response.
0 个评论
回答(1 个)
Image Analyst
2017-5-18
I haven't used it yet, but have you tried putting your feature vectors into fitcnb()?
5 个评论
Don Mathis
2017-6-5
编辑:Don Mathis
2017-6-5
I'm sorry but I still don't understand. Your example code does not return the result in the form of an image. The line
result = svmclassify(SVMStruct, lionTest);
returns a class label, which is probably a string like 'lion'. On the svmclassify Doc page (<http://www.mathworks.com/help/stats/svmclassify.html?searchHighlight=svmclassify&s_tid=doc_srchtitle#outputarg_Group)>, there is an example that shows that the result returned is a class label, in this case strings. Maybe you are saying that you want to return an example image from the same class as the classifier result? In that case you could take the string 'lion' and return the first lion image from your training set. Or, in your case I suppose your labels would be 'noisy' or 'not noisy', and so you would show a random noisy image?
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!