clusterSim: Cluster Similarity Matrix

Description Usage Arguments Details Author(s) References Examples

Description

Returns a matrix of cluster similarities. Currently two methods for computing similarities of clusters are implemented, see details below.

Usage

1
2
3
4
5
6
## S4 method for signature 'kcca'
clusterSim(object, data=NULL, method=c("shadow", "centers"), 
           symmetric=FALSE, ...)
## S4 method for signature 'kccasimple'
clusterSim(object, data=NULL, method=c("shadow", "centers"), 
           symmetric=FALSE, ...)

Arguments

object

Fitted object.

data

Data to use for computation of the shadow values. If the cluster object x was created with save.data=TRUE, then these are used by default. Ignored if method="centers".

method

Type of similarities, see details below.

symmetric

Compute symmetric or asymmetric shadow values? Ignored if method="centers".

...

Currently not used.

Details

If method="shadow" (the default), then the similarity of two clusters is proportional to the number of points in a cluster, where the centroid of the other cluster is second-closest. See Leisch (2006, 2008) for detailed formulas.

If method="centers", then first the pairwise distances between all centroids are computed and rescaled to [0,1]. The similarity between tow clusters is then simply 1 minus the rescaled distance.

Author(s)

Friedrich Leisch

References

Friedrich Leisch. A Toolbox for K-Centroids Cluster Analysis. Computational Statistics and Data Analysis, 51 (2), 526–544, 2006.

Friedrich Leisch. Visualizing cluster analysis and finite mixture models. In Chun houh Chen, Wolfgang Haerdle, and Antony Unwin, editors, Handbook of Data Visualization, Springer Handbooks of Computational Statistics. Springer Verlag, 2008.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
example(Nclus)

clusterSim(cl)
clusterSim(cl, symmetric=TRUE)

## should have similar structure but will be numerically different:
clusterSim(cl, symmetric=TRUE, data=Nclus[sample(1:550, 200),])

## different concept of cluster similarity
clusterSim(cl, method="centers")

Example output

Loading required package: grid
Loading required package: lattice
Loading required package: modeltools
Loading required package: stats4

Nclus> data(Nclus)

Nclus> cl <- cclust(Nclus, k=4, simple=FALSE, save.data=TRUE)

Nclus> plot(cl)
           [,1]      [,2]      [,3]       [,4]
[1,] 1.00000000 0.2042213 0.0000000 0.19280900
[2,] 0.01478760 1.0000000 0.1487398 0.19627858
[3,] 0.00000000 0.3847919 1.0000000 0.01290624
[4,] 0.09947397 0.2886216 0.0000000 1.00000000
          [,1]      [,2]        [,3]        [,4]
[1,] 1.0000000 0.1095044 0.000000000 0.146141487
[2,] 0.1095044 1.0000000 0.266765871 0.242450084
[3,] 0.0000000 0.2667659 1.000000000 0.006453119
[4,] 0.1461415 0.2424501 0.006453119 1.000000000
           [,1]       [,2]       [,3]       [,4]
[1,] 1.00000000 0.09754329 0.00000000 0.12319252
[2,] 0.09754329 1.00000000 0.26938067 0.25971653
[3,] 0.00000000 0.26938067 1.00000000 0.01709205
[4,] 0.12319252 0.25971653 0.01709205 1.00000000
          [,1]      [,2]      [,3]      [,4]
[1,] 1.0000000 0.4523207 0.0000000 0.4549684
[2,] 0.4523207 1.0000000 0.5178650 0.5268685
[3,] 0.0000000 0.5178650 1.0000000 0.3349004
[4,] 0.4549684 0.5268685 0.3349004 1.0000000

flexclust documentation built on May 2, 2019, 10:59 a.m.