Explain the below Kmeans code.
Extract from http://www.mathworks.in/matlabcentral/fileexchange/24616-kmeans-clustering/content/litekmeans/litekmeans.m, below
E = sparse(1:n,label,1,n,k,n); % transform label into indicator matrix
m = X*(E*spdiags(1./sum(E,1)’,0,k,k)); % compute m of each cluster
[~,label] = max(bsxfun(@minus,m’*X,dot(m,m,1)’/2),[],1); % assign samples to the
Can you please explain the above code?Extract from http://www.mathworks.in/matlabcentral/fileexchange/24616-kmeans-clustering/content/litekmeans/litekmeans.m, below
E = sparse(1:n,label,1,n,k,n); % transform label into indicator matrix
m = X*(E*spdiags(1./sum(E,1)’,0,k,k)); % compute m of each cluster
[~,label] = max(bsxfun(@minus,m’*X,dot(m,m,1)’/2),[],1); % assign samples to the
Can you please explain the above code? Extract from http://www.mathworks.in/matlabcentral/fileexchange/24616-kmeans-clustering/content/litekmeans/litekmeans.m, below
E = sparse(1:n,label,1,n,k,n); % transform label into indicator matrix
m = X*(E*spdiags(1./sum(E,1)’,0,k,k)); % compute m of each cluster
[~,label] = max(bsxfun(@minus,m’*X,dot(m,m,1)’/2),[],1); % assign samples to the
Can you please explain the above code? kmeans MATLAB Answers — New Questions