# Hybrid Oversampling and Undersampling Method (HOUM) via Safe-Level SMOTE and Support Vector Machine
## 4 Proposed Algorithm: HOUM  
This study introduces the Hybrid Oversampling and Undersampling Method (HOUM), which uses SLS for oversampling and an SVM for undersampling with imbalanced datasets. In this proposed method, undersampling is applied to the majority-class data that are far from the decision boundary determined using the SVM. Subsequently, if the dataset remains imbalanced, SLS performs oversampling. The procedure is continued until the dataset becomes balanced. The goal is to prevent the loss of valuable information by removing data from regions that are far from the decision boundary. In the SIMO method, which inspired our study, oversampling is only applied to the minority data located in the boundary region that is identified with the SVM. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Datasets** & **\# of Features** & **\# of Instances** & \begin{tabular}{c} **\# of Instances in** \\ **Majority Class (Np)** \\ \end{tabular} & \
\begin{tabular}{c} **\# of Instances in** \\ **Minority Class (Nn)** \\ \end{tabular} &
\begin{tabular}{c} **Imbalance Rate** \\ **(Np/Nn)** \\ \end{tabular} \\ \hline Climate & 21 & 540 & 494 & 46 & 10.74 \\ Diabetes & 9 & 768 & 500 & 268 & 1.87 \\ Liver & 11 & 583 & 416 & 167 & 2.49 \\ Haberman & 4 & 305 & 224 & 81 & 2.77 \\ Transfusion & 5 & 748 & 570 & 178 & 3.20 \\ Ionosophore & 32 & 351 & 225 & 126 & 1.79 \\ Column\_2c & 7 & 310 & 210 & 100 & 2.10 \\ TexYarn & 8 & 979 & 937 & 42 & 22.31 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Characteristics of benchmark datasets. This work was structured around the following assumptions: Obtaining balanced datasets from binary class imbalanced datasets may increase the classification performance. The non-decisive data of the majority class are far from the decision boundary obtained via the SVM. Therefore, reducing instances that are far from the boundary may contribute to balancing the data without information loss. SLS is another tool utilized to balance the data by increasing the amount of minority data. The G-mean value was chosen as the performance indicator due to its high prediction accuracy for both positive and negative classes. The main procedure of the HOUM is shown in Figure 3.  
* An SVM is applied to the imbalanced training data as shown in Figure 3A. * The red points in Figure 3B indicate the detected majority data furthest from the decision boundary. * Sample reduction is applied, as shown in Figure 3C. * Oversampling is performed via SLS, as shown in Figure 3D. Figure 4 displays a flowchart of the methodology. According to Figure 4, initially, the dataset is normalized. The data are then divided into a training set and a test set. The training set is used to train the classifier, while the test set is utilized to evaluate the classifier's performance. If the data are imbalanced, then undersampling and oversampling methodologies can be applied to balance the data. After balancing the data, a classification algorithm is used. Finally, the classifier is evaluated using the test set, and performance metrics are calculated. The steps of the HOUM are as follows. 1. Values of \"0\" and \"1\" are assigned to class labels. The value of \"1\" is assigned to the minority-class labels. 2. The min-max normalization procedure is applied to all features, excluding the class label, using Equation (22) [38]. The definitions of notations are as follows. \(v:\): value for feature that will be normalized. \(v^{\prime}:\): normalized value. \(min_{A}:\) minimum value for Feature A. \(max_{A}:\): maximum value for Feature A. \(new\_min_{A}\): minimum value after normalization. \(new\_max_{A}\): maximum value after normalization. \[v^{\prime}=\frac{v-min_{A}}{max_{A}-min_{A}}(new\_max_{A}-new\_min_{A})+new\_ min_{A} \tag{22}\]  
Figure 3: The main procedure of the HOUM: (**A**) SVM implementation. (**B**) Selecting majority data far from the decision limit. (**C**) Performing instance reduction. (**D**) Oversampling via SLS.