An Efficient Automatic Gait Anomaly Detection Method Based on Semisupervised Clustering

Algorithm 1

The pseudocodes of the COP-K-means algorithm.

Algorithm: COP-K-Means

Input: (1) Dataset .

(2) Must-link constraints ML and cannot-link constraints CL.

(3)Number of clusters K.

Output: disjoint K partitioning of the dataset X.

Method:

1. Let C_{1}…C_{k} be the initial cluster center.

2. For each point x_{i} of X, assign it to the closest cluster C_{j} such that CONSTRAINTS-VIOLATE-CHECK (x_{i}, C_{j}, ML, CL) is false. If no such cluster exists, return {}.

3. For each cluster C_{j}, its center is updated by averaging all the data points that have been placed in it.

4. Iterate between step 2 and step 3 until the algorithm convergence.

5. Return disjoint K partitioning of the dataset X.

Algorithm: CONSTRAINTS-VIOLATE-CHECK

Input: (1) Data point x_{i}.

(2) Cluster C_{j}.

(3) Must-link constraints ML and cannot-link constraints CL.

Output: constraints is violated or not.

1. For each (x_{i}, x_{l}) ∈ ML: if x_{l} ∉ C_{j}, return true.

2. For each (x_{i}, x_{l}) ∈ CL: if x_{l} ∈ C_{j}, return true.