Skip to main content
. 2020 Mar 6;20(5):1457. doi: 10.3390/s20051457
Algorithm 3: SelectK
Input:  Ar{a1,a2…an}, a set of activity
        num, number of active classes
Output:k, Optimal k value
1. Val←Ø//
2. Cal←Ø//
3. k←Ø
4. TimegetTime(Ar)//filter out bt and et
5. for each n in range(1, num):
6.    estimatorKMeans(clusters=n)//constructing a cluster
7.    estimator.fit(Time)//fitting the data
8.    ValgetSSE(estimator)//get SSE value
9.    Cal←◡{(n, Val)}
10. end for
11. kgetCur(Cal)//Get k with highest curvature
12. return k