[R] pseudo code

elw at stderr.org elw at stderr.org
Tue Oct 9 14:34:44 CEST 2007



> Requires: T = cluster(X): A hierarchical clustering algorithm
> L = cut-tree(T; k): produces a partition with k non-singleton clusters

The functions you'll want to read the documentation to, here, are 
"hclust()" and "cutree()".  They're fairly straightforward and nicely 
documented.

It looks like you are running cutree at multiple heights of the hclust 
object to get different numbers of clusters; am I interpreting that 
correctly?

--elijah

> s(L1;L2): a similarity between two partitions
>
> 1: f = 0:8
> 2: T =cluster(X) fthe reference clustering
> 3: for i = 1 to num subsamples do
> 4: subi =subsamp(X; f) fsub-sample a fraction f of the datag
> 5: Ti=cluster(subi)
> 6: end for
> 7: for k = 2 to kmax do
> 8: L1=cut-tree(T; k) fpartition the reference clusteringg
> 9: for i = 1 to maximum iterations do
> 10: L2 =cut-tree(Ti; k)
> 11: S(i; k) = s(L2;L1) computed only on the patterns of subi.
> 12: end for
> 13: end for
>
> I am glad about any help, don't really know what to do!
> thanks, regards
> Julia
> --
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list