## 4 Results and Discussion
### Machine Learning Efficiency Metrics  
The ML classification efficiency metric method is applied to both datasets to ensure that the generated dataset represents the real dataset. This method evaluates the similarity between both datasets to examine the replacement of a real dataset with a generated dataset used by [13; 42], as implemented in Algorithm 1 line 17, and to check the minimum difference between real and generated data. The ML classification results were slightly similar for both the generated and real datasets, proving that replacing the real dataset with the generated dataset is possible. The promising results in Table 8 show that the accuracy of the generated data before using feature selection reached 1 in XGBoost and 0.99 in RF, decision tree, gradient boost, and LightGBM, which indicates the quality of the dataset for ML tasks. A filter-based feature selection method is applied to the dataset to reduce the time complexity of the classification process for further improvement. As shown in Table 8, feature selection improved the accuracy of some classifiers and did not affect their performance. The RF classifier increased from 0.99 to 1.0, and the accuracy of Naive Bayes significantly increased from 0.73 to 0.97 using the 10 and 15 best features. The results show how to reduce the complexity without affecting the accuracy or even improving it. These results imply that the generated IoT dataset from CTGAN can be used as learning data for several ML tasks and can efficiently capture, detect, and replicate the patterns between the features of the network data and its class. This agrees with previously published studies that employed GAN on the CIDDS and NSL-KDD datasets [13; 42]. However, the ML classification results of the current study were better than those of other studies [13; 42] in terms of accuracy. Moreover, the ML classification of the generated synthetic resemblance datasets of NSL-KDD and CIDDS may not be suitable for detecting lightweight IoT network attacks as the proposed pipeline reduces time complexity and contains more types of attacks related to IoT environments. Accordingly, Table 9 shows that the detection time in seconds (using a decision tree) improved from 1.48 to 0.05 in terms of training time and 0.004 in terms of test time using the five best features. Additionally, the training time of XGBoost and MLP was significantly reduced from 24.54 and 94.14 to 5.35 and 24.70, respectively. However, the RF time did not improve, which may not be suitable for lightweight contexts. \begin{table}
\begin{tabular}{p{42.7 pt} p{42.7 pt} p{42.7 pt} p{42.7 pt} p{42.7 pt} p{42.7 pt} p{42.7 pt} p{42.7 pt} p{42.7 pt} p{42.7 pt}} \hline \hline  & \multicolumn{2}{c}{**Collected**} & \multicolumn{2}{c}{**Generated Dataset**} & \multicolumn{2}{c}{**Generated Dataset**} & \multicolumn{2}{c}{**Generated Dataset**} & \multicolumn{2}{c}{**Generated Dataset**} & \multicolumn{2}{c}{**Generated Dataset**} \\  & \multicolumn{2}{c}{**Original Dataset**} & \multicolumn{2}{c}{**Before Feature Selection**} & \multicolumn{2}{c}{**with 5 Best Feature Selection**} & \multicolumn{2}{c}{**with 10 Best Feature Selection**} & \multicolumn{2}{c}{**with 15 Best Feature Selection**} \\ \hline
**Classifier** & **Accuracy** & **F1** & **Accuracy** & **F1** & **Accuracy** & **F1** & **Accuracy** & **F1** \\ \hline RF & 0.99 & 0.99 & 0.99 & 0.99 & 0.99 & 0.99 & 1 & 1 & 1 & 1 \\ Naive Bayes & 0.73 & 0.72 & 0.76 & 0.75 & 0.96 & 0.96 & 0.97 & 0.97 & 0.97 \\ Decision Tree & 0.99 & 0.99 & 0.99 & 0.99 & 0.99 & 0.99 & 0.99 & 0.99 & 0.99 & 0.99 \\ MLP & 0.99 & 0.99 & 0.98 & 0.98 & 0.99 & 0.99 & 0.81 & 0.84 & 0.81 & 0.84 \\ Gradient & 0.99 & 0.99 & 0.99 & 0.99 & 0.99 & 0.99 & 0.99 & 0.99 & 0.99 & 0.99 \\ Boost XGBoost & 0.99 & 0.99 & 1 & 1 & 0.99 & 0.99 & 1 & 1 & 1 & 1 \\ LightGBM & 0.99 & 0.99 & 0.99 & 0.99 & 0.99 & 0.99 & 1 & 1 & 1 & 1 \\ \hline \hline \end{tabular}
\end{table} 
Table 8: Classification accuracy and F1 results with the 5, 10, and 15 best feature selections.