Hi All, For the function "bclust"(e1071), the argument "base.method" is explained as "must be the name of a partitioning cluster function returning a list with the same components as the return value of 'kmeans'. In my understanding, there are three partitioning cluster functions in R, which are "clara, pam, fanny". Then I check each of them to see which of them can get same components as the return value of "kmeans", by using the following codes:>x <- rbind(matrix(rnorm(100, sd = 0.3), ncol = 2),matrix(rnorm(100, mean = 1, sd = 0.3), ncol = 2))>cl <- kmeans(x, 2)>cl.clara<-clara(x,2)>cl.pam<-pam(x,2)>cl.fanny<-fanny(x,2)But it seems like none of them have exactly the same components as "kmeans" (Please see "P.S."). Could you please help me clearify which methods included in the argument "base.method"? Thank you! P.S.: For example "clara": Medoids: Objective function: Clustering vector: Cluster sizes: Best sample: Available components: [1] "sample" "medoids" "i.med" "clustering" "objective" "clusinfo" "diss" [8] "call" "silinfo" "data" But "kmeans" has: K-means clustering with 2 clusters of sizes 50, 50 Cluster means: Clustering vector: Within cluster sum of squares by cluster: Available components: [1] "cluster" "centers" "withinss" "size" [[alternative HTML version deleted]]
Friedrich.Leisch at tuwien.ac.at
2006-Apr-07 07:50 UTC
[R] "partitioning cluster function"
>>>>> On Wed, 5 Apr 2006 12:58:00 -0700, >>>>> Linda Lei (LL) wrote:> Hi All, > For the function "bclust"(e1071), the argument "base.method" is > explained as "must be the name of a partitioning cluster function > returning a list with the same components as the return value of > 'kmeans'. > In my understanding, there are three partitioning cluster functions in > R, which are "clara, pam, fanny". Then I check each of them to see which > of them can get same components as the return value of "kmeans", by > using the following codes: The functions in the cluster package will not work, because they have different interface (names of arguments and return values). cclust from the package of the same name can be used together with kmeans, but note that that is no longer actively maintained (see my email to r-help from a few minutes ago). Best, Fritz -- ----------------------------------------------------------------------- Prof. Dr. Friedrich Leisch Institut f?r Statistik Tel: (+49 89) 2180 3165 Ludwig-Maximilians-Universit?t Fax: (+49 89) 2180 5308 Ludwigstra?e 33 D-80539 M?nchen http://www.ci.tuwien.ac.at/~leisch