# Wireless Traffic Prediction Based on a Gradient Similarity Federated Aggregation Algorithm
## 3 Proposed Framework and Methods
### Global Aggregation Based on Gradient Similarity
In constructing the two-channel training samples using the sliding window scheme, both the temporal channel dependency length and the periodic channel dependency length were set to 3. A total of 100 rounds of communication were conducted between the local client and the central server, and the initial learning rate was set to 0.001, the local training batch size was set to 20, and 10% of the total samples were randomly selected in each round for the client samples to locally participate in the training and report the results of the last round, and had different results according to the different data sharing ratios in the shared data strategy; see Table 1. It can be seen from Table 1 that even if only 1% of the augmented data were shared, the performance of FedGSA, the method proposed in this paper, still outperformed other baseline methods in both datasets. Specifically, for the results on the Trento dataset, the present experimental algorithm (FedGSA) provides MAE and MSE gains of 10% and 16%, respectively, compared to the best performing method in the baseline (i.e., FedAvg). Similarly, for the Milano dataset, the FedGSA performance gains (MAE, MSE) are 3% and 4%, respectively. Furthermore, observing Table 1, it can be found that the prediction performance of FedGSA keeps improving with the increase in the shared enhanced data size, i.e., as shown in Figure 5a,b. This is because the initialized quasi-global model can better capture the traffic patterns when more data samples are available. Unless otherwise stated, the following experimental results in the article default to the results at \(\beta=100\%\). \begin{table}
\begin{tabular}{c c c c c} \hline \hline \multirow{2}{*}{**Methods**} & \multicolumn{2}{c}{**Trento**} & \multicolumn{2}{c}{**Milano**} \\ \cline{2-5}  & **MAE** & **MSE** & **MAE** & **MSE** \\ \hline Lasso & 1.5391 & 5.9121 & 0.5475 & 0.4380 \\ SVR & 1.0470 & 5.9080 & 0.2220 & 0.1036 \\ LSTM & 1.1193 & 4.6976 & 0.2936 & 0.1697 \\ FedAvg & 1.0668 & 4.7988 & 0.2319 & 0.1096 \\ \hline FedGS A (\(\beta=1\%\)) & 1.0455 & 4.5269 & 0.2322 & 0.1089 \\ FedGAS A (\(\beta=50\%\)) & 0.9723 & 4.2330 & 0.2285 & 0.1078 \\ FedGS A (\(\beta=100\%\)) & 0.9572 & 4.0257 & 0.2260 & 0.1054 \\ \hline Improve & \(\uparrow\)10\% & \(\uparrow\)16\% & \(\uparrow\)3\% & \(\uparrow\)4\% \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Comparison of MSE and MAE prediction performance of different methods on two datasets. To further evaluate the prediction capabilities of different algorithms, comparisons between the predicted and real network traffic values derived using different prediction algorithms for randomly selected base stations on the Trento and Milano datasets are presented in Figures 6 and 7, respectively, which include the Cumulative Distribution Function (CDF) results of the absolute prediction errors, and this experiment chooses FedAvg as the benchmark for performance comparisons because it achieves the best performance among all the baseline methods in Table 1. As can be seen in Figures 6 and 7, the FedGSA prediction capability outperforms the popular FedAvg algorithm. For the prediction error, in the Trento dataset, for example, FedGSA has about 95% errors less than 0.3, while FedAvg has about 89%, and FedGSA outperforms FedAvg in predicting the peak fluctuation of flow values. Based on the above evaluation, it can be concluded that the algorithm of this experiment can obtain more accurate prediction results than the baseline method. Figure 5: (a) describes the performance indicators on the Trento dataset; (b) describes the performance indicators on the Milano dataset. Figure 6: (a) describes the traffic comparison on the Trento dataset; (b) describes the results of the on cumulative distribution function (CDF) on the Trento dataset. ### Communication Rounds versus Prediction Accuracy

In FL or any other distributed learning framework, communication resources are often more valuable than computational resources, and fewer communications are preferred.