View source: R/sampleCompute.R
computeCSC | R Documentation |
Perform Constrained Spectral Clustering from a similarity matrix computation.
computeCSC(
x,
K = 0,
K.max = 20,
mustLink = list(),
cantLink = list(),
alphas = seq(from = 0, to = 1, length = 100)
)
x |
matrix of raw data (point by line). |
K |
number of clusters. If K=0 (default), this number is automatically computed thanks to the Elbow method. |
K.max |
maximal number of clusters (K.Max=20 by default). |
mustLink |
list of ML (must-link) constrained pairs. |
cantLink |
list of CNL (cannot-link) constrained pairs. |
alphas |
numeric vector for the weight of constraints considered. |
computeCSC performs Constrained Spectral Clustering from a similarity matrix computation
res.csc results obtained from KwaySSSC algorithm.
computeSemiSupervised
, KwaySSSC
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))
tf <- tempfile()
write.table(dat, tf, sep=",", dec=".")
x <- importSample(file.features=tf)
ML=list(c(sel="10",mem="20"))
CNL=list(c(sel="1",mem="140"))
res.csc <- computeCSC(x$features$preprocessed$x, K=0, mustLink=ML, cantLink=CNL)
plot(dat[,1], dat[,2], type = "p", xlab = "x", ylab = "y",
col = res.csc$label, main = "Constrained Spectral clustering")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.