# Intrusion Detection Method Based on Preprocessing of Highly Correlated and Imbalanced Data
## 3 Results
### Model Selection, Training, and Evaluation  
#### 3.4.1 Evaluation of the Effectiveness of Using the SMOTEENN Algorithm  
In the beginning, we evaluated the effectiveness of using the SMOTEENN algorithm. To compare its impact, classification models based on Bagging, Random Forest, Adaboost, Gradient Boosting, Perceptron, Naive Bayes, SVM, and KNN were created. While each of these classification algorithms has unique strengths, effective tuning is crucial for optimal performance on real-world datasets.  
The following parameters were used:  
* SVM: Kernel selection--linear, regularization parameter (C)--1.0, gamma parameter for RBF kernel--'scale';
* KNN: Number of neighbors (k)--5, distance metric--'minkowski';
* Naive Bayes: Class priors--none, smoothing coefficient (alpha)--1 \(\times\) 10\({}^{-9}\);
* Perceptron: Learning rate--'constant', activation function--linear, maximum number of epochs--1000.  
Decision trees were used as the base classifiers for ensemble models, and their parameters were also tuned for optimization. The parameter settings included the following:  
* Criterion for measuring the quality of a split--'gini';
* Minimum number of samples required to split an internal node--2;
* Minimum number of samples required to be at a leaf node--1;
* Maximum depth of the tree--none (unlimited);
* No maximum feature parameter was specified.  
The meta-algorithm was optimized by selecting the number of base classifiers and the procedure for forming training samples. The following parameters were used:  
* Bagging--80 base classifiers;
* Random Forest--100 base classifiers;
* Adaboost--50 base classifiers;
* Gradient Boosting--100 base classifiers.  
A total of 80% of the input data were used for training, while 20% was reserved for testing. The research results are presented in Table 2.  
As it can be seen, applying data balancing, tuning the parameters of base classifiers, and optimizing the meta-algorithm consistently improved classification quality com  
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline \multirow{2}{*}{**Type of Data**} & \multirow{2}{*}{**Classifier**} & \multicolumn{4}{c}{**Mean Evaluation Metrics**} \\ \cline{3-6}  & & **Precision** & **Recall** & **F1 Score** & **Accuracy** \\ \hline \multirow{6}{*}{**Synthetic**} & Bagging & 0.632711 & 0.606747 & 0.619223 & 0.859308 \\  & Random Forest & 0.652189 & 0.605505 & 0.631143 & 0.864856 \\  & Adaboost & 0.469637 & 0.571573 & 0.479471 & 0.552188 \\  & Gradient & 0.677363 & 0.622911 & 0.638217 & 0.862682 \\  & Perceptron & 0.448027 & 0.48171 & 0.375484 & 0.690192 \\  & Naive Bayes & 0.240122 & 0.508604 & 0.295897 & 0.450958 \\  & SVM & 0.593755 & 0.43801 & 0.413315 & 0.766314 \\  & KNN & 0.57165 & 0.483343 & 0.518767 & 0.805204 \\ \hline \multirow{6}{*}{**Synthetic**} & Bagging & 0.932608 & 0.934367 & 0.933333 & 0.954493 \\  & Random Forest & 0.946865 & 0.942628 & 0.943628 & 0.961703 \\ \cline{1-1}  & Adaboost & 0.609027 & 0.739865 & 0.623658 & 0.535241 \\ \cline{1-1}  & Gradient & 0.864355 & 0.866288 & 0.863651 & 0.910774 \\ \cline{1-1}  & Boosting & Perceptron & 0.755742 & 0.735643 & 0.738974 & 0.802861 \\ \cline{1-1}  & Naive Bayes & 0.577641 & 0.684165 & 0.614198 & 0.69735 \\ \cline{1-1}  & SVM & 0.757607 & 0.792579 & 0.772734 & 0.834756 \\ \cline{1-1}  & KNN & 0.886423 & 0.901735 & 0.893365 & 0.920925 \\ \hline \hline \end{tabular}
\end{table}
Table 2: Results of applying the proposed method of balancing.  
pared to imbalanced data. The best results were obtained using the Random Forest meta-algorithm. The Bagging meta-algorithm based on decision trees also demonstrated strong evaluation metrics.  
As a result, applying the SMOTEENN algorithm in combination with the Random Forest meta-algorithm improved model quality by 31% in the task of detecting intrusions in computer systems and networks.  
Next, we evaluate the effectiveness of the SP_PCA feature space reduction procedure.