# An Oversampling Method for Class Imbalance Problems on Large Datasets
## 3 Proposed Method  
SMOTE is the most widely cited method for addressing the class imbalance problems and has inspired and continues to inspire the development of many oversampling methods [45; 46; 47; 48; 49; 50; 51]. However, SMOTE as well as SMOTE-based methods have poor time performance for large class imbalance problems because all of these methods either require searching for the \(k\)-nearest neighbors or use other time-consuming methods for balancing the minority class. If SMOTE avoided searching the \(k\)-nearest neighbors to generate synthetic objects, this would improve its performance. An alternative to searching for the \(k\)-nearest neighbors in the generation of synthetic objects is that instead of using an object of the minority class each time and selecting one of its \(k\)-nearest neighbors as is done in SMOTE, one object of the minority class is used and the nearest neighbor's selection is performed with a faster method for determining where in the minority class it is necessary to generate the new synthetic object. To generate a new synthetic object, SMOTE uses an object of the minority class and one of its nearest neighbors. In some sense, this is done in order to guarantee that the synthetic object is generated in an object's neighborhood belonging to the minority class. Using the nearest neighbors also aims to guarantee that the synthetic object is located in a region in the minority class because it is computed by generating a value between the values of an object in the minority class and one of its nearest neighbors for each of the features of the synthetic object. Thus, in our proposed method for generating synthetic objects in the minority class, instead of using objects of the minority class, as is done in SMOTE, we will use the mode jointly with the minimum and maximum values in each feature. We tested other central tendencies such as the mean or the median and other statistical dispersion metrics such as the standard deviation or the variance in the proposed method. However, the mode jointly with the minimum and maximum values obtained the best oversampling quality results. To compute the mode for numerical features, we followed [52] (allowing us to compute the mode rapidly) to obtain the minimum and maximum values from a feature and divide the feature's values in the sample in 10 equal-size bins. Then, the mode is computed as described by Equation (1):  
\[mode=l+\frac{f-f_{-1}}{(f-f_{-1})+(f-f_{+1})}*w \tag{1}\]  
where \(l\) is the lower limit of the bin with the highest frequency (\(f\)), \(w\) is the bin size, \(f_{-1}\) is the frequency of the bin preceding the bin with the highest frequency, and \(f_{+1}\) is the frequency of the bin following to the bin with the highest frequency. It is important to highlight that the mode, the minimum, and the maximum can be computed quickly since they can be computed in two scans of the minority class, i.e., computing them for a feature is \(\mathcal{O}(n)\), where \(n\) is the number of objects in the minority class. Thus, the complexity of computing them for all features is \(\mathcal{O}(mn)\), where \(m\) is the number of features. In our method, we propose computing the absolute differences between the mode value and the minimum and maximum values for each feature in the minority class. Then, by subtracting or adding these differences multiplied by a certain random factor to each feature's mode value, it is possible to generate a new synthetic object into the minority class. Similar to SMOTE, our method generates a synthetic object located between the mode (a central tendency measure) of the class and the neighbor objects that are not farther from the mode than the minimum or maximum values. We want to point out that using the minimum and maximum values allows our method to keep the synthetic generated values in the observed value range of the features. Following the idea mentioned above, it is possible to avoid searching for the \(k\)-nearest neighbors, which is the most time-consuming step of SMOTE.