Info

This question is closed. Reopen it to edit or answer.

Identifying class based on distance voting

1 view (last 30 days)
Aravin
Aravin on 30 Jul 2016
Closed: MATLAB Answer Bot on 20 Aug 2021
Lets say I have three classes. Each class have some template samples. For given query sample I want to find the possible class it matches to based on distance. Let the dimension of query be 1x256, and each sample of very class is also of same dimensions. Now based on voting scheme I want to know the class of given query. How may I do this.
How I am doing this, is as below.
Let D contains the sample of three classes. It is of size 256 x 30. For the sake of simplicity I have 10 samples for each class. For given query I do this following things. Let query be query.
query = repmat(query, [1 size(D,2)]);
dist = sqrt(sum((query - D).^2)); %Eculidean distance of query with all values.
Now I computing voting??

Answers (1)

Image Analyst
Image Analyst on 30 Jul 2016
I think might want knnsearch() in the Statistics and Machine Learning Toolbox. Otherwise computing the generalized linear distance is okay, but you mgiht want to divide by the size of each cluster (class) to normalize it.

This question is closed.

Community Treasure Hunt

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

Start Hunting!