Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'Composite' mode has duplicate results (nearest neighbors not unique) #505

Open
Reederoo opened this issue Jun 10, 2023 · 1 comment
Open

Comments

@Reederoo
Copy link

Reederoo commented Jun 10, 2023

I wrote a Matlab function to check the uniqueness of the results index matrix and found that when the algorithm is 'composite', the results are up to 25% duplicate indices. None of the other algorithms produce any duplicate indices so I think this is a bug in 'composite'.

function avg_uniqueness = calculateUniqueness(result)
k = size(result,1); % The number of neighbors
n = size(result,2); % The number of query points
total_uniqueness = 0;
for i=1:n
% Count the number of unique neighbors for this query point
unique_count = length(unique(result(:, i)));
% Calculate the uniqueness fraction for this query point
uniqueness = unique_count / k;
% Add it to the total uniqueness
total_uniqueness = total_uniqueness + uniqueness;
end
% Calculate the average uniqueness
avg_uniqueness = total_uniqueness / n;
end

@stephematician
Copy link

Even though I don't have MATLAB I can confirm this.

This occurs when a CompositeIndex is searched without ensuring that a heap-based ResultSet is used; I'll add this to my fork (as it appears FLANN is not being updated anymore).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants