經安全檢測,此網站為安全網站,請放心前往原始網址!

machine learning - Matlab:K-means clustering - Stack Overflow

Assuming you're using squared euclidean distance metric, try this: for i = 1:size(ctrs,2) d(:,i) = sum((B-ctrs(repmat(i,size(B,1),1),:)).^2,2); end [distances,predicted] = min(d,[],2) predicted should then contain the index of the closest centroid, and di

stackoverflow.com

網址安全性掃描由 google 提供