## 3 Materials and Methods
### Methods
#### 3.2.2 Components Extraction by Clustering  
We integrate multiple IMFs for the first time by clustering. We hope to extract three components from the original time series: trend component, periodic component and essential component. Trend component has the smallest entropy, and the trend component represents the overall growth or decline trend of the data. The essential component is the main content of wireless network data. The purpose of communication is to transmit the uncertainty of information. Therefore, wireless network data, especially traffic data, has strong randomness, so the entropy of essential component is the highest. The periodic component depends on the tidal characteristic of cellular traffic and has a certain law. The information entropy of the periodic component is between the essential component and the trend component. For any IMF \(c_{n}\), the information entropy is obtained by function 7. Where \(P(c_{n}(t))\) is probability of \(c_{n}(t)\).  
\[H(c_{n})=-\sum_{t}P(c_{n}(t))log_{2}(P(c_{n}(t))) \tag{7}\]  
At the same time, we notice that the frequencies of different components are also different. The trend component is low-frequency, the essential component has the highest frequency due to high randomness, and the periodic component is also between the two. Based on the principle of filter, we choose the number of peak points in the spectrum as the quantization index of frequency. For each IMF, the number of spectral peaks was obtained. We can first calculate the corresponding modulus through Fourier transform as shown in Functions (8) and (9), and then count the number of extreme points.  
\[F_{n}(\omega)=\int c_{n}(t)^{-i\omega t}dt \tag{8}\]  
\[F_{n}(\omega)=|F_{n}(\omega)| \tag{9}\]  
In order to realize the adaptive ability of clustering algorithm for three components of different base station data and ensure the accuracy of clustering, KNN method was selected to classify the scatter points (information entropy, peak number of spectrum), as shown in Figure 4.  
The coordinate points based on the number of peaks and information entropy in KNN are expressed as: \((I,P)\), where \(I\) represents the information entropy and \(P\) represents the number of peaks in the spectrum. The distance between two points was defined as Formula (10). Algorithm 1 presented components clustering process based on KNN. In Algorithm 1, the value of \(K\) was set to 3, and three components are extracted: trend component \(C_{T}\), periodic component \(C_{P}\) and essential component \(C_{E}\).  
\[\rho=\sqrt{\left(I_{i}-I_{j}\right)^{2}+\left(P_{i}-P_{j}\right)^{2}} \tag{10}\]  
```
1:INPUT:\(c_{i}\) and \(K=3\)
2:Stage 1 Coordinate generation
3:for\(i=1:n\)do
4: Information entropy calculation for \(c_{i}\) according to Function (7) and save the result in metric \(I\).
5: Count peak number \(P_{i}\) according to Functiona (8) and (9) and save the result in metric \(P\).
6:endfor
7:Stage 2 Clustering based on KNN
8:for\(i=1:n\)do
9:for\(j=1:n\)do
10:\(\forall I_{i}\in I,I_{j}\in I,P_{i}\in P,P_{j}\in P\).
11: Distance calculation between \((I_{i},P_{i})\) and \(\left(I_{j},P_{j}\right)\) according to Function (10).
12:endfor
13:endfor
14: Sort the distance in ascending order.
15: Select \(K\) points with the smallest distance from the current point.
16: Determine the occurrence frequency of the category where the first \(K\) points are located.
17: Return the category with the highest frequency of the first \(K\) points as the classification result of current point.
18: Merge time series of the same class.
19:OUTPUT:\(C_{T}\), \(C_{P}\) and \(C_{E}\).
```  
**Algorithm 1** Components Clustering.  
Figure 4: Data processing for KNN based clustering.