Credit Card Fraud Detection Using Random Forest and XGBoost on a Public Kaggle Dataset
Keywords:
Credit Card Fraud, Random Forest, Xgboost, Class Imbalance, Ensemble LearningAbstract
Credit card fraud detection remains a critical challenge in digital financial ecosystems characterized by extreme class imbalance and evolving attack patterns. This study adopts an empirical experimental design to evaluate and compare Random Forest and XGBoost models using the publicly available Kaggle Credit Card Fraud Detection dataset. A controlled pipeline incorporating stratified data splitting, SMOTE-based imbalance mitigation, and GridSearchCV hyperparameter optimization was implemented to ensure methodological consistency and reproducibility. Performance was assessed through precision, recall, F1-score, ROC-AUC, confusion matrix analysis, and computational efficiency metrics. Results indicate that XGBoost outperformed Random Forest in recall, F1-score, and ROC-AUC, demonstrating enhanced minority-class discrimination and reduced false negatives under optimized conditions. Random Forest exhibited competitive precision and interpretability transparency, though with slightly lower sensitivity. Scalability evaluation confirmed that both models maintained low inference latency suitable for near-real-time deployment. The findings highlight the critical role of imbalance handling and parameter optimization in ensemble-based fraud detection and support boosting-oriented approaches as strategically advantageous for operational financial security systems.
Downloads
References
Abdullah, A., & Pangestika, M. W. (2025). Comparison Of Random Forest And Xgboost Algorithms In Credit Card Fraud Classification. Jurnal CoSciTech (Computer Science and Information Technology), 6(3), 392-398.
Airlangga, G. (2024). Evaluating the efficacy of machine learning models in credit card fraud detection. Journal of Computer Networks, Architecture and High Performance Computing, 6(2), 829-837.
Alkhozae, M., Almasre, M., Almakky, A., Alhebshi, R. M., Alamri, A., Hakami, W., & Alshahrani, L. (2025). An Explainable Credit Card Fraud Detection Model using Machine Learning and Deep Learning Approaches. Journal of Applied Data Sciences, 6(4), 2838-2857.
Baisholan, N., Dietz, J. E., Gnatyuk, S., Turdalyuly, M., Matson, E. T., & Baisholanova, K. (2025). A Systematic review of machine learning in credit card fraud detection under original class imbalance. Computers, 14(10), 437.
Btoush, E. A. L. M., Zhou, X., Gururajan, R., Chan, K. C., & Alsodi, O. (2025). Enhancing credit card fraud detection with a stacking-based hybrid machine learning approach. PeerJ Computer Science, 11, e3007.
Btoush, E. A. L. M., Zhou, X., Gururajan, R., Chan, K. C., Genrich, R., & Sankaran, P. (2023). A systematic review of literature on credit card cyber fraud detection using machine and deep learning. PeerJ Computer Science, 9, e1278.
Faraji, Z. (2022). A Review of Machine Learning Applications for Credit Card Fraud Detection with A Case study. Seisense Journal of Management, 5(1).
Fikri, M., Handoyo, L. T., Hanafi, S., & Tambunan, T. S. (2026). Innovation Capability and Business Growth in Culinary Small Enterprises: A Management Perspective. Journal of Management, Entrepreneurship, and Tourism, 1(1), 31-40.
Firdaus, E. A., Manurung, J., Saragih, H., & Prabukusumo, M. A. (2025). Optimization of XGBoost hyperparameters using grid search and random search for credit card default prediction. Jurnal Mandiri IT, 14(2), 269-280.
Ghaleb, F. A., Saeed, F., Al-Sarem, M., Qasem, S. N., & Al-Hadhrami, T. (2023). Ensemble synthesized minority oversampling-based generative adversarial networks and random forest algorithm for credit card fraud detection. IEEE Access, 11, 89694-89710.
Gupta, P., Varshney, A., Khan, M. R., Ahmed, R., Shuaib, M., & Alam, S. (2023). Unbalanced credit card fraud detection data: A machine learning-oriented comparative study of balancing techniques. Procedia Computer Science, 218, 2575-2584.
Hajek, P., Abedin, M. Z., & Sivarajah, U. (2023). Fraud detection in mobile payment systems using an XGBoost-based framework. Information Systems Frontiers, 25(5), 1985-2003.
Hashemi, S. K., Mirtaheri, S. L., & Greco, S. (2022). Fraud detection in banking data by machine learning techniques. Ieee Access, 11, 3034-3043.
Kandi, K., & García-Dopico, A. (2025). Enhancing performance of credit card model by utilizing LSTM networks and XGBoost algorithms. Machine Learning and Knowledge Extraction, 7(1), 20.
Khan, M. A., Ahsan, K., Rodrigues, R., Hussain, M. A., & Khan, R. (2025). Review Of Machine Learning Algorithms In Detecting Credit Card Fraud: Techniques And Trends. Spectrum of Engineering Sciences, 1209-1227.
Leonidas, T., Alexandra, T., Anastasios, T., & Constantinos, H. (2025). Big Data-Driven Distributed Machine Learning for Scalable Credit Card Fraud Detection Using PySpark, XGBoost, and CatBoost. Electronics, 14(9), 1754.
Mallidi, M. K. R., & Zagabathuni, Y. (2021). Analysis of Credit Card Fraud detection using Machine Learning models on balanced and imbalanced datasets. International Journal of Emerging Trends in Engineering Research, 9(7).
Nti, I. K., & Somanathan, A. R. (2022). A scalable RF-XGBoost framework for financial fraud mitigation. IEEE Transactions on Computational Social Systems, 11(2), 1556-1563.
Pratama, S. F., & Wahid, A. M. A. (2025). Fraudulent transaction detection in online systems using random forest and gradient boosting. Journal of Cyber Law, 1(1), 88-115.
Qazi, A. B., Nagra, A. A., Farooq, K., Yousif, M., & Zia, M. H. (2025). Securing Financial Transactions: Leveraging Random Forest for Credit Card Fraud Detection. UCP Journal of Engineering & Information Technology, 3(1), 01-08.
Qi, R. (2025). An empirical study on credit risk assessment using machine learning: Evidence from the kaggle credit card fraud detection dataset. Journal of Computer, Signal, and System Research, 2(5), 48-64.
Rahmadani, A., Zacky, M., & Michael, J. P. (2025). Classification of a credit card fraud detection model using XGBoost with SMOTE and GridSearchCV optimization. IJATIS: Indonesian Journal of Applied Technology and Innovation Science, 2(2), 104-115.
Reddy, S. S., Amrutha, K., Mnssvkr Gupta, V., Vssr Murthy, K., & Rao, V. V. R. M. (2025). Optimizing hyperparameters for credit card fraud detection with nature-inspired metaheuristic algorithms in machine learning. Journal of The Institution of Engineers (India): Series B, 106(6), 2005-2030.
Sharma, B. K. (2025). Development in Machine Learning (ML) Algorithms for Fraudulent Identification in Banking Sector Via Credit Cards. Journal of Global Research in Electronics and Communication, 1(8).
Siam, A. M., Bhowmik, P., & Uddin, M. P. (2025). Hybrid feature selection framework for enhanced credit card fraud detection using machine learning models. PLoS One, 20(7), e0326975.
Tayebi, M., & El Kafhali, S. (2025). A novel approach based on XGBoost classifier and Bayesian optimization for credit card fraud detection. Cyber Security and Applications, 3, 100093.
Theodorakopoulos, L., Theodoropoulou, A., Tsimakis, A., & Halkiopoulos, C. (2025). Big data-driven distributed machine learning for scalable credit card fraud detection using PySpark, XGBoost, and CatBoost. Electronics, 14(9), 1754.








