KwaySSSC: Semi-supervised spectral clustering

KwaySSSCR Documentation

Semi-supervised spectral clustering

Description

Perform semi-supervised spectral clustering thanks to a similarity matrix and constraints sets (according to Wacquet et al., 2013).

Usage

KwaySSSC(
  sim,
  K = 0,
  list.ML = list(),
  list.CNL = list(),
  alphas = seq(from = 0, to = 1, length = 100),
  K.max = 20
)

Arguments

sim

similarity matrix.

K

number of clusters (0 for automatic estimation).

list.ML

list of ML (must-link) constrained pairs.

list.CNL

list of CNL (cannot-link) constrained pairs.

alphas

numeric vector for the weight of constraints considered.

K.max

maximal number of clusters.

Details

KwaySSSC returns a partition obtained by semi-supervised spectral clustering (according to Wacquet et al., 2013)

Value

The function returns a list containing:

alpha

chosen alpha.

label

vector of labels.

medoids

matrix of cluster centers in the space of the K first normalized eigenvectors.

id.med

vector containing the medoids indices.

x

matrix containing, in columns, the eigenvectors of the similarity matrix.

eigen.val

vector containing the eigenvalues of the similarity matrix.

cluster.info

some statistics on each cluster.

K

number of clusters.

References

G. Wacquet, E. Poisson Caillault, D. Hamad, P.-A. Hebert, Constrained spectral embedding for K-way data clustering, Pattern Recognition Letters, 2013, 34 (9), pp.1009-1017.

See Also

computeSemiSupervised, computeCKmeans

Examples

dat <- rbind(matrix(rnorm(100, mean = 0, sd = 0.3), ncol = 2), 
           matrix(rnorm(100, mean = 2, sd = 0.3), ncol = 2), 
           matrix(rnorm(100, mean = 4, sd = 0.3), ncol = 2))
           
ML <- list()
ML[[1]] <- c(sel="10",mem="20")
ML[[2]] <- c(sel="60",mem="70")

CNL <- list()
CNL[[1]] <- c(sel="30",mem="80")
CNL[[2]] <- c(sel="90",mem="120")

sim <- computeGaussianSimilarity(dat, 1)
res <- KwaySSSC(sim, K=0, list.ML=ML, list.CNL=CNL)

plot(dat[,1], dat[,2], type = "p", xlab = "x", ylab = "y", 
col = res$label, main = "Constrained spectral clustering")


RclusTool documentation built on May 29, 2024, 5:23 a.m.