# A Density-Based Random Forest for Imbalanced Data Classification
## 3 Methods
### DBRF Algorithm
\begin{table}
\begin{tabular}{l l c c c c c} \hline  & & **RF** & **DBRF** & **SMOTE + RF** & **b-SMOTE + RF** & **ADASYN + RF** \\ \hline \multirow{3}{*}{A} & metal glass & 3.038 & 8.190 & 4.672 & 4.572 & 4.630 \\  & vehicle evaluation & 0.140 & 0.374 & 0.159 & 0.162 & 0.222 \\  & Haberman’s survival & 0.120 & 0.379 & 0.127 & 0.126 & 0.165 \\ \hline \multirow{3}{*}{B} & glasses0 & 0.120 & 0.380 & 0.131 & 0.131 & 0.153 \\  & glasses1 & 0.123 & 0.409 & 0.131 & 0.130 & 0.148 \\  & glasses5 & 0.114 & 0.381 & 0.126 & 0.125 & 0.143 \\  & Ecoli1 & 0.121 & 0.386 & 0.132 & 0.131 & 0.192 \\  & Ecoli2 & 0.119 & 0.379 & 0.134 & 0.134 & 0.198 \\  & Ecoli3 & 0.118 & 0.381 & 0.140 & 0.138 & 0.202 \\  & Ecoli1-1 & 0.115 & 0.368 & 0.126 & 0.125 & 0.164 \\  & car-good & 0.134 & 0.359 & 0.165 & 0.164 & 0.195 \\  & car-vgood & 0.128 & 0.370 & 0.157 & 0.160 & 0.160 \\  & eleveland & 0.113 & 0.355 & 0.125 & 0.124 & 0.183 \\  & dermatology & 0.117 & 0.357 & 0.128 & 0.126 & 0.146 \\  & page-blocks0 & 0.734 & 1.584 & 0.899 & 0.907 & 0.948 \\  & Vehicle0 & 0.149 & 0.478 & 0.181 & 0.226 & 0.187 \\  & Vehicle1 & 0.176 & 0.505 & 0.206 & 0.248 & 0.210 \\  & Vehicle2 & 0.176 & 0.505 & 0.206 & 0.248 & 0.210 \\  & Vehicle3 & 0.176 & 0.540 & 0.205 & 0.255 & 0.211 \\  & Wisconsin & 0.125 & 0.438 & 0.134 & 0.136 & 0.164 \\  & Yeast1 & 0.185 & 0.544 & 0.214 & 0.280 & 0.225 \\  & Connectionist Bench & 0.165 & 0.531 & 0.215 & 0.235 & 0.219 \\ \hline \multirow{3}{*}{C} & 03 subcl0 & 0.163 & 0.353 & 0.145 & 0.145 & 0.147 \\  & 03 subcl30 & 0.166 & 0.368 & 0.151 & 0.147 & 0.150 \\  & 03 subcl50 & 0.162 & 0.368 & 0.149 & 0.148 & 0.148 \\  & 03 subcl70 & 0.166 & 0.371 & 0.148 & 0.147 & 0.149 \\  & 04 clover0 & 0.164 & 0.360 & 0.147 & 0.147 & 0.148 \\  & 04 clover30 & 0.167 & 0.365 & 0.148 & 0.147 & 0.149 \\  & 04 clover50 & 0.166 & 0.366 & 0.151 & 0.150 & 0.150 \\  & 04 clover70 & 0.168 & 0.369 & 0.151 & 0.149 & 0.150 \\  & paw0 & 0.151 & 0.349 & 0.145 & 0.146 & 0.146 \\  & paw30 & 0.165 & 0.364 & 0.149 & 0.147 & 0.148 \\  & paw50 & 0.167 & 0.370 & 0.149 & 0.148 & 0.149 \\  & paw70 & 0.168 & 0.369 & 0.149 & 0.149 & 0.151 \\ \hline \end{tabular}
\end{table} 
Table 4: Average time spent by the RF, DBRF, SMOTE + RF, b-SMOTE + RF, and ADASYN + RF training datasets. The results are in seconds. \begin{table}
\begin{tabular}{l l c c c c} \hline  & **Comparison** & **W+** & **W\(-\)** & **\(p\)-Value** & **Hypothesis (0.05)** \\ \hline \multirow{3}{*}{F1} & DBRF vs. RF & 370 & 191 & \(3.89\times 10^{-4}\) & Rejected \\  & DBRF vs. SMOTE + RF & 492 & 69 & \(6.64\times 10^{-7}\) & Rejected \\  & DBRF vs. b-SMOTE+ RF & 498 & 63 & \(4.62\times 10^{-7}\) & Rejected \\  & DBRF vs. ADASYN + RF & 507 & 54 & \(2.65\times 10^{-7}\) & Rejected \\ \hline \multirow{3}{*}{GM} & DBRF vs. RF & 553 & 8 & \(1.32\times 10^{-8}\) & Rejected \\  & DBRF vs. SMOTE + RF & 351 & 210 & \(8.81\times 10^{-4}\) & Rejected \\  & DBRF vs. b-SMOTE+ RF & 343 & 218 & \(1.23\times 10^{-3}\) & Rejected \\  & DBRF vs. ADASYN + RF & 331 & 230 & \(1.98\times 10^{-3}\) & Rejected \\ \hline \end{tabular}
\end{table} 
Table 5: Results of the Wilcoxon signed-rank test for F1 and GM of 34 datasets. W+ represents the positive differential rank sum. W\(-\) represents the negative differential rank sum. ## 5 Discussion

Despite its performance, DBRF has the following limitations:

1. Parameter setting problem. DBRF has two parameters, \(\eta\) and \(p\). Figures 4-6 show that different parameters need to be set for different datasets. If \(\eta\) is too large, the density domain will have all samples in the dataset. This results in the failure of DBRF to classify the minority class. Choosing which parameters to use to train the model requires some tuning experience;
2. Questions about datasets. For this question, there are two main problems: **(a)** Time-consuming problem. DBRF can effectively train large datasets, but it takes much time in the training process. Metal glass is a dataset with 98 features and 5936 samples. It is the largest of the 34 datasets.