# 5G/B5G Service Classification Using Supervised Learning
## 3 5G/B5G Service System Classifier Proposed
### Validation of the Predictive Model  
To validate the predictive model, it is necessary to determine whether the values obtained for \(Y\) are the expected ones. The use of metrics to measure performance can allow us to confirm the effectiveness of the model. The relationship between _Ytest_ and \(Y\) is used to generate the performance measures, and to construct the confusion matrix shown in Table 2.  
A confusion matrix is so named because it visualizes the performance of the predictive model and observes confusion in two labels. The columns of the matrix represent the number of predictions for each label (_Y_) made by the predictive model, while each row represents the current label for the test values (_Ytest_) as follows: [28]  
* True Positives: The number of current values classified as belonging to a particular class, for which the model's prediction is correct. * False Positives: These are the current values classified as belonging to an incorrect class. They are considered by the model to be positive, but the prediction is wrong. * False Negatives: These are values that belong to a particular class but are classified differently (incorrect prediction). * True Negatives: These are observations that do not belong to a given class and are classified correctly. A series of metrics can be derived from the results in the confusion matrix of Table 2 and used to evaluate performance of the predictive model as follows: [29]  
1. Accuracy: This is the relationship between the number of correct predictions (TP and TN results) made by the model and the total number of predictions. In other words, this reflects how often the predictive model's classification is correct. It is the most direct measure of the quality of the classification, although it is less appropriate when the labels of the output variables are not balanced (unbalanced data), i.e., labels are not of similar quantities. \[Accuracy=\frac{TP+TN}{TP+FP+TN+FN}\] (1)
2. Precision: This measures the precision with which the predictive model ranks services by their performance due to optimistic predictions. It is the relationship between the number of correct predictions and the total number of correctly predicted predictions. \[Precision=\frac{TP}{TP+FP}\] (2)
3. Recall: This is the relationship between the number of correct predictions to the total number of positive predictions. In other words, it represents the sensitivity of the predictive model in terms of detecting positive instances. \[Recall=\frac{TP}{TP+FN}\] (3)
4. F1 score: This is a weighted average of the recall and precision. A higher score represents a better model. Thus, it provides a good indicator of the overall accuracy of the predictive model, while the accuracy and recall provide information on explicit areas. \[F1\ score=\frac{2\times Precision\times recall}{Precision+recall}\] (4)
5. Matthews correlation coefficient (MCC): As an alternative measure unaffected by the unbalanced datasets issue, MCC is the only binary classification rate that generates \begin{table}
\begin{tabular}{c c c c} \hline \hline  & \multicolumn{2}{c}{**Prediction (_Y_)**} \\ \hline  & & **Positive** & **Negative** \\ \cline{2-4} Current (_Ytest_) & Positive & True Positives (TP) & False Negatives (FN) \\ \cline{2-4}  & Negative & False Positives (FP) & True Negatives (TN) \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Confusion matrix for binary classification. a high score only if the binary predictor was able to correctly predict the majority of positive data instances and the majority of negative data instances. It ranges in the interval [-1, +1], with extreme values \(-1\) and +1 reached in case of perfect misclassification and perfect classification, respectively. At the same time, MCC = 0 is the expected value for the coin-tossing classifier [30].