## 4 Methodology
### Smote  
As the authors of [31] clearly explain, SMOTE is an over-sampling technique in which the minority class (a class that has fewer instances or samples compared to the majority class) is over-sampled by generating synthetic samples from the already existing ones.  
Through the process of oversampling the minority class, synthetic samples are generated by examining each minority class sample within the dataset. These synthetic samples are inserted along the line segments that connect either some or all of the \(k\) nearest neighbors belonging to the minority class. The selection of random neighbors from the \(k\) nearest neighbors is based on the specific level of oversampling required (the current implementation of SMOTE uses \(k=5\) nearest neighbors as a default value of \(k\)). The process of generating synthetic data samples (Figure 1) begins by selecting a random sample from the minority class and its nearest neighbor. Subsequently, the distance between these two samples is computed and scaled by a random number (gap), which falls within the range of 0 to 1. This calculation is used to create a new sample positioned along the line segment at the determined distance. The synthetic data generated by SMOTE can cause a classifier like the decision tree, or the Naive Bayes, to generalize better.  
Although SMOTE is restricted to only continuous features, the Synthetic Minority Over-sampling Technique-Nominal Continuous (SMOTE-NC) [31] and the Synthetic Minority Over-sampling TEchnique-Nominal (SMOTE-N) [31] are extensions of the original, allowing for the use of a combination of categorical and continuous features.  
SMOTE-NC starts by calculating the median standard deviation of all continuous features within the minority class. This calculation serves to account for any disparities in the categorical features between two samples. Then, the Euclidean distance is calculated between a minority class sample and its \(k\) nearest neighbors. Finally, new synthetic minority class samples are created using the same methodology as described earlier for SMOTE. The new synthetic samples are populated by new values for the continuous features of the minority class, and as for the categorical features, a value is given based on the values of the majority's \(k\) nearest neighbors.  
SMOTE-N discovers the nearest neighbors using the modified value difference metric (MVDM) [33] to measure the dissimilarity or similarity between categorical feature values of the minority class samples, taking into account the class distribution. MVDM addresses some limitations of the original metric (VDM) by incorporating additional features to handle missing values and small sample sizes more effectively. VDM (the traditional version of MVDM) calculates a distance value that represents how different two categorical values are based on their distribution within different classes. Thus, for each class in the dataset, VDM calculates the probability distribution of each categorical value within that class. This involves counting the occurrences of each categorical value within the class and dividing by the total number of instances in that class. Subsequently, for each unique categorical value, VDM calculates the probabilities of occurrence across all classes by calculating the average probability of that value occurring in each class, weighted by the  
Figure 1: A SMOTE example in a 2D feature space. \(A1\) is the randomly selected sample from the minority class, and \(A2\) is its nearest neighbor. \(S1\) is the generated synthetic sample along the line segment of their calculated distance.  
proportion of instances in each class. Finally, for a pair of categorical values from different samples, VDM is calculated as the sum of the absolute differences between their value probabilities across all classes. This accounts for the dissimilarity of the values' distributions with respect to the classes.