cltoSim function

Compute Similarity Matrix for a Clustering and vice versa

Compute Similarity Matrix for a Clustering and vice versa

A similarity matrix is a symmetric matrix whose entry [i,j][i,j] is 1 if observation i

and j are in the same cluster and 0 otherwise.

cltoSim(cl) Simtocl(Sim)

Arguments

  • cl: vector of cluster memberships
  • Sim: similarity matrix

Warning

Simtocl does not check whether Sim is a valid similarity matrix, e.g. that Sim[i,j]==1 if Sim[i,k]==1 and Sim[j,k]==1.

Author(s)

Arno Fritsch, arno.fritsch@tu-dortmund.de

See Also

comp.psm for an average similarity matrix.

Examples

cl <- c(3,3,1,2,2) (Sim <- cltoSim(cl)) Simtocl(Sim) # not a valid similarity matrix (Sim2 <- matrix(c(1,0,1,0,1,1,1,1,1), ncol=3)) Simtocl(Sim2) # no warning
  • Maintainer: Arno Fritsch
  • License: GPL (>= 2)
  • Last published: 2022-05-02

Useful links