Learn R Programming

evclust (version 2.0.3)

create_MLCL: Random generation of Must-Link and Cannot-Link constraints

Description

create_MLCL randomly generates Must-Link (ML) and Cannot-Link (CL) constraints from a vector y of class labels.

Usage

create_MLCL(y, nbConst)

Value

A list with two components:

ML

Matrix of ML constraints. Each row corresponds to a constraint.

CL

Matrix of ML constraints. Each row corresponds to a constraint.

Arguments

y

Vector of class labels.

nbConst

Number of constraints.

See Also

cecm

Examples

Run this code
y<-sample(3,100,replace=TRUE)
const<-create_MLCL(y,nbConst=10)
const$ML
const$CL

Run the code above in your browser using DataLab