Skip to main content
QUICK REVIEW

[Paper Review] Evaluating XGBoost for Balanced and Imbalanced Data: Application to Fraud Detection

Gissel Velarde, Anindya Sudhir|arXiv (Cornell University)|Mar 27, 2023
Imbalanced Data Classification TechniquesComputer Science3 citations
TL;DR

This paper evaluates XGBoost's performance on fraud detection across balanced and imbalanced datasets, using a standardized pipeline with data preprocessing and random search hyperparameter tuning. Results show that model performance improves with larger datasets but degrades significantly under high class imbalance, and data sampling to balance training sets does not consistently improve detection metrics.

ABSTRACT

This paper evaluates XGboost's performance given different dataset sizes and class distributions, from perfectly balanced to highly imbalanced. XGBoost has been selected for evaluation, as it stands out in several benchmarks due to its detection performance and speed. After introducing the problem of fraud detection, the paper reviews evaluation metrics for detection systems or binary classifiers, and illustrates with examples how different metrics work for balanced and imbalanced datasets. Then, it examines the principles of XGBoost. It proposes a pipeline for data preparation and compares a Vanilla XGBoost against a random search-tuned XGBoost. Random search fine-tuning provides consistent improvement for large datasets of 100 thousand samples, not so for medium and small datasets of 10 and 1 thousand samples, respectively. Besides, as expected, XGBoost recognition performance improves as more data is available, and deteriorates detection performance as the datasets become more imbalanced. Tests on distributions with 50, 45, 25, and 5 percent positive samples show that the largest drop in detection performance occurs for the distribution with only 5 percent positive samples. Sampling to balance the training set does not provide consistent improvement. Therefore, future work will include a systematic study of different techniques to deal with data imbalance and evaluating other approaches, including graphs, autoencoders, and generative adversarial methods, to deal with the lack of labels.

Motivation & Objective

  • To evaluate XGBoost's detection performance across varying dataset sizes and class distributions, from balanced to highly imbalanced.
  • To assess the impact of random search hyperparameter tuning on XGBoost performance across different dataset scales.
  • To investigate whether data sampling techniques (e.g., balancing training sets) improve detection performance on imbalanced data.
  • To compare the effectiveness of vanilla XGBoost versus tuned XGBoost under varying data conditions.
  • To identify limitations of traditional evaluation metrics like accuracy in imbalanced settings and advocate for precision, recall, and F-scores.

Proposed method

  • Applied a standardized preprocessing pipeline: min-max scaling of numerical features and categorical encoding with reserved values for unseen categories.
  • Used 1K, 10K, and 100K sample datasets with class distributions of 50%-50%, 45%-55%, 25%-75%, and 5%-95% positive samples.
  • Trained both vanilla XGBoost and XGBoost models tuned via random search over hyperparameters including learning rate, max depth, and subsample.
  • Evaluated models using confusion matrix-based metrics: precision, recall, F1-score, and Matthews Correlation Coefficient (MCC).
  • Applied synthetic sampling (e.g., oversampling minority class) to balance training sets while preserving original test set distributions.
  • Repeated experiments across multiple random seeds to ensure robustness and reported average performance metrics.
Figure 1: Examples of possible distributions for balanced and imbalanced datasets.
Figure 1: Examples of possible distributions for balanced and imbalanced datasets.

Experimental results

Research questions

  • RQ1How does XGBoost performance vary with increasing dataset size under different class imbalances?
  • RQ2Does random search hyperparameter tuning consistently improve XGBoost performance across small, medium, and large datasets?
  • RQ3Does balancing the training set via sampling improve detection performance on highly imbalanced datasets?
  • RQ4Which evaluation metrics (e.g., F1, precision, recall) are most reliable for assessing fraud detection systems in imbalanced settings?
  • RQ5How do traditional metrics like accuracy mislead in the context of highly imbalanced fraud detection data?

Key findings

  • XGBoost performance improves significantly with larger datasets, with the highest detection performance observed at 100K samples.
  • Random search hyperparameter tuning consistently improved performance on the 100K dataset but provided no consistent benefit on 1K or 10K datasets.
  • Detection performance deteriorated as class imbalance increased, with the largest drop in F1-score occurring at the 5%-95% positive-negative distribution.
  • Sampling to balance the training set improved recall but reduced precision, leading to unrealistic F1 scores, especially at 75%-25% and 95%-5% distributions.
  • Vanilla XGBoost and random search-tuned XGBoost showed no consistent improvement when sampling was applied, indicating limited utility of this approach in this setup.
  • Accuracy was found to be misleading in imbalanced settings, while F1, precision, and recall provided more reliable performance assessment.
Figure 2: Example of a tree ensemble model with two trees. Decision nodes are oval and leaf nodes are rectangular. Each tree contributes to the final prediction.
Figure 2: Example of a tree ensemble model with two trees. Decision nodes are oval and leaf nodes are rectangular. Each tree contributes to the final prediction.

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.