# Can We Exploit Machine Learning to Predict Congestion over mmWave 5G Channels?
## 6 Learning Analysis
### Multi-Level Classification  
As mentioned before, the multi-level classification for the different algorithms has been configured for 4 congestion states: the higher the state, the higher the congestion. To simplify the comparison of the different solutions, we have defined a pseudo-precision metric that penalizes how far the predicted level is from the real one. The reasoning behind this metric is establishing a practical means to measure the error of the predicted value. For instance, in a situation where the actual congestion state is \(1\) (low congestion), predicting a state 4 (highest congestion) is considered to be a worse result than predicting state 2. This pseudo-precision parameter is defined in Equation (2):  
\[\text{pseudo-Prec}=\sum_{i\in\mathcal{S}}\frac{1}{S_{i}}\left(P_{i}+\sum_{j \in\mathcal{S}/i}\frac{P_{j}}{2^{|i-j|}}\right) \tag{2}\]  
where \(\mathcal{S}\) is the set of congestion levels. Then, \(S_{i}\) and \(P_{i}\) are the actual and predicted set of samples for state \(i\), respectively. This way, for each congestion level \(j\) different to the actual one, the contribution of the predicted samples to the precision decreases exponentially as the predicted level is further from the real one. For instance, defining 4 levels the contribution of level 2 to the pseudo-precision metric is defined in Equation (3)  
\[\text{pseudo-Prec}_{2}=\frac{P_{2}+0.5\cdot(P_{1}+P_{3})+0.25\cdot P_{4}}{S_ {2}} \tag{3}\]  
so that when all the predicted values are correct (i.e., \(S_{2}=P_{2}\)), the precision reaches 1. Although more accurate metrics could be used, this one allows us to compare the performance of the different multi-level congestion learning approaches.  
First, Figure 10 shows the confusion matrix of the results obtained with the hierarchical clustering. It illustrates the behavior of the algorithm that would be otherwise overlooked using the pseudo-precision metric. As can be observed, while the congestion detection probability, which corresponds to the diagonal elements, is rather high, the prediction concentrates in the closed-by states. For instance, the first congestion level \(l_{1}\) is correctly predicted with probability 0.6. However, wrong predictions concentrate in the second level (\(l_{2}\)) and, with less probability, in the third level (\(l_{3}\)), while the highest congestion level is never predicted. Similar trends are observed for the other levels. Interestingly, in the case of the highest congestion, \(l_{4}\), the correct detection probability is much higher, reaching 0.8.  
Then, Figure 11 depicts the pseudo-precision observed for the different algorithms. We show the performance obtained for all the scenarios, but those with short distances between user and base  
Figure 10: Confusion matrix of the hierarchical clustering for a scenario with data rate of 30 Mbps and distance of 40 m.  
station, for which the performance is very poor, due to the extremely low correlation that was discussed in previous sections. We note that in the case of the RNN algorithm, results could not be obtained for data rates higher than 200 Mbps, since the algorithm did not converge. The analysis of this behavior and other neural-network models will be tackled in our future work.  
As a general comment, we can observe that for the scenarios that we consider, the distance does not have a strong impact over the pseudo-precision metric. On the other hand, the results also yield a clear relationship between such precision and the data rate. In fact, as the application data rate increases, the precision clearly decreases.  
In addition, we can observe that the hierarchical _k-means_ performance is higher than that obtained with the HMM and RNN solutions. In turn, the algorithm based on Hidden Markov Chains slightly outperforms that based on neural networks. Finally, as was expected, the supervised solution outperforms the other options, and shows a much more stable behavior as we increase the data rate.