Info

此问题已关闭。 请重新打开它进行编辑或回答。

Identifying class based on distance voting

1 次查看(过去 30 天)
Aravin
Aravin 2016-7-30
关闭: MATLAB Answer Bot 2021-8-20
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??

回答(1 个)

Image Analyst
Image Analyst 2016-7-30
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.

此问题已关闭。

Community Treasure Hunt

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

Start Hunting!

Translated by