Calculate the rates of ML and CNL constraints satisfaction in a clustering result.
measureConstraintsOk(label, list.ML = list(), list.CNL = list())
The function returns a list containing:
rate of ML (must-link) constraints satisfaction.
rate of CNL (cannot-link) constraints satisfaction.
vector of labels.
list of ML (must-link) constrained pairs.
list of CNL (cannot-link) constrained pairs.
measureConstraintsOk returns the rates of constraints satisfaction
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)
measureConstraintsOk(res$label, list.ML=ML, list.CNL=CNL)
Run the code above in your browser using DataLab