## 5 The Experiments
### Experimental Results
Since there are 3 classifiers and 5, 10 and 7 output categories on the three datasets, the length of the weight is the same as the individual length, which is 15, 30 and 21, respectively, in the NSL-KDD, UNSW-NB15 and CICIDS2017 datasets. The length of the weight of the weighted voting and the classifier-level weight methods is the same as the classifiers used in the ensemble. The weight comparison of different voting ensemble methods is shown in Table 4.  
Meanwhile, two experiments were carried out to verify whether feature selection may improve the results. Tables 5-7 provide the experimental results of the performance \begin{table}
\begin{tabular}{c c c c} \hline \hline  & **Models** & **Use the Weight or Not?** & **Length of the Weight** \\ \hline Hard voting & The majority voting & no & N/A \\  & The weighted voting & yes & 3 \\  & No weight & no & N/A \\ Soft voting & The classifier-level weight & yes & 3 \\  & The class-level weight & yes & 15, 30 or 21 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: The weight comparison of different voting ensemble methods. Figure 4: Different number of features and their corresponding testing accuracy on the NSL-KDD, UNSW-NB15 and CICIDS2017 datasets. Tables 5-10 clearly show that the voting ensemble methods have better and more stable predictive performance than the base learners. The KNN performs best on the NSL-KDD and CICIDS2017 datasets, while it performs worst on the UNSW-NB15 dataset. SVM has a high False Positive Rate on the CICIDS2017. The performance of DT is stable, but it is still inferior to the ensemble learning method. Tables 5-10 show that the class-level weight method obtained better performance in Detection Rate, FPR, acc and F1 compared to other ensemble methods. By comparing the results presented in Tables 8-10 to the ones in Tables 5-7, it can be seen that feature selection has positive significance because it can improve the efficiency of the models. Even if half of the features or more are omitted, these models can still maintain considerable performance. Moreover, to verify the search and convergence capabilities of the CBA, the proposed weight-optimization scheme will be compared with the basic BA and GA. The GA is implemented by calling the scikit-opt library [47]. There are many important parameters to be specified in GA. In particular, the \(n\_dim\) represents the number of variables in the problem to be optimized, which is the same as the individual length. The results of the performance comparisons of the CLSVE based on different Optimization Algorithms on the three datasets are shown in Table 11. It should be noted that feature selection is performed. Table 11 shows that the performance of the proposed CBA-CLSVE is better than the BA-based CLSVE and GA-based CLSVE. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Models** & **DR (\%)** & **FPR (\%)** & **Acc (\%)** & **F1 (\%)** \\ \hline SVM & 98.96 & 11.96 & 96.84 & 98.06 \\ KNN & 99.62 & 3.09 & 99.13 & 99.47 \\ DT & 98.88 & 4.55 & 98.25 & 98.93 \\ The majority voting & 99.50 & 2.72 & 99.08 & 99.43 \\ The weighted voting & 99.62 & 3.47 & 99.03 & 99.41 \\ No weight & 99.63 & 1.77 & 99.37 & 99.61 \\ The classifier-level weight & 99.83 & 2.48 & 99.41 & 99.64 \\ The class-level weight & 99.83 & 0.59 & 99.75 & 99.85 \\ \hline \hline \end{tabular}
\end{table} 
Table 10: Performance comparisons of the base learners and different voting ensemble methods with feature selection on the CICIDS2017 dataset. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Models** & **DR (\%)** & **FPR (\%)** & **Acc (\%)** & **F1 (\%)** \\ \hline SVM & 98.92 & 21.05 & 94.26 & 96.35 \\ KNN & 91.03 & 18.21 & 88.94 & 92.72 \\ DT & 98.94 & 18.83 & 95.50 & 97.26 \\ The majority voting & 99.05 & 20.41 & 95.07 & 96.96 \\ The weighted voting & 97.78 & 20.28 & 93.79 & 96.09 \\ No weight & 99.09 & 20.90 & 94.95 & 96.89 \\ The classifier-level weight & 98.94 & 21.14 & 94.73 & 96.74 \\ The class-level weight & 99.49 & 22.59 & 94.62 & 96.65 \\ \hline \hline \end{tabular}
\end{table}