cl_ensemble: Cluster Ensembles

Description Usage Arguments Details Value Examples

View source: R/ensemble.R

Description

Creation and manipulation of cluster ensembles.

Usage

1
2
3

Arguments

...

R objects representing clusterings of or dissimilarities between the same objects.

list

a list of R objects as in ....

x

for as.cl_ensemble, an R object as in ...; for is.cl_ensemble, an arbitrary R object.

Details

cl_ensemble creates “cluster ensembles”, which are realized as lists of clusterings (or dissimilarities) with additional class information, always inheriting from "cl_ensemble". All elements of the ensemble must have the same number of objects.

If all elements are partitions, the ensemble has class "cl_partition_ensemble"; if all elements are dendrograms, it has class "cl_dendrogram_ensemble" and inherits from "cl_hierarchy_ensemble"; if all elements are hierarchies (but not always dendrograms), it has class "cl_hierarchy_ensemble". Note that empty or “mixed” ensembles cannot be categorized according to the kind of elements they contain, and hence only have class "cl_ensemble".

The list representation makes it possible to use lapply for computations on the individual clusterings in (i.e., the components of) a cluster ensemble.

Available methods for cluster ensembles include those for subscripting, c, rep, and print. There is also a plot method for ensembles for which all elements can be plotted (currently, additive trees, dendrograms and ultrametrics).

Value

cl_ensemble returns a list of the given clusterings or dissimilarities, with additional class information (see Details).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
d <- dist(USArrests)
hclust_methods <-
    c("ward", "single", "complete", "average", "mcquitty")
hclust_results <- lapply(hclust_methods, function(m) hclust(d, m))
names(hclust_results) <- hclust_methods 
## Now create an ensemble from the results.
hens <- cl_ensemble(list = hclust_results)
hens
## Subscripting.
hens[1 : 3]
## Replication.
rep(hens, 3)
## Plotting.
plot(hens, main = names(hens))
## And continue to analyze the ensemble, e.g.
round(cl_dissimilarity(hens, method = "gamma"), 4)

Example output

The "ward" method has been renamed to "ward.D"; note new "ward.D2"
An ensemble of 5 dendrograms of 50 objects.
An ensemble of 3 dendrograms of 50 objects.
An ensemble of 15 dendrograms of 50 objects.
Dissimilarities using rate of inversions:
           ward single complete average
single   0.1284                        
complete 0.0274 0.1258                 
average  0.0238 0.1192   0.0097        
mcquitty 0.0225 0.1154   0.0134  0.0082

clue documentation built on April 23, 2018, 5:04 p.m.