pspp-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: K-Means Clustering


From: John Darrington
Subject: Re: K-Means Clustering
Date: Tue, 15 Mar 2011 20:21:06 +0000
User-agent: Mutt/1.5.18 (2008-05-17)

Hi Mehmet,

It's looking better all the time ...

In general we don't write to stdout. So you shouldn't use
printf  (except for debugging).  For user error messages, instead of   
`printf ("Variables cannot parse.\n");' you could write 
`msg (ME, _("Variables cannot be parsed"));'
However, in this case you really don't need to do anything, since 
the lexer will automatically write an error.

     
     5. This is the part what i didn't understand. Which part of code must be 
labeled 
     as "static"? If the answer is "All methods must be defined as static", 
what i 
     must do for "struct Kmeans* kmeans_create(...." ?

"struct Kmeans * kmeans_create (..."  should become:
"static struct Kmeans * kmeans_create (..."

and the same for all the functions except cmd_quick_cluster because that one is
called from outside the file.
 
     
     7. I used the gsl_rng_* things instead of standard library.

I see that you have used the "gsl_rng_taus" random number generator.  Unless 
there
is a compelling reason why the kmeans procedure needs this particular RNG, you 
should
use "get_rng ()" instead.  You'll need to #include <math/random.h>


     
     8) this link (http://www.norusis.com/pdf/SPC_v13.pdf) and googling "kmeans 
spss" 
     may help for the output of quick cluster. I haven't got a copy of SPSS 
too.  
     
     
Thanks for that.    I think the next step then is to write the output routines.
That way, users will see the results nicely presented both when running from 
the GUI
and from the terminal.  Maybe you can use this, and the information that Harry 
posted as reference.  The show_communalities fucntion from factor.c might be 
something you could use as a template.

Harry's example shows a total of four tables.  But two of them (the "Initial 
Cluster Centers"
and the "Final Cluster Centers") are very similar, so you might be able to 
write a
single function to render both of those.

Ask here if you get stuck.

J'


-- 
PGP Public key ID: 1024D/2DE827B3 
fingerprint = 8797 A26D 0854 2EAB 0285  A290 8A67 719C 2DE8 27B3
See http://pgp.mit.edu or any PGP keyserver for public key.

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]