Advertisement
Guest User

Untitled

a guest
Apr 18th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. clear
  2. load count.dat
  3. X = count;
  4. typy_odleglosci = {'sqEuclidean'; 'cityblock'; 'cosine'; 'correlation'; 'Hamming'};
  5. rodzaj = {'Euclidean'; 'sqEuclidean'; 'cityblock' ; 'cosine'; 'correlation';'Hamming'};
  6. wynik = zeros(8,8);
  7. sup = 0;
  8. supI = 0;
  9. supRodzaj = char(rodzaj(1));
  10. for i = 1:6
  11. for j = 1:4
  12. K = kmeans(X,i,'distance',char(typy_odleglosci(j)));
  13. [silh,h] = silhouette(X,K,char(typy_odleglosci(j)));
  14. S = mean(silh);
  15. if(S > sup)
  16. sup = S;
  17. supI= K;
  18. supRodzaj = char(rodzaj(j));
  19. end
  20. wynik(i,j) = S;
  21. end
  22. end
  23. [silh,h] = silhouette(X,supI,supRodzaj)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement