How can I compare all test samples with training samples by euclidean distance?
1 view (last 30 days)
Show older comments
wisam kh on 24 Jul 2018
Commented: wisam kh on 25 Jul 2018
The features of the images were extracted, 60 training images and 20 images for test.
Use the euclidean distance to compare the test samples with the training samples.
E_distance = sqrt(sum((test_template2-euclidean_template).^2));
Using this code I can compare one sample of the test samples with all the training samples.
How can I compare all test samples with training samples and give the closest sample number for each sample of the test?
Image Analyst on 24 Jul 2018
Use pdist2() from the Statistics and Machine Learning Toolbox.
More Answers (0)
Find more on Pattern Recognition and Classification in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!