measureConstraintsOk: Rates of constraints satisfaction

View source: R/codeSSSC.R

measureConstraintsOkR Documentation

Rates of constraints satisfaction

Description

Calculate the rates of ML and CNL constraints satisfaction in a clustering result.

Usage

measureConstraintsOk(label, list.ML = list(), list.CNL = list())

Arguments

label

vector of labels.

list.ML

list of ML (must-link) constrained pairs.

list.CNL

list of CNL (cannot-link) constrained pairs.

Details

measureConstraintsOk returns the rates of constraints satisfaction

Value

The function returns a list containing:

ML

rate of ML (must-link) constraints satisfaction.

CNL

rate of CNL (cannot-link) constraints satisfaction.

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)

measureConstraintsOk(res$label, list.ML=ML, list.CNL=CNL)


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