フィルターのクリア

How can I compare all test samples with training samples by euclidean distance?

1 回表示 (過去 30 日間)
wisam kh
wisam kh 2018 年 7 月 24 日
コメント済み: wisam kh 2018 年 7 月 25 日
Hello
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.
test_template2= repmat(test_template1,1,size(trdata,2));
E_distance = sqrt(sum((test_template2-euclidean_template).^2));
[result indxofmin]=min(E_distance)
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
Image Analyst 2018 年 7 月 24 日
Use pdist2() from the Statistics and Machine Learning Toolbox.
  1 件のコメント
wisam kh
wisam kh 2018 年 7 月 25 日
thank you sir
But if you have an example, I will be grateful to you.
Thank you again

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeStatistics and Machine Learning Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by