buildConstraintsMatrix | R Documentation |
Compute the constraints matrix C, based on ML and CNL sets.
buildConstraintsMatrix(n, list.ML = list(), list.CNL = list())
n |
total number of observations. |
list.ML |
list of ML (must-link) constrained pairs. |
list.CNL |
list of CNL (cannot-link) constrained pairs. |
buildConstraintsMatrix generate constraints matrix, based on ML and CNL sets
C constraints matrix (with 1 for must-link and -1 for cannot-link).
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") C <- buildConstraintsMatrix(n=nrow(dat), list.ML=ML, list.CNL=CNL)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.