# Hybrid Oversampling and Undersampling Method (HOUM) via Safe-Level SMOTE and Support Vector Machine
## 1 Introduction  
The recent advancements in data collection technologies have sparked a greater interest in data mining and broadened its range of applications. Additionally, the challenge of identifying rare tags within datasets has contributed to the prevalence of imbalanced datasets. A search for imbalanced datasets in the Web of Science database yielded 7252 documents, including articles, proceedings, early access materials, review articles, and book chapters. In total, 53% of these documents were published between 2021 and 2023. This rate is an indicator of the increasing interest in and demand for this topic. There is no cutoff value for defining datasets as imbalanced. An imbalanced dataset is one in which some classes are observed more frequently than other classes. The yarn, the most critical aspect of the fabric weaving process, causes both quality and energy losses when it breaks in the weaving process. In the present study, data were collected to observe the tendency of the yarns to break off during the weaving process. Yarns that are approved in the first quality control process undergo additional operations before transitioning to the weaving stage. Subsequently, efforts were undertaken to forecast whether a possible rupture might occur during the weaving process, prior to its actual occurrence. The developed algorithm (HOUM), utilizing both yarn quality control and production parameters, accurately predicted yarns prone to breakage during the weaving process, achieving a high-performance measure. This stands as the present study's primary achievement. In the methodology of Weighted Synthetic Informative Minority Oversampling (W-SIMO) [1], the inspiration for the proposed method, informative minority-class data are reproduced around the boundary region of the SVM. However, in our study, non-informative majority-class data, far from the SVM boundary region, were removed from the dataset to avoid the information loss encountered in sample reduction. Then, minority data were reproduced using the safe-level SMOTE (SLS) method [2] if the dataset was still imbalanced. Essentially, the aim of the HOUM is to address challenges associated with imbalanced datasets by minimizing information loss, improving classifier performance, and employing a combination of techniques to create a balanced representation of classes. This facilitates more effective model learning and prediction. To handle the imbalance problem, the following three steps are applied until the dataset becomes balanced. * SVM-based undersampling: An SVM model is implemented to find the decision boundary that separates the classes. Majority-class instances that are far from this boundary are identified and considered for undersampling. * SLS-based oversampling: SLS is applied to generate synthetic instances for the minority class if the dataset is imbalanced. * Iterative balancing: a loop is created that iterates through the undersampling and oversampling steps until the dataset reaches a balanced state. Hence, the HOUM employs an iterative method for tackling imbalanced datasets, which integrates SVM-based undersampling and SLS-driven oversampling. Demonstrating the HOUM's success on different datasets and comparing it with existing methods could illustrate its broad applicability. This provides significant insights into the method's overall effectiveness. The ability of the developed algorithm to yield high-performance values when applied to a real dataset in the textile industry (the TexYarn dataset) can also be considered as an indicator of its applicability as a decision support system. These contributions suggest that the method adds substantial value to the literature by addressing classification problems in imbalanced datasets from a different perspective. Section 2 provides a review of the existing literature. Section 3 explains the preliminaries for classification algorithms, performance metrics, literature datasets used in the paper, and the real production environment's dataset. Section 4 explains the proposed HOUM.