# Adaptive Modulation Scheme for Soft-Switching Hybrid FSO/RF Links Based on Machine Learning
## 4 Numerical Results
### Comparison of the Prediction Model with the Real Modulation Selection  
The model is trained with 80% of the data and tested for the remaining 20%. A predefined threshold of 12.05 dB is used to classify the link. The test and training sets required for the model are selected randomly from the original data to ensure that the features and patterns learned by the model on the training set can be generalized to unseen data. Figures 5-7 all indicate the results from training and testing. The modulation order decreases as the rainfall rate increases and increases as the visibility increases. However, random forests contain randomness that can lead to varied results each time they are run. Incomplete modulation may be generated if the weather values during testing do not cover the entire range of the set weather values, as shown in Figure 6.  
The case of the RF link in rainy conditions, as well as the FSO link in rainy and foggy conditions all have the same number of data points. Take the results of the FSO link in rainy conditions as an example. The total number of samples is 1346, the number of training sets is 1014, and the number of test sets is 332. Table 4 summarizes twice the results of the test set: 'Right' indicates the number of correct judgments, and 'Wrong' indicates the number of incorrect judgments. The first and second experiments are indicated by 1 and 2. The model compares the predicted results with the numerical labels in the test set and considers the prediction to be correct if they are consistent.  
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Modulation** & **Right 1** & **Wrong 1** & **Accuracy 1** & **Right 2** & **Wrong 2** & **Accuracy 2** \\ \hline
16 PPM & 3 & 1 & 75.0\% & 2 & 0 & 100.0\% \\
8 PPM & 1 & 0 & 100.0\% & 1 & 0 & 100.0\% \\ BPSK & 4 & 2 & 66.7\% & 2 & 0 & 100.0\% \\ QPSK & 1 & 3 & 25.0\% & 5 & 1 & 83.4\% \\
32 QAM & 7 & 0 & 100.0\% & 7 & 2 & 77.8\% \\
64 QAM & 3 & 1 & 75.0\% & 5 & 0 & 100\% \\
128 QAM & 10 & 1 & 90.9\% & 9 & 2 & 81.8\% \\
256 QAM & 292 & 0 & 100.0\% & 293 & 0 & 100\% \\ Outage & 1 & 2 & 33.3\% & 2 & 1 & 66.7\% \\ \hline \hline \end{tabular}
\end{table}
Table 4: The correctness rate of test sets from FSO link.  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Modulation** & **FSO-Rain** & **FSO-Fog** \\ \hline Interrupt & \(\leq\)38.158 & \(\leq\)34.914 \\
16 PPM & 38.158\(\sim\)40.424 & 34.914\(\sim\)37.091 \\
8 PPM & 40.424\(\sim\)41.227 & 37.091\(\sim\)37.860 \\ BPSK & 41.227\(\sim\)42.798 & 37.860\(\sim\)39.249 \\ QPSK & 42.798\(\sim\)43.829 & 39.249\(\sim\)40.178 \\
32 QAM & 43.829\(\sim\)45.068 & 40.178\(\sim\)41.795 \\
64 QAM & 45.068\(\sim\)45.801 & 41.795\(\sim\)42.722 \\
128 QAM & 45.801\(\sim\)47.065 & 42.722\(\sim\)43.929 \\
256 QAM & \(\geq\)47.065 & \(\geq\)43.929 \\ \hline \hline \end{tabular}
\end{table}
Table 2: The range of LB threshold of FSO link.  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Modulation** & **RF-Rain** \\ \hline Interrupt & \(\leq\)35.313 \\ BPSK & 35.313\(\sim\)38.091 \\ QPSK & 38.091\(\sim\)38.517 \\
16 QAM & 38.517\(\sim\)40.378 \\
32 QAM & 40.378\(\sim\)42.456 \\
64 QAM & 42.456\(\sim\)44.554 \\
128 QAM & 44.554\(\sim\)46.849 \\
256 QAM & \(\geq\)46.849 \\ \hline \hline \end{tabular}
\end{table}
Table 3: The range of LB threshold of RF link.