# A Density-Based Random Forest for Imbalanced Data Classification
## 3 Methods
### DBRF Algorithm
**

## 4 Experimental Setup and Results' Analysis

### Experimental Dataset

In this study, imbalanced datasets from different areas were used to evaluate the DBRF algorithm with three categories of data. Dataset (A) contained metal glass, vehicle evaluation, and [PERSON]'s survival. The metal glass data were obtained from [34]. The vehicle evaluation and [PERSON]'s survival data were obtained from the UCI open database [35]. Dataset (B) contained a combination of 19 real datasets. Dataset (C) contained 12 synthetic datasets. The 19 real datasets and 12 synthetic datasets were obtained from the Keel database [36]. For Dataset (A), vehicle assessment and [PERSON]'s survival were classified into two categories. The metal glass data were classified into three categories--crystalline alloy (CRA), ribbon metallic glass (RMG), and bulk metallic glass (BMG)--in a ratio of 6:3:1. BMG has excellent material properties, whereas the others do not, such as wear resistance and high yield strength [34; 37; 38; 39]. Therefore, we focused more on BMGs. For Dataset (B), each of the 19 real datasets was a two-category dataset, and the imbalance ratio was distributed from 1.82 to 25.58. For each of the datasets, the number of samples ranged from 173 to 5472. For Dataset (C), the 12 synthetic datasets were divided into three categories: clover, paw, and subclus. To increase the classification difficulty, the degree of confusion in the minority and majority classes in each category was increased by 30%, 50%, and 70%, respectively. Each dataset was a two-category dataset with 800 samples, and the imbalance ratio was 1:7. The detailed information of the datasets is shown in Table 1, including the imbalance ratio, sample size, number of minority classes, dataset names, number of features, and number of majority classes. The experimental environment was Windows 10, 64 bit edition, with Python 3.7.7, sklearn 0.23.2, pandas 1.0.5, and imblearn 0.7.0. ### Algorithm Evaluation Indicators

The performance metrics compared in this study were principally the overall accuracy rate (_accuracy_), recall, precision, F1-measure (F1), and G-mean (GM). Ten-fold cross evaluation was performed for each dataset. F1 is based on the harmonic average of recall and precision. GM attempts to maximize the accuracy of each class while maintaining a balance of accuracy. For imbalanced data, it is typically inadvisable to evaluate the performance of classifier models in terms of accuracy. In Equation (8), \(m\) represents the total number of categories. F1 and GM are unbiased evaluation indicators for imbalanced classification. In imbalanced classification tasks, F1 and GM can better evaluate model performance compared to accuracy, recall, and precision; therefore, we mainly compared F1 and GM. Table 2 shows the confusion matrix used in the two-class classification in this experiment [40]. True positive (_TP_) indicates the number of samples in which the original class and predicted class are both minority classes. False positive (_FP_) indicates the number of samples in which the original class is a majority class, whereas the predicted class is a minority class. True negative (_TN_) indicates the number of samples in which the original class and the predicted class are both majority classes. False negative (_FN_) indicates the number of samples in which original class is the minority class, whereas the predicted class is the majority. \[Accuracy=\frac{TP+TN}{TP+TN+FP+FN} \tag{4}\]

\[Precision=\frac{TP}{TP+FP} \tag{5}\]

\[Recall=\frac{TP}{TP+FN} \tag{6}\]