## 4 Experimental Set Up and Result Analysis
### Experimental Results  
To confirm the efficacy of the proposed framework, ML algorithms have been considered as part of the experimentation. In this paper, a complete comparative examination of the evaluation parameters operated to consider all the ML methods and techniques together with the proposed framework is shown in Figure 3. The WEKA simulation results demonstrate that the performance of the proposed GA-RF algorithm according to the precision, recall, F1 score, and accuracy parameters are higher than the other ML algorithms in the NSL-KDD data set. The GA-RF algorithm achieved 99.999% for accuracy, 100% for recall and 99.99% for precision. In contrast, the naive Bayes algorithm could not achieve suitable results. The main advantage of our proposed GA-RF algorithm is that this model can select an optimal population for training procedure as an initial categorization of the forest to predict cyber-attacks. The random forest algorithm achieved 99.917% for accuracy and 99.8% for precision and recall. Moreover, Figure 3 displays that the performance of the J48 algorithm according to the precision, recall, F1 score, and accuracy parameters are 99.881%, 99.8%, 99.8%, and 99.8%, respectively. Moreover, the performance of the Bayes Net algorithm according to the precision, recall, F1 score, and accuracy parameters are 97.17%, 95.5%, 99.7%, and 97.4%, respectively. The performance of the naive Bayes algorithm in terms of the precision, recall, F1 score, and accuracy parameters are 90.381, 89, 93.6, and 91.2, respectively. Finally, the performance of the SMV algorithm according to the precision, recall, F1 score, and accuracy parameters are 97.405%, 96.7%, 98.6%, and 97.6%, respectively. Also, Figure 4 shows a comparative analysis of mean absolute error (MAE) and root mean square error (RMSE) among all models. The proposed GA-RF algorithm received minimum MAE with 0.0027 and RMSE with 0.0284. The random forest algorithm has the second lowest error rates for 0.0029 MAE and 0.0285 RMSE. It means that the average  
Figure 3: Comparative analysis of prediction metrics among all models in NSL-KDD data set. volume of the errors in a set of detected malicious activities is the lowest in the GA-RF algorithm for the proposed data set. For the UNSW_2018_IoT_Botnet data set, Figure 5 illustrates a comparison of results of intrusion detection for applied GA-RF and other machine learning algorithms. The GA-RF algorithm achieved 99.999% accuracy, 100% precision, and 100% recall. Also, Figure 5 displays that the performance of the random forest algorithm according to the precision, recall, F1 score, and accuracy parameters are 99.85%, 99.88%, 99.88%, and 99.88%, respectively. Moreover, the performance of the Bayes Net algorithm according to the precision, recall, F1 score, and accuracy parameters are 99.89%, 97.7%, 97.7%, and 97.7%, respectively. The performance of the naive Bayes algorithm in terms of the precision, recall, F1 score, and accuracy parameters are 99.79%, 96%, 96% and 96%, respectively. Finally, the performance of the SVM algorithm according to the precision, recall, F1 score, and accuracy parameters are 99.74%, 89.4%, 89.4%, and 89.4%, respectively. Figure 4: Comparative analysis of error rates among all models in NSL-KDD data set. Figure 5: Comparative analysis of prediction metrics among all models in UNSW_2018_IoT_Botnet data set. Also, Figure 6 shows experimental results of MAE and RMSE factors for UNSW_2018_IoT_Botnet data set in all algorithms. The proposed GA-RF algorithm received the minimum MAE with 0.0001 as near to zero and RMSE with 0.0021 rate. The random forest algorithm has the second lowest error rates of 0.005 MAE and 0.0027 RMSE. It means that the average volume of the errors in a set of detected cyber-attacks is the lowest using the GA-RF algorithm in UNSW_2018_IoT_Botnet data set. Figure 7 illustrates existing classifications of normal activities with blue color or anomalous activities with red color for guest login status in the medical or healthcare networks.