## 4 Simulation Results
### Applications of the SL Algorithms  
The next step is to apply the SL algorithms and train them using the training data from the PCA dataset. Later, it is imperative to divide the data, train and validate the algorithms, and test and validate the model. As a reminder, for the validation scenario and to simulate the proposed system, we used SL algorithms: DT, RF (with five trees), SVM (with a linear kernel), KNN (with K = 3), and MLPC, using the Python language and the Anaconda Navigator platform with Jupyter Notebook as IDE. We considered nine essential 5G services to be classified: ultra-high-definition (UHD) video streaming, immersive experience, connected vehicles, e-health, industry automation, video surveillance, smart grid, intelligent transport systems (ITS), and voice over 5G (Vo5G). In this article, we used the same performance evaluation metrics of the model (accuracy, precision, recall, F1 score, and MCC) obtained from the confusion matrix. The dataset had dimensions of 165 \(\times\) 10, where the first nine columns represented the principal component, and the last contained the labels of the services. We divided the database into two parts, where 80% (132) of the data (Xtrain) to train the algorithms was created and once trained, generated the predictive model. We used the remaining 20% (Xtest) to test the model. The models may be prone to underfitting or overfitting, meaning that they will work perfectly for the training data (Xtrain) that are already known, but their accuracy may be lower for new services (Xtest). According to [16], there are two possible approaches to avoiding overfitting: increasing the volume of the database; or reserving additional data by dividing the dataset into three parts (training, validation, and testing). Increasing the amount of data was difficult because there were insufficient known data from the 5G service; hence, additional data were reserved, the K-Folds cross-validation technique was applied using K = 10 [17], and we obtained the results shown in Table 4. All the data formed part of the original PCA dataset and did not constitute three new datasets. Figure 3 shows the confusion matrices obtained during the testing process for each model in the simulation. The main diagonal shows the number of correct predictions the predictive model makes. Values outside the main diagonal represent wrong predictions. Then, we applied Equations (1)-(5) of the metrics obtained from the confusion matrix to evaluate the performance of the predictive models. Table 5 shows the results. \begin{table}
\begin{tabular}{c c} \hline \hline
**SL Algorithms** & **K-Folds (K = 10) Cross-Validation Results** \\ \hline DT & 77.31 \\ RF & 78.79 \\ SVM & 68.90 \\ KNN & 81.87 \\ MLPC & 90.16 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Results of the accuracy in cross-validation stage for the simulation. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**SL Algorithms** & **Accuracy** & **Precision** & **Recall Macro** & **F1 Score** & **MCC (\%)** \\  & **(\%)** & **Macro (\%)** & **(\%)** & **Macro (\%)** & **MCC (\%)** \\ \hline DT & 81.8 & 81.7 & 86.8 & 82.4 & 79.6 \\ RF & 78.8 & 80.4 & 81.4 & 79.5 & 75.9 \\ SVM & 78.8 & 75.9 & 79.6 & 73.7 & 77.5 \\ KNN & 90.9 & 93.7 & 92.2 & 91.9 & 89.8 \\ MLPC & 90.9 & 93.1 & 92.2 & 92.1 & 89.5 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Model metric results for the simulation. Table 5 shows that for the DT and RF models, after applying PCA, the values of the performance metrics decreased considerably. This decrement could be because the data now have fewer features, many even with negative values, and a slight change in the dataset can make the tree structure unstable, which can cause variance [10]. KNN and MLPC are the ones that provide the best results. However, when analyzing the results of the cross-validation metrics, the KNN model could not have learned better or presented an underfitting.