Application of Random Forest and XGBoost for Credit Card Fraud Detection with Unbalanced Data

Authors

  • Hafid Universitas Amikom Yogyakarta Author

Keywords:

fraud detection, credit card, random forest, XGBoost, Machine Learning

Abstract

Credit card fraud detection is a very important issue in electronic transaction security, especially due to the significant class imbalance between fraudulent and non- fraudulent transactions. This study aims to explore the application of two machine learning algorithms, namely Random Forest and XGBoost, in detecting fraudulent transactions on a highly imbalanced credit card dataset. The dataset used consists of credit card transactions involving more than 284,000 transactions, with only about 0.172% of them being fraudulent. The features used in these models have been processed using Principal Component Analysis (PCA) to reduce dimensionality and improve computational efficiency. Both models are evaluated using metrics such as precision, recall, F1-score, and confusion matrix to measure their performance in detecting fraud. The experimental results show that XGBoost manages to provide better performance in terms of recall and F1-score for detecting fraudulent transactions compared to Random Forest. Although the accuracy of both models is very high, XGBoost shows better ability in handling class imbalance, with higher recall in the fraud class. The findings provide insights into the effectiveness of machine learning algorithms in solving fraud detection problems that are often hampered by data imbalance, as well as their contribution to improving the security system of credit card- based financial transactions.

Downloads

Download data is not yet available.

Downloads

Published

2024-12-31