Research Article
A Unified Framework for Behaviour Monitoring and Abnormality Detection for Smart Home
Algorithm 1
Algorithm for X-means clustering.
(1) Set the maximum number of clusters to be . | |
(2) Repeat the steps (3) to (6) for k0 =2 to | |
(3) For K=k0 apply K-means clustering | |
(4) Label the divided clusters as C1,C2,C3… | |
(5) Repeat the steps (4.a) to (4.c) for | |
(5.a) For every cluster , generate two new centroids | |
from original centroid | |
(by transforming the initial value of centroid in | |
two different directions along a randomly chosen | |
value of vector by an amount equals to their | |
cluster size.) | |
(5.b) Apply K means with K=2. Label the divided | |
clusters , | |
(5.c) Apply the model selection test BIC to check if two | |
clusters better than original single cluster in each | |
case. Replace each centroid based on the criteria | |
of model selection. | |
Where p - no. of observations, k - clusters and - log probability. | |
(5.d) Let BIC_C represents –score of children clusters | |
and BIC_P –score of parent cluster | |
(5.e) If BIC_C>BIC_P, the two-divided clusters are | |
accepted, and the division is continued; | |
(5.f) If BIC_C<BIC_P the two-divided clusters are | |
discarded, and the original cluster is kept; | |
(6) If the condition of convergence is not fulfilled, go to | |
Step (2). Otherwise, Stop. |