Applied Math & Computer Science Lab
Data Analysis, Optimization & Mathematical Modeling, Artificial Intelligence, Neural Net For Everyday Life Applications
AI/Data Mining Links Webmaster Resources AMCSL Forum Submit Link New Additions Archive
Downloads      Clickstream Miner    - site feed
A Message Board, Guestbook, or Poll hosted for your website.
AMCSL Forum

New Posts
Applied Math & Computer Science Lab > Forums > Clustering > k-means
 

Thread Tools  | Search This Thread 
Reply
 
Author Comment
 
lwebzem
    08/05/07 at 09:24 AM
#1

I created k-means code and demo at http://www.cifnet.com/~lwebzem/k_means/test3.cgi

several years ago. This month I will update it to add clustering online from textarea data input.
lwebzem
    08/11/07 at 03:59 PM
#2

Clustering online is available now at:

http://www.cifnet.com/~lwebzem/k_means/test3.cgi.

dataminer
    01/05/08 at 07:51 AM
#3

Hi,
looking for source code for fuzzy clustering.
Any links or help is appreciated.
Thanks.
remi
    04/14/08 at 05:16 AM
#4

Hello,

I have encoutered a problem in the new code (update from 11/2007) :
I've tried these data (2 clusters) :
10 4
10.1 4
11.4 4
10.9 4
10.002 4
11 4

and everything is placed in the Cluster 0.
Then I tried with the old Code, and everything was OK...

Regards,
Remi
lwebzem
    06/28/08 at 01:29 PM
#5

Hi Remi,
sorry somehow I missed email notification.
Anyway I run it with your data but it works OK for me.
It put in 2 clusters. Here is the output:
C:\WINDOWS\Desktop\Perl\k_means\11_07>perl do_k_means.cgi
Number 0f clusters=2
10 4
10.1 4
11.4 4
10.9 4
10.002 4
11 4
Cluster: 0 Point 0 <br>
Cluster: 0 Point 1 <br>
Cluster: 1 Point 2 <br>
Cluster: 1 Point 3 <br>
Cluster: 0 Point 4 <br>
Cluster: 1 Point 5 <br>

C:\WINDOWS\Desktop\Perl\k_means\11_07>

If you give me more details I can investigate further.
But looks like it works OK.
Thanks and best regards,
Lwebzem.





gnembon
    08/14/08 at 07:39 AM
#6

try
1 0
0 0
0 1
1 1
100 100
101 101
100 101
101 100
 and the number of clusters: 3

the code breaks. In my opinion this is a problem with handling clusters with no items. In my implementation i have added the old centroid to the cluster preventing from 0-items clusters.
lwebzem
    08/14/08 at 08:34 PM
#7

yes you are right , it correctly classify in 2 clusters but fails when the number of clusters is 3.  I will need investigate more for this issue.
Thanks for your reply.
lwebzem
    10/16/08 at 10:24 AM
#8

I updated the demo online so it now correctly clusters also in 3 clusters for the below data (see prev. msg). The source code for 11/2007 is working fine (it already has this upgrade).
Thanks to all for pointing on this.
kpeter
    12/05/08 at 08:12 AM
#9

Hi,

thank you for the online algorithm, very nice! I'm just wondering how the randomization of the initial centroids was done. I would expect that the K-means algorithm gives different clusterings for different runs on the same input from
Wikipedia. But the online implementation seems to be deterministic for the same set of data. I've tried for example with the set of
1 1 1
2 2 2
3 3 3
4 4 4
5 5 5
6 6 6
and the clustering for a constant cluster size never changed (for my tries). Could you please give a little bit explanation on that?

Thanks and greetings,
Peter

lwebzem
    12/06/08 at 10:13 PM
#10

Hi Peter,

the initialization of  first centroids is not really random. The program takes just first k points as inital centroids. That's why clustering is not changed.
Let me know if any questions.

Thanks for interesting in this script and best regards. 
kpeter
    12/09/08 at 07:40 AM
#11

Thank you for the answer!
Peter



Previous Thread | Next Thread
Reply

 
Bookmarks
 
Digg Diggdel.icio.us del.icio.usStumbleUpon StumbleUponGoogle Google