Description Usage Arguments Details Value Author(s) See Also Examples
Perform consensus clustering
1 2 |
diss |
A dissimilarity matris as returned by, for example, |
cluster |
A clustering function that takes 2 arguments: |
subsample |
The subsampling proportion. Defaults to |
K |
The maximum number of clusters to identify. All values between 2
and |
R |
The number of random subsamples to run. Defaults to |
verbose |
Whether to report progress. Defaults to |
ncores |
The number of cores to use. Defaults to |
R random subsamples (or bootstrap samples if subsample = 1
) are
taken from the dissimilarity matrix, and clustering is performed for each value
of k = 2, ..., K. For each value of k, the consensus matrix is computed; each
entry (i, j) represents the average number of times items i and j were in the same
cluster. As such, each element of M is on [0, 1], with 0 or 1 representing perfect
consensus. If items of the concensus matrix are arranged according to cluster
membership, perfect consensus would be represented by a block diagonal form with
blocks full of 1s surrounded by 0s.
An object of class ‘conclus’. It contains:
call |
the function call; |
M |
a list, with one element for each k in 2:K, representing the consensus matrices; |
membership |
a matrix with one column, for each k in 2:K, representing the cluster memberships; |
K |
the values of k in 2:K; |
cluster |
the function used to perform the clustering on the subsamples. |
Harry Southworth
pamCons
, summary.conclus
, representatives
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | # The pluton data
cc <- conclus(dist(pluton), K=7) # default PAM clustering
ggplot(cc)
ggplot(summary(cc))
# Do the Gaussian3 and Unform1 examples from Monti et al
# First, they used average linkage, so define a new function
aveHclustCons <- function(x, k){
stats::cutree(hclust(x, method="average"), k)
}
# Now pass it into conclus with the Gaussian3 data
ccg <- conclus(daisy(Gaussian3), K=6, cluster=aveHclustCons, subsample=.8, R=500, ncores=7)
ggplot(ccg, low="white", high="red")
s <- summary(ccg)
s
ggplot(s)
# Those are similar to Figures 2 and 3. Do the missing histogram
hist(ccg$M[[2]], col="red")
# Now Uniform 1
ccu <- conclus(daisy(Uniform1), K=6, cluster=aveHclustCons, subsample=.8, R=500, ncores=7)
ggplot(ccu, low="white", high="red")
su <- summary(ccu)
su
ggplot(su)
hist(c(ccu$M[[2]]), col="green")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.