ckmeans: COP K-means algorithm

Description Usage Arguments Details Value Note Author(s) References See Also Examples

Description

This function takes an unlabeled dataset and two lists of must-link and cannot-link constraints as input and produce a clustering as output.

Usage

1
ckmeans(data, k, mustLink, cantLink, maxIter = 100)

Arguments

data

The unlabeled dataset.

k

Number of clusters.

mustLink

A list of must-link constraints

cantLink

A list of cannot-link constraints

maxIter

Number of iteration

Details

This algorithm produces a clustering that satisfies all given constraints.

Value

A vector that represents the labels (clusters) of the data points

Note

The constraints should be consistent in order for the algorithm to work.

Author(s)

Tran Khanh Hiep Nguyen Minh Duc

References

Wagstaff, Cardie, Rogers, Schrodl (2001), Constrained K-means Clustering with Background Knowledge

See Also

Wagstaff, Cardie, Rogers, Schrodl (2001), Constrained K-means Clustering with Background Knowledge

Examples

1
2
3
4
5
6
data = matrix(c(0, 1, 1, 0, 0, 0, 1, 1), nrow = 4)
mustLink = matrix(c(1, 2), nrow = 1)
cantLink = matrix(c(1, 4), nrow = 1)
k = 2
pred = ckmeans(data, k, mustLink, cantLink)
pred

Example output

[1] 1 1 2 2

conclust documentation built on May 2, 2019, 1:07 p.m.