Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
On Wednesday, July 17, 2013 3:03:14 PM UTC-4, jack.co...@nasa.gov wrote: > I'm using > > iwts = CLUST_WTS(ibza,N_CLUSTERS=2) > result = CLUSTER(ibza, iwts, n_clusters=2) > ... > > So, I'm thinking that CLUSTER uses some kind of random seed, and sometimes it works, sometimes not? Yep, see the documentation for CLUST_WT :-) Note: Because the initial clusters are chosen randomly, your results may differ slightly each time the CLUST_WTS routine is invoked, even for the same input data. For data with well-defined clusters the differences should be slight. For randomly-scattered data (no distinguishable clusters), the results may be significantly different, which may indicate that k-means clustering is not appropriate for your data.
Yes, thanks, that makes sense. It actually works pretty well most of the time. As an experiment, I copied the demonstration array and did a cluster analysis repeatedly; got the cluster identified twice in 27 attempts. It's a pretty obvious cluster if you plot it out, given a two state a priori, I'd have thought cluster would find it without sooo much trouble. Given time it might be fun to come up with a more successful algorithm...
On 07/17/2013 09:54 PM, jack.connerney@nasa.gov wrote: > > Given time it might be fun to come up with a more successful algorithm... There are plenty of other algorithms... All with their own strengths and weaknesses. To be sure that CLUST_WTS converges you should increase the number of iterations with N_ITERATIONS. This will reduce the random factor considerably.