Click here to Skip to main content
15,921,548 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hello everyone!this is Anirban.Currently i am working on a k-means clustering project.Can anyone give me the program code written in C language?please help me...... :(( :(( :((
You can mail me the program code.My email id is [DELETED]@gmail.com:confused::confused::confused::

[edit]Never post your email address in any forum, unless you really like spam! If anyone replies to you, you will receive an email to let you know - OriginalGriff[/edit]
Posted
Updated 20-Feb-11 4:35am
v3

Please read the FAQ, before posting: you shouldn't ask here for full code. Try yourself developing and, whenever you're stuck, post a specific question here.
:)
 
Share this answer
 
Comments
Albin Abel 20-Feb-11 11:09am    
:)
Sergey Alexandrovich Kryukov 20-Feb-11 15:11pm    
My 5. Tell them!
--SA
CPallini 20-Feb-11 15:50pm    
I know, it was an easy shot. Anyway, someone should tell them...
I expect you will find some useful information here[^].
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 20-Feb-11 15:13pm    
Should be plenty of reading, 5.
--SA
Hi,

K- means clustering is a simple algorithm. Nothing much to worry. K stands for number of clusters. So here the number of clusters predefined.

So first take arbitrary means for each cluster expected. Then calculate the distance from that means to your data point and assign that point to the cluster which has minimal distance to the clusters mean. Once you have partitioned all the points recalculate the mean of each cluster and repeat the first step till the cluster mean not change from the accepted difference.

As this is iterative , instead of assign arbitrary means analyst the data histogram and take the modes of each group (if the data has clusters it will show multi modes) as the initial mean. In that way you can reduce the iterations and get faster response.

But yes, this algorithm goes complex if you have n-dimensional data. For a 2D data this very simple algorithm. Again yes, this algorithm improved a lot for a decade and now advanced algorithms available for improved accuracy. I given the basics of it, you can learn more and write your optimized codes now.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 20-Feb-11 15:13pm    
Good, my 5. (Would you add any references?)
--SA
Albin Abel 20-Feb-11 22:11pm    
Sure SA, Thanks. There are lot of reference available. Let me find a good one out of that and post here. Thanks for your suggestion

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900