Realization of clustering uning k-means algorithm.
#1

I am doing a project on realization of clustering using k-means algorithm.

Can any one help me to realize the following matlab codes,how it works,specifications and detail explanations regarding the code functions and its implementations, please help me out.


1.
function d=DistMatrix(A,B)
[hA,wA]=size(A);
[hB,wB]=size(B);
if hA==1& hB==1
d=sqrt(dot((A-B),(A-B)));
else
C=[ones(1,hB);zeros(1,hB)];
D=flipud©;
E=[ones(1,hA);zeros(1,hA)];
F=flipud(E);
G=A*C;
H=A*D;
I=B*E;
J=B*F;
d=sqrt((G-I').^2+(H-J').^2);
end



2.

function y=kMeansCluster(m,k,isRand)
m=[ 1 1; 2 1; 4 3; 5 4],k=2

if nargin<3, isRand=0; end
if nargin<2, k=2; end

[maxRow, maxCol]=size(m)
if maxRow<=k,
y=[m, 1:maxRow]
else

% initial value of centroid
if isRand,
p = randperm(size(m,1)); % random initialization
for i=1:k
c(i,Smile=m(p(i),Smile
end
else
for i=1:k
c(i,Smile=m(i,Smile % sequential initialization
end
end

temp=zeros(maxRow,1); % initialize as zero vector

while 1,
d=DistMatrix(m,c); % calculate objcets-centroid distances
[z,g]=min(d,[],2); % find group matrix g
if g==temp,
break; % stop the iteration
else
temp=g; % copy group matrix to temporary variable
end
for i=1:k
f=find(g==i);
if f % only compute centroid if f is not empty
c(i,Smile=mean(m(find(g==i),Smile,1)
end
end
end

y=[m,g];

end
Reply

Important Note..!

If you are not satisfied with above reply ,..Please

ASK HERE

So that we will collect data for you and will made reply to the request....OR try below "QUICK REPLY" box to add a reply to this page
Popular Searches: pattern based clustering algorithm, rebutton of tyres means, means of ppt, what management means, 3c5s means wat, wh means in result, p p t o means,

[-]
Quick Reply
Message
Type your reply to this message here.

Image Verification
Please enter the text contained within the image into the text box below it. This process is used to prevent automated spam bots.
Image Verification
(case insensitive)

Possibly Related Threads...
Thread Author Replies Views Last Post
  A Link-Based Cluster Ensemble Approach for Categorical Data Clustering 1 1,100 16-02-2017, 10:51 AM
Last Post: jaseela123d
  An Efficient Algorithm for Mining Frequent Patterns full report project topics 3 4,805 01-10-2016, 10:02 AM
Last Post: Guest
  watermarking algorithm seminar class 3 2,690 27-04-2016, 11:17 AM
Last Post: dhanabhagya
  DYNAMIC SEARCH ALGORITHM IN UNSTRUCTURED PEER-TO-PEER NETWORKS--PARALLEL AND DISTRIBU electronics seminars 9 7,394 14-07-2015, 02:25 PM
Last Post: seminar report asees
  TEA ENCRYPTION (ALGORITHM) computer science technology 1 2,672 11-11-2014, 10:45 AM
Last Post: Guest
  A TABU SEARCH ALGORITHM FOR CLUSTER BUILDING IN WIRELESS SENSOR NETWORKS- MOBILE COMP electronics seminars 1 2,080 01-12-2012, 12:06 PM
Last Post: seminar details
  A Tabu Search Algorithm for Cluster Building in Wireless Sensor Networks Electrical Fan 13 8,711 01-12-2012, 12:05 PM
Last Post: seminar details
  A ROBUST DIGITAL IMAGE WATERMARKING ALGORITHM USING DNA SEQUENCES smart paper boy 1 1,944 29-11-2012, 01:42 PM
Last Post: seminar details
  Medical image segmentation using clustering algorithm computer science technology 2 6,002 08-11-2012, 01:00 PM
Last Post: seminar details
  Privacy-preserving Data Publishing Based on De-clustering project topics 1 1,479 08-11-2012, 12:07 PM
Last Post: seminar details

Forum Jump: