# Software Defect Prediction Using Heterogeneous Ensemble Classification Based on Segmented Patterns
## 7 Experiments and Results
### KME vs. Ensemble Classifiers  
Here we experiment the KME version of the proposed algorithm, which combines ensemble classifiers instead of simple classifiers in an attempt to boost the predictive power of the approach. Figure 6: Recall for the basic classifiers and KMB. Figure 7: G-mean for the basic classifiers and KMB. For precision and recall, Table 6 shows that KME is dominating the top rates especially in regard to precision. Considering the G-mean results in Table 6, we can see that KME hits the best results in 19 datasets out of 21. For better visualization of the obtained results, radar Figures 8-10 are plotted for KME and the ensemble classifiers. By comparing the performance of KMB and KME in terms of G-mean results, Table 7 shows that the KMB achieves better results in 14 datasets out of 21 indicating that it is not necessary to apply the KME in all cases. This could be explained by the fact that KMB is a type of ensemble classification and it combines weak classifiers which could prevent overfitting. This is unlike the case of KME which combines powerful classifiers. \begin{table}
\begin{tabular}{c c c c c c c c c c c c c c c} \hline \hline \multirow{2}{*}{**Datasets**} & \multicolumn{3}{c}{**Bagging**} & \multicolumn{3}{c}{**AdaBoost**} & \multicolumn{3}{c}{**RF**} & \multicolumn{3}{c}{**XGB**} & \multicolumn{3}{c}{**KME**} \\ \cline{2-13}  & **Pre** & **Rec** & **G-Mean** & **Pre** & **Rec** & **G-Mean** & **Pre** & **Rec** & **G-Mean** & **Pre** & **Rec** & **G-Mean** & **Pre** & **Rec** & **G-Mean** \\ \hline cm1 & 0.392 & 0.295 & 0.511 & 0.404 & 0.300 & 0.516 & 0.400 & 0.295 & 0.511 & 0.397 & 0.289 & 0.507 & **0.783** & **0.623** & **0.775** \\ jm1 & 0.505 & 0.207 & 0.441 & 0.505 & 0.208 & 0.443 & 0.505 & 0.209 & 0.444 & 0.506 & 0.207 & 0.441 & **0.846** & **0.669** & **0.780** \\ kcl & 0.592 & 0.388 & 0.590 & 0.604 & 0.393 & 0.595 & 0.598 & 0.391 & 0.593 & 0.589 & 0.388 & 0.590 & **0.808** & **0.663** & **0.758** \\ kc3 & 0.464 & 0.556 & 0.674 & 0.480 & 0.567 & 0.684 & 0.488 & 0.576 & 0.691 & 0.478 & 0.543 & 0.672 & **0.832** & **0.792** & **0.862** \\ mcl & 0.029 & 0.870 & 0.596 & 0.030 & **0.892** & 0.605 & 0.029 & 0.683 & 0.595 & 0.038 & 0.885 & 0.601 & **0.866** & 0.628 & **0.761** \\ mv1 & 0.087 & 0.438 & 0.544 & 0.086 & 0.433 & 0.542 & 0.085 & 0.433 & 0.539 & 0.078 & 0.396 & 0.513 & **0.729** & **0.519** & **0.594** \\ pcl & 0.263 & 0.335 & 0.547 & 0.246 & 0.313 & 0.527 & 0.265 & 0.345 & 0.556 & 0.247 & 0.315 & 0.529 & **0.828** & **0.659** & **0.803** \\ pc2 & 0.094 & **0.886** & 0.795 & 0.088 & 0.836 & 0.771 & 0.092 & **0.886** & 0.792 & 0.095 & 0.883 & **0.796** & **0.901** & 0.417 & 0.619 \\ pc3 & 0.145 & **0.916** & 0.409 & 0.144 & 0.909 & 0.404 & 0.145 & 0.909 & 0.409 & 0.145 & 0.911 & 0.412 & **0.776** & 0.546 & **0.726** \\ pc4 & 0.280 & 0.736 & 0.739 & 0.276 & 0.739 & 0.738 & 0.280 & 0.742 & 0.741 & 0.283 & **0.749** & 0.745 & **0.881** & **0.727** & **0.840** \\ pc5 & 0.529 & 0.211 & 0.441 & 0.536 & 0.215 & 0.446 & 0.533 & 0 The boxplots for KMB and KME represented in Figures 11 and 12. These boxplots are created for reporting the G-mean of 30 independent runs for all datasets. The figures show that KMB and KME are very competitive and stable in most of the datasets. It can be noted that for few datasets KMB and KME exhibit more sensitive performance than the other datasets. Examples of these datasets are cm1, mc1, mw1 and pc2. This sensitivity can be due to the high imbalance ratio in these datasets, that is, misclassifying one instant from the rare class will highly impact the G-mean measure. For jedit-4.3  
Figure 8: Precision for the ensemble classifiers and KME. Figure 9: Recall for the ensemble classifiers and KME. dataset, the single classifier approach failed to classify the rare instances therefore its recall is 0 and consequently the G-mean is 0. On the other hand, for the log4j-1.2 dataset, performance of of KMB and KME was worse than the other classifiers which could be reasoned to the clustering step which produced clusters that are harder for KMB and KME to cluster.