Skip to main content
. 2018 Jun 6;18(6):1850. doi: 10.3390/s18061850
Algorithm 1 Training phase
Input: raw dataset without annotation Y={yi|i=1,,M}, prelabeled dataset Xp={xip|i=1,,N}, Cp={ckp|k=1,,K}, Skp={xjSkp|j=1,,nSk}, max iterations T, nearest neighbor number k, outlier threshold ε1
Output: personalized MGD models p1(x), p2(x), and p3(x)
  1. Preprocess the dataset Y={yi|i=1,,M} through the Butterworth low-pass filter and dividing by sensitivity coefficient k.

  2. Segment the data into overlapping windows.

  3. Extract the features and normalization.

  4. Save the results from step 1 and step 2 as X={xi|i=1,,M}.

  5. Initialize K-Means clustering centroids ck0 by Equation (3).

  6. For t = 1 to T do the following:

  7.  Assign samples that belong to the kth cluster Sk by Equation (4).

  8.  Update kth centroids ck(t+1) by Equation (5).

  9.  If there is no change in the assignment step

  10.   break

  11.  end if

  12. end for

  13. For i = 1 to M do the following:

  14. scorei=LLOF(xi), xiX

  15.  if scorei>ε1

  16.   remove xi from X

  17.  end if

  18. end for

  19. Using Equation (9) and (10), compute μ1, Σ1 by the LIA cluster S1={xJS1|j=1,,mS1}, compute μ2, Σ2 by the MIA cluster S2={xjS2|j=1,,mS2}, and compute μ3, Σ3 by the VIA cluster S3={xjS3|j=1,,mS3}.

  20. Establish the personalized MGD models: p1(x)=1(2π)n2| Σ1|12exp(12(xμ1)T Σ31(xμ1)), p2(x)=1(2π)n2|Σ2|12exp(12(xμ2)TΣ21(xμ2)), and p3(x)=1(2π)n2| Σ3|12exp(12(xμ3)T Σ31(xμ3))