## 4 Experimental Study  
A wide comparative study has been conducted, in which 40 different datasets have been preprocessed with seven resampling methods. The aim of the study was to determine the factors influencing classifier performance for each sampling strategy after analyzing the results obtained from all metrics referred in the previous section. Original imbalanced datasets were treated in order to reduce their imbalance ratio by means of the following resampling strategies: RUS, ROS, SMOTE and SMOTE combined with OSS, CNN, ENN and TL (T-Link). The percentage used for over sampling was 500% and for undersampling (RUS) 50%. The choice of these values was made after performing some previous experiments and taking into account different criteria. On the one hand, these rates should not be too high to avoid overfitting in the case of oversampling and loss of information in the case of undersampling, and on the other hand, to ensure that the resampling is effective for classification purposes. Working with different values of these rates would have resulted in an unmanageable volume of results due to the number of datasets, resampling methods, evaluation metrics and variables involved in the study. Resampling was performed by using the R unbalanced package ([[https://cran.r-project.org/web/packages/unbalanced/](https://cran.r-project.org/web/packages/unbalanced/)]([https://cran.r-project.org/web/packages/unbalanced/](https://cran.r-project.org/web/packages/unbalanced/)), last accessed: 6 September 2021), setting k = 6 for SMOTE, k = 1 for CNN and K = 3 for ENN.Random forest (RF) [78] was the machine learning algorithm chosen for inducing the models to be analyzed. We have included only this algorithm in the study since it provided the best results in a previous work [79] where other methods (k-nearest neighbor, naive Bayes, support vector machine, random forest, J48 and C5.0) were applied for imbalanced data classification. Besides, the behavior of all of them, with the exception of naive Bayes, was very similar regarding increasing/decreasing of quality metric values for the sampling methods tested in the work. Since the study and report of results of all the algorithms would give an article with an excessive extension, random forest was used to induce predictive models from both original and resampled datasets. Specifically, we make use of the RF implementation given in the random forest package by [PERSON] and [PERSON] ([[https://cran.r-project.org/web/packages/randomForest](https://cran.r-project.org/web/packages/randomForest)]([https://cran.r-project.org/web/packages/randomForest](https://cran.r-project.org/web/packages/randomForest)), last accessed: 6 September 2021) with mtry tuning parameter. It was done through the caret R package ([[https://github.com/topepo/caret/](https://github.com/topepo/caret/)]([https://github.com/topepo/caret/](https://github.com/topepo/caret/)), last accessed: 6 September 2021). The ntree parameter of the train function was set to 100 and tuneLength parameter for automatic tuning of RF hyperparameters was set to 7. To calculate the percentages of overlapping and borderline examples, we applied the metrics defined in [80,81] and implemented in the EcoL Library in R ([[https://github.com/lpfgarcia/ECoL/](https://github.com/lpfgarcia/ECoL/)]([https://github.com/lpfgarcia/ECoL/](https://github.com/lpfgarcia/ECoL/)), last accessed: 6 September 2021). For overlapping, the maximum Fisher's discriminant ratio is used, which measures the overlap between the values of the features and takes the value of the largest discriminant ratio among all the available features. The borderline measure is the fraction of points that are either on the border or in overlapping areas between the classes. It is necessary to build a minimum spanning tree (MST) from data to compute this metric [81]. The validation of the models was performed by means of the metrics included in the previous section.