# Optimal Partitioning of Unbalanced Datasets for BGP Anomaly Detection
## 5 Results Analysis
### Observations  
Majority (more frequent) Class (A, E, F) Detection: The proposed OP-ELM model achieved a better performance in terms of the majority classes (A, E and F) than those of the baseline methods and weighted ELM. For Class A, it recorded the highest accuracy (98.81%), precision (98.27%), recall (98.62%), and F1-score (98.44%) compared with the top baselines (RF-SMOTE) by 0.36-0.41 percentage points and the weighted ELM by 0.83-6.64 percentage points. Likewise, the model achieved accuracy, precision, recall, and F1-score values of 96.12%, 95.22%, 94.11%, and 94.66%, respectively, for Class E, which is 0.21-1.34 percentage points higher than the RF-SMOTE and 1.60-1.78 percentage points higher than the weighted ELM. With an accuracy and F1-score of 95.67% and 93.76%, respectively, Class F performed strongly too, outperforming the baseline and weighted ELMs. This suggests that the model performed well for the majority classes, perhaps because the optimal partitioning method balances the dataset while improving the given classifier training. The improved generalization across various metrics demonstrates reliable capability across all classes, as well as decreased misclassification for frequent classes. Minority (less frequent) Class (A, E, F) Detection: The proposed OP-ELM model also showed improvement for the minority classes (B, C, and D) but was noticeably better for some metrics than others. For Class B, the model achieved an accuracy of 91.98%, a precision of 90.81%, a recall of 89.34%, and an F1-score of 90.06%, which exceeded the best baseline (RF-SMOTE) by up to 0.80-3.81 percentage points and the weighted ELM by up to 1.84-3.48 percentage points. The latest release of the ELM achieved the highest model metrics for Class C, the challenging minority class, with 87.75% accuracy, 87.04% precision, 85.65% recall, and an 86.33% F1-score, which improved by 1.82-5.69 percentage points over the RF-SMOTE and 2.54-3.80 percentage points over the weighted ELM. The model reached 94.02% accuracy, 93.14% precision, 91.62% recall, and a 92.37% F1-score for Class D, outperforming the baseline methods by up to 5.07 percentage points and the weighted ELM by 0.84-1.14 percentage points. These results suggest that the optimal partitioning (OP) technique helps reduce class imbalance so that minority anomalies can be detected without degrading the performance on the majority classes. Balanced vs. Weighted Measures: The proposed OP-ELM model showed an excellent performance in both the balanced and weighted evaluation metrics, although the weighted measures were larger due to their normalization to the class levels. The FRX-1 reached balanced measures of 94.13% for accuracy, 93.22% for precision, 90.87% for re \begin{table}
\begin{tabular}{c c c} \hline \hline
**Model** & **Accuracy (\%)** & **F1-Score (\%)** \\ \hline MTAD-GAT, [PERSON] et al. [45] & 80.01 & 81.23 \\ ACLAE-DT, [PERSON] et al. [46] & 82.91 & 81.93 \\ CAE-M, [PERSON] et al. [47] & 81.64 & 81.88 \\ Proposed Method (OP-ELM) & 94.10 & 92.00 \\ \hline \hline \end{tabular}
\end{table} 
Table 11: Performance comparison with recent models. call, and 92.03% for the F1-score, which outperformed the best baseline (RF-SMOTE) by 1.32-2.06 percentage points and the weighted ELM by 2.57-3.07 percentage points. These findings suggest strong generalization across all classes, irrespective of class size. In terms of the weighted balanced measures, as the class distribution was taken into account, the model achieved a better performance with 94.52% for accuracy, 95.18% for precision, 94.48% for recall, and 94.67% for the F1-score. This indicates an improvement of 0.85-1.49 percentage points compared to the RF-SMOTE, and a gain of 3.11-4.00 percentage points over the weighted ELM. These higher weighted scores not only indicate that the model balances the class influences on the prediction outcome very well, but they also imply that the model has a good performance with respect to real-life applications where minority class detection is very important.