## 5 Result and Discussion
### Confusion Matrix  
A confusion matrix is a tabular way of visualizing the performance of the prediction model. Each entry in a confusion matrix denotes the number of predictions made by the model whether it has classified the classes correctly or incorrectly. In Figure 9, the horizontal scale mentioned the predicted values of the classes, and the vertical scale mentioned the actual values. Out of 305 zero classes, 240 are predicted as zero class, 48 are predicted as one class, and 17 are predicted as two class. It means that 240 instances are predicted correctly for zero class and 65 are predicted wrongly. In Figure 10, out of 155, 128 are predicted as zero class, 20 are predicted as one class, and 7 are predicted as two class. It means that 128 instances are predicted correctly for zero class and 27 are predicted wrongly and fall under both classes. RQ1: What is the impact of XGBoost for the optimal feature selection for multi-class in predicting the cross-project defect prediction accuracy of the PROMISE repository? We evaluated our results by training our classifier by considering the versions of Ant as a source project and all the versions of every dataset as the target projects of the PROMISE repository in terms of the AUC measure. Table 8 effectively shows that our model achieved the maximum higher defect prediction accuracy for the cross-project defect prediction when we used a feature selection using XGBoost before an auto feature extraction using the CNN. \begin{table}
\begin{tabular}{l l l} \hline \hline
**Model: “Sequential”** & & \\ \hline Layer (type) & Output Shape & Param \# \\ \hline conv1d (Conv1D) & (None, 15, 128) & 512 \\ \hline leaky\_re\_lu (LeakyReLU) & (None, 15, 128) & 0 \\ \hline max\_pooling1d (MaxPooling1D) & (None, 8, 128) & 0 \\ \hline dropout (Dropout) & (None, 8, 128) & 0 \\ \hline conv1d\_1 (Conv1D) & (None, 8, 128) & 49,280 \\ \hline leaky\_re\_lu\_1 (LeakyReLU) & (None, 8, 128) & 0 \\ \hline max\_pooling1d\_1 (MaxPooling1D) & (None, 4, 128) & 0 \\ \hline Dropout\_1 (Dropout) & (None, 4, 128) & 0 \\ \hline flatten (Flatten) & (None, 512) & 0 \\ \hline dense (Dense) & (None, 3) & 1539 \\ \hline \hline \end{tabular}  
* Total Params: 51,331. Trainable Params: 51,331. Non-Trainable Params: 0.  
\end{table} 
Table 7: Experimental configuration of CNN architecture. In the above Table 8, we witnessed the maximum difference in terms of the accuracy for the Velocity and Xerces to be 12.34%, and a minimum difference of about 2.89% for Lucene, when we compared our result with and without XGBoost in terms of the AUC measure. We achieved the overall minimum difference for Lucene because the Lucene project is very mature, considering Ant 1.7 as a target project. As the Lucene project has a huge amount of data to train the CTGAN in order to generate a synthetic clone of data, it hence has enough data to train the classifier for a better prediction, which resulted in less difference of the prediction accuracy with and without using XGBoost. Figure 10: Confusion matrix by considering Synapse-1.1 as target project and Ivy as source project. Figure 9: Confusion matrix by considering Ivy-2.0 as target project and ant as source project. The high difference for the Velocity and Xerces is due to less amount of multi-class data to train the CTGAN in order to generate a synthetic clone of data and then train the classifier for a better prediction. Both these projects are immature, considering Ant 1.7 as a target project. We needed XGBoost as an important feature selector to train the classifier based on important features having a higher dependency on the output, which resulted in a higher difference of the prediction accuracy with and without selecting optimal features using XGBoost. Therefore, it is evident from our experimental result that XGBoost selects optimal feature sets, hence the H1 \"XGBoost selects optimal feature sets for multi-class in predicting cross-project defect prediction accuracy of PROMISE repository\" is accepted. Now we test the hypothesis of our second research question.