Skip to main content
QUICK REVIEW

[Paper Review] The Random Forest Classifier in WEKA: Discussion and New Developments for Imbalanced Data

Mario Amrehn, Firas Mualla|arXiv (Cornell University)|Dec 19, 2018
Imbalanced Data Classification TechniquesComputer Science8 references15 citations
TL;DR

This paper proposes a balanced random forest (BRF) classifier extension for the WEKA data mining toolkit to address class imbalance in medical and real-world datasets. By modifying bootstrap sampling to equalize minority and majority class instances per tree, the BRF improves minority class prediction without compromising overall accuracy, outperforming standard RF and weighted RF in cross-validation on imbalanced medical data sets.

ABSTRACT

Data analysis and machine learning have become an integrative part of the modern scientific methodology, providing automated techniques to predict further information based on observations. One of these classification and regression techniques is the random forest approach. Those decision tree based predictors are best known for their good computational performance and scalability. However, in case of severely imbalanced training data, as often seen in medical studies' data with large control groups, the training algorithm or the sampling process has to be altered in order to improve the prediction quality for minority classes. In this work, a balanced random forest approach for WEKA is proposed. Furthermore, the prediction quality of the unmodified random forest implementation and the new balanced random forest version for WEKA are evaluated against reference implementations in R. Two-class problems on balanced data sets and imbalanced medical studies' data are investigated. A superior prediction quality using the proposed method for imbalanced data is shown compared to the other three techniques.

Motivation & Objective

  • To address the poor performance of standard random forest classifiers on imbalanced medical datasets where minority classes are under-predicted.
  • To extend the WEKA framework with a balanced random forest (BRF) classifier that modifies bootstrap sampling to ensure equal representation of minority and majority classes in each tree.
  • To evaluate the BRF's performance against standard RF, weighted RF, and R-based BRF implementations on both imbalanced and balanced datasets.
  • To demonstrate that BRF maintains high overall accuracy while significantly improving true positive rate (TPR) for minority classes in severely imbalanced data.
  • To provide a practical, open-source extension to WEKA that supports fairer classification in real-world applications like medical diagnosis.

Proposed method

  • The BRF classifier modifies the standard random forest bootstrap sampling process by setting the sample size for each class to the size of the minority class, ensuring balanced representation in each tree's training set.
  • For each tree, bootstrap samples are drawn with replacement, but the number of instances per class is capped at the minority class size, preventing over-representation of the majority class.
  • The tree-building process uses information gain for splitting and grows unpruned decision trees, with final predictions based on majority voting across all trees.
  • The implementation integrates into WEKA 3.7.12 by extending the existing Random Forest class, adding a parameter to control class-balanced sampling.
  • Performance is evaluated using 10-fold cross-validation with varying numbers of trees (20, 100, 2000), measuring TPR for majority and minority classes, CCR, and average TPR.
  • Results are compared to standard RF, weighted RF, and R-based BRF implementations to validate consistency and superiority of the proposed method.

Experimental results

Research questions

  • RQ1Does a balanced random forest classifier improve minority class prediction in imbalanced medical datasets compared to standard random forest in WEKA?
  • RQ2How does the proposed BRF implementation in WEKA compare in performance to reference implementations in R and other RF variants?
  • RQ3To what extent does balancing bootstrap sampling during tree training reduce bias toward the majority class in imbalanced data?
  • RQ4Does the BRF maintain high overall accuracy while significantly improving TPR for the minority class?
  • RQ5Can the proposed BRF extension be effectively integrated into the WEKA framework to support fairer machine learning in clinical and real-world applications?

Key findings

  • On the HY1 dataset, the BRF-W variant achieved a minority class TPR of 95.4% with 100 trees and 95.4% with 2,000 trees, significantly outperforming standard RF (88.1% and 86.6%) and BRF-R (92.6% and 91.7%).
  • On the HY2 dataset, BRF-W achieved 97.0% minority TPR with 100 trees and 97.1% with 2,000 trees, surpassing RF-W (88.3% and 88.7%) and RF-R (86.9% and 88.1%).
  • On the ESS dataset, BRF-W achieved 93.5% and 93.9% minority TPR with 100 and 2,000 trees, respectively, outperforming RF-W (90.4% and 89.4%) and RF-R (86.8% and 87.8%).
  • On balanced datasets (SPAM, EG), the BRF-W variant maintained high performance, with TPR_avg of 94.8% and 99.3%, respectively, showing no degradation on balanced data.
  • The average TPR (TPR_avg) for BRF-W was consistently higher than other methods across all imbalanced datasets, with 96.4% on HY1, 97.7% on HY2, and 95.4% on ESS.
  • The proposed BRF in WEKA demonstrated superior performance in minority class prediction while maintaining or slightly reducing overall accuracy, confirming its effectiveness for imbalanced data.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.