Hi Ted ,
Thanks for the code improvement will surely do that.

But still my question is open, how can I use cluster dump of kmeans in my java 
code to create a text file with details of cluster with their values.

I tried to Google but didn’t find any code for help.

Secondly,
I have a field ID in my data but for clustering I'm not using it. Then how can 
I use that ID for mapping the output of cluster dump.

Also if you can tell me how to run mean on some selected column ?

Can you help me in that.

Thanks & Regards,
Apurv Khare

-----Original Message-----
From: Ted Dunning [mailto:[email protected]]
Sent: Tuesday, June 25, 2013 9:56 PM
To: [email protected]
Subject: Re: How to Analyse K-mean Clustering output

On Tue, Jun 25, 2013 at 4:53 AM, Apurv Khare <[email protected]>wrote:

>           double[] d = new double[c.length];
>                         for (int i = 0; i < c.length; i++)
>                                 d[i] = Double.parseDouble(c[i]);
>                         Vector vec = new
> RandomAccessSparseVector(c.length);
>                         vec.assign(d);
>

As a picky point, this could be done better this way:

                        Vector vec = new RandomAccessSparseVector(c.length);
                        for (int i = 0; i < c.length; i++) {
                                vec.set(i, Double.parseDouble(c[i]));
                        }

No need for the double array.

The contents of this e-mail and any attachment(s) may contain confidential or 
privileged information for the intended recipient(s). Unintended recipients are 
prohibited from taking action on the basis of information in this e-mail and  
using or disseminating the information,  and must notify the sender and delete 
it from their system. L&T Infotech will not accept responsibility or liability 
for the accuracy or completeness of, or the presence of any virus or disabling 
code in this e-mail"

Reply via email to