[R] Silhouette question

Martin Maechler maechler at stat.math.ethz.ch
Sat Jun 21 16:45:41 CEST 2003


>>>>> "BDR" == Prof Brian Ripley <ripley at stats.ox.ac.uk>
>>>>>     on Sat, 21 Jun 2003 06:44:00 +0100 (BST) writes:

    BDR> ?try is your friend here. 

Yes, but Jonck's real problem is the use of an outdated version
of the cluster package (yes: "package",  *not* "library").

Which proves that he is certainly *not* using R 1.7.1.
While I strongly recommend, Jonck, that you upgrade your R
installation and get a new cluster `for free',
in this case it would also suffice to work with
update.packages()

Martin Maechler <maechler at stat.math.ethz.ch>	http://stat.ethz.ch/~maechler/
Seminar fuer Statistik, ETH-Zentrum  LEO C16	Leonhardstr. 27
ETH (Federal Inst. Technology)	8092 Zurich	SWITZERLAND
phone: x-41-1-632-3408		fax: ...-1228			<><


    >> Hi all, I am momentarily experimenting with Silhouette
    >> from the cluster library but I am getting some
    >> errors. Since Silhouette can be seen as a quality measure
    >> for a clustering what I want to do is run a series of
    >> different clusterings and store the one with the highest
    >> Silhouette value. In that way I hope to get "the best"
    >> clustering possible for my dataset.  Here is the problem:
    >> When running the examples that come with silhouette,
    >> everything works fine, the silhouette values are
    >> calculated perfectly. When I try to run silhouette with
    >> my own dataset I get errors at unpredictable times, that
    >> is, sometimes silhouette runs succesfully and at other
    >> times it gives me the following error: > test <-
    >> silhouette(cutree(agn, k=5), daisy(bestSom$codes)) Error
    >> in apply(dmatrix[!iC, iC], 2, function(r) tapply(r,
    >> x[!iC], mean)) : dim(X) must have a positive length
    >> 
    >> Since I am running my experiments in batch mode (put a
    >> loop of experiments in a source file and then load this
    >> source file), whenever this error occurs the entire
    >> experiment is cut off. The experiment takes rather a long
    >> time (approx. 12 hours), so I would not want to start my
    >> experiment at night only to find in the morning that my
    >> experiment never ran. Is there a way to a) prevent the
    >> error from happening, or b) detect beforehand that the
    >> error will happen and thus not do the silhouette
    >> calculation for that particular clustering
    >> 
    >> Any help with this is much appreciated, thanks, Jonck
    >> 
    >> ______________________________________________
    >> R-help at stat.math.ethz.ch mailing list
    >> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
    >> 

    BDR> -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of
    BDR> Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
    BDR> University of Oxford, Tel: +44 1865 272861 (self) 1
    BDR> South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG,
    BDR> UK Fax: +44 1865 272595

    BDR> ______________________________________________
    BDR> R-help at stat.math.ethz.ch mailing list
    BDR> https://www.stat.math.ethz.ch/mailman/listinfo/r-help




More information about the R-help mailing list