## 3 Methodology
### Rlfoula Framework Description
#### 3.2.3 Employing Functional Agents in RL
Calculate \(\mathbf{M}=\frac{\sqrt{(\mathbf{f}_{\text{Boolean}})^{2}\cdot\text{accuracy}^{2} \cdot\text{accuracy}^{2}\cdot\text{sensitivity}^{2}\cdot\text{specificity}^{2}\cdot\text{specificity}^{2}\cdot\text{specificity



#### 3.2.4 Testing Method

To establish the efficacy and generalizability of the proposed algorithm, comprehensive tests are conducted using two distinct types of IDS datasets: CSE-CIC-ID2018 (binary-class) and NSL-KDD (multiclass). These datasets are representative of different scenarios, ensuring that the algorithm's performance extends beyond specific dataset characteristics. The evaluation results differ between the two datasets due to their distinct characteristics. The testing process follows a systematic procedure, outlined as follows:

1. Preliminary application of RLPOUA framework on CSE-CIC-IDS2018 dataset: The smaller section of the dataset, as discussed in Section 3.1.1, undergoes division into training and validation subsets. Within the RLPOUA framework, machine learning algorithms are trained using the training set, while the validation dataset is utilized to compute classification metrics. This framework's impact is assessed by comparing pre- and post-application metrics, encompassing F1 score, accuracy, recall, and precision. The four most proficient algorithm combinations are ranked independently for each dataset, effectively highlighting the RLPOUA framework's capacity to enhance classification performance. 2. Preliminary application of RLPOUA framework on NSL-KDD dataset: Similar analyses are conducted on the entire NSL-KDD datasets, following the same partitioning approach and evaluating performance based on distinct training and validation sets. Subsequent ranking of the top four algorithm combinations underscores the consistent advancement in classification performance through the RLPOUA framework. 3. Primary testing on independent set of CSE-CIC-IDS2018 dataset: In order to corroborate the generalizability of the RLPOUA framework, independent datasets sourced from the CSE-CIC-ID2018 dataset are engaged. The entire dataset undergoes tripartite division into training, validation, and independent testing subsets. The framework is trained and validated on these data subsets, yielding a new model for subsequent testing. This newly formed model is then evaluated on independent testing sets using the RLPOUA framework, affirming the framework's reliability and ability to maintain consistent performance beyond training and validation phases. 4. Primary testing on independent set of NSL-KDD dataset: To extend the applicability of the method, the approach employed in test 3 is replicated on the NSL-KDD datasets. Employing a tripartite division, the datasets are split into training, validation, and independent testing subsets, with the framework trained and validated accordingly. The resultant model is then subjected to evaluation on separate testing sets, reinforcing the method's generalizability and its capacity to ensure stable performance beyond training and validation stages. Through this comprehensive testing process, the effectiveness and robustness of the RLPOUA framework, along with the TFRSMOTE resampling algorithm, will be determined. In addition, their superiority over other existing methods will be ascertained. Enhanced performance will be evident in the form of higher F1 scores, accuracy, recall, and precision, establishing the algorithm's efficacy for real-world IDS applications. ## 4 Results

In this section, we evaluate the performance of the framework using two distinct datasets, namely, CSE-CIC-IDS2018 and NSL-KDD, and demonstrate the improvements achieved in terms of classification metrics. Furthermore, we test the RLPOUA framework on an independent dataset to assess its generalizability. The application of the RLPOUA framework with TFRSMOTE algorithm on the CSE-CIC-IDS2018 and NSL-KDD datasets reveals notable enhancements in the classification metrics. The evaluation results differ between the two datasets due to their distinct characteristics.