AUTH's THMMY "Parallel and distributed systems" course assignments.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

24 lines
498 B

  1. %
  2. %
  3. %
  4. %C = rand(10000, 2); % Corpus
  5. %Q = rand(10000, 2); % Queries
  6. C = rand(20000, 2); % Δύο clusters
  7. Q = C;
  8. %Q = rand(10000, 2); % Queries κοντά στο μέσο
  9. k = 100; % Number of neighbors
  10. m = 100; % Max candidates per query
  11. global count;
  12. count =0;
  13. tic; [pi, pd] = recursiveKNN(C, Q, k, m); toc
  14. count
  15. tic; [si, sd] = knnsearch(C, Q, 'k', k); toc
  16. [a,b] = size(si);
  17. all_neighbors = a*b
  18. accuracy = 1 - nnz(si-pi)/all_neighbors
  19. false_neighbors = nnz(sd-pd)