Skip to content

Clustering and Calinski's index

6 messages · David Wartel, Thomas de Cornulier, Henrik Bengtsson +1 more

#
On Wed, 20 Feb 2002, David Wartel wrote:

            
Where is that from? It's not part of R -- package cclust, perhaps?
The programmer forgot drop=FALSE, it would seem.
#
I have to solve a clustering problem.
My first step is to determinate the number of clusters, that's why I 'm using 
the Calinski index ( [tr(b)/(k-1)]/[tr(w)/(k-1)] )  which i try to maximize  
to have the best number of clusters.
A function is already implemented in R to calculate this index :

clustIndex(cl,x, index="calinski")

where cl is the result of a clustering method , for instance:

cclust(x,k,itermax,verbose=TRUE,method="kmeans")

My probleme is that I can't calculate the Calinski's index when a cluster 
contains only one datapoint :

Error in cov(x[cluster == l, ]) : supply both x and y or a matrix-like x


Is there a way to solve this?

thanx for your help,

David

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
2 days later
#
Dear all,
I spent a long time today to find out why symbols( ) didn't display all my points.
In fact, the function cannot display circles with a small radius when the range of
radii is too large, whereas circles with radius=0 are drawn as dots!
here are a simple examples:
#plots 6 circles
#plots 8 circles

this looks quite illogical to me, should it be considered as a bug?

I don't think it is of use, however:
I did this in R 1.3.0 and 1.4.1 both running on Windows 95

thomas
--
------------------------------------
Thomas de Cornulier
CEBC-CNRS
79360 Villiers en Bois

(0033) 5 49 09 61 11 (heures bureau)
(0033) 5 49 09 67 43 (soir)
(0033) 6 20 66 07 84 (mobile)
------------------------------------


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
On Fri, 22 Feb 2002, Thomas de Cornulier wrote:

            
The version information was a great deal of use. Both work correctly for
me on Windows 2000/XP, so it looks like the bug is in Windows 95 and/or
your graphics card driver.  Time for a upgrade?
#
I tried (almost) the same on WinMe:

 >symbols(1:8,1:8,circle=c(1,2,3,4,88,0,0,50),inches=0.2)

and I can't see the first *two* circles. Trying to generate a jpeg output
using

 >jpeg(file="foo.jpg", width=640, height=640)
 >symbols(1:8,1:8,circle=c(1,2,3,4,88,0,0,50),inches=0.2)
 >dev.off()

gives the same result. dev.copy2eps() works fine.

Henrik Bengtsson

Dept. of Mathematical Statistics @ Centre for Mathematical Sciences
Lund Institute of Technology/Lund University, Sweden (+2h UTC)
Office: P316, +46 46 222 9611 (phone), +46 46 222 4623 (fax)
h b @ m a t h s . l t h . s e
http://www.maths.lth.se/bioinformatics/
http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._.
_._


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
On Sat, 23 Feb 2002, Henrik Bengtsson wrote:

            
Which is also based on the 1980s 16-bit GDI code used by Windows 3.x and
95.
jpeg was not a good choice for a line diagram, but it is using the same GDI
code, so would be expected to give the same result. dev.copy2eps() is
using the postscript graphics device.

[...]

You are welcome to submit a patch, provided it has been tested on both
Windows 9X and 2000/XP, and has no performance implications on the latter.