954,545 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

java source code for k means clustering

hi,
I am very naive to java. my project is in data mining where i have to implement k means clustering.
the task is like this
1.reads a csv file and stores the attributes in a matrix format
2.clusters the matrix data depending on the euclidean distance measure.
3. the centroid value the user must give
4. the mean should be recalculated for the clusters to maintain accuracy
4. the output should be the clusters or groups
thanks in advance

thijo
Newbie Poster
12 posts since Feb 2009
Reputation Points: 10
Solved Threads: 0
 

I don't know why you're telling us what you need to do, but I wish you luck.

masijade
Industrious Poster
Moderator
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
 
rapture
Posting Whiz in Training
294 posts since Jul 2007
Reputation Points: 155
Solved Threads: 41
 

hi,
I am very naive to java. my project is in data mining where i have to implement k means clustering.
the task is like this
1.reads a csv file and stores the attributes in a matrix format(6000rows and 86 columns). From that i have to choose certain columns(attributes) for clustering
2.clusters the matrix data depending on the euclidean distance measure.(minimum distance) from the user given centroids
3. the centroid value the user must give.
4. the mean should be recalculated for the clusters to maintain accuracy
4. the output should be the clusters or groups
please help to code in java. do i have any packages in java to implement this
thanks in advance

thijo
Newbie Poster
12 posts since Feb 2009
Reputation Points: 10
Solved Threads: 0
 
I am very naive to java.

So buy / borrow / steal a book on Java read it (there is also the " Starting Java " sticky which should interest you) and get up to speed on it. I think your class instructor / firm would have given you this assignment only after they were **sure** that you could handle it. However if you gave them a false impression of your skills then I do not know .....

do i have any packages in java to implement this

Weka is a data mining tool written in Java, so you might want to check out how it works. I however have never used, so do not have a clue about it.

please help to code in java


Help yes, but do not expect us to do the entire work for you. First you show us what you have tried. Reading data from a CSV file is simple enough show what you have achieved there ??

stephen84s
Nearly a Posting Virtuoso
1,443 posts since Jul 2007
Reputation Points: 668
Solved Threads: 154
 
thijo
Newbie Poster
12 posts since Feb 2009
Reputation Points: 10
Solved Threads: 0
 

Put your code inside code tags, like this:-

[code=java]
// Your code here.
[/code]

The rest like the output you are getting, post it as :-

[code]
//Output on compiling / running the program.
[/code]

stephen84s
Nearly a Posting Virtuoso
1,443 posts since Jul 2007
Reputation Points: 668
Solved Threads: 154
 
thijo
Newbie Poster
12 posts since Feb 2009
Reputation Points: 10
Solved Threads: 0
 

why you people dont help

thijo
Newbie Poster
12 posts since Feb 2009
Reputation Points: 10
Solved Threads: 0
 

i have compiled the source code main1.java.it's getting error in Decimalformat object. i need your help.

victoriageorge
Newbie Poster
2 posts since Apr 2009
Reputation Points: 10
Solved Threads: 0
 

1) You're posting to a thread that is two months old, start you own thread.
2) You have not explained your problem nor have you shown what you've done to reach the point where you got an error. (if all you did was copy and paste someone else's code you're not going to get help.)

rapture
Posting Whiz in Training
294 posts since Jul 2007
Reputation Points: 155
Solved Threads: 41
 

i am in need of k means clustering for the face recognition which is for my research.so i need a sample code in any language(c,c++,java or vb)

victoriageorge
Newbie Poster
2 posts since Apr 2009
Reputation Points: 10
Solved Threads: 0
 
sdemirel
Newbie Poster
1 post since Mar 2011
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You