Comparison of random forest and xgboost algorithms in credit card fraud classification
DOI:
https://doi.org/10.37859/coscitech.v6i3.10470
Abstract
Credit card fraud is a serious issue that can cause significant losses for both consumers and financial service providers. Therefore, a reliable and accurate fraud detection system is essential. The research adopts the CRISP-DM methodology, which includes six phases: Business Understanding, Data Understanding, Data Preparation, Modeling, Evaluation, and Deployment. The dataset used was obtained from the Kaggle platform, consisting of 1,048,574 rows and 23 Features, including transaction amount, merchant category, location, and customer attributes. Model evaluation was conducted using a Confusion Matrix with accuracy, precision, recall , and F1-score as performance metrics. The evaluation results indicate that Xgboost outperforms Random Forest, achieving an accuracy of 99.19%, precision of 98.73%, recall of 99.66%, and F1-score of 99.19%. In comparison, Random Forest achieved an accuracy of 97.68%, precision of 97.38%, recall of 98.01%, and F1-score of 97.69%. These results demonstrate that Xgboost is more effective in consistently identifying fraud ulent transactions. Furthermore, this study successfully developed a web-based application using the Streamlit framework, integrating both models interactively to allow users to input data and obtain classification results in real time. Thus, this study has successfully achieved three main objectives: identifying the most suitable algorithm for fraud classification, thoroughly evaluating model performance, and developing an application as a decision support system for credit card fraud detection.
Downloads
References
E. Ileberi and Y. Sun, “Advancing Model Performance With ADASYN and Recurrent Feature Elimination and Cross-Validation in Machine Learning-Assisted Credit Card Fraud Detection: A Comparative Analysis,” IEEE Access, vol. 12, pp. 133315–133327, 2024, doi: 10.1109/ACCESS.2024.3457922.
F. K. Alarfaj, I. Malik, H. U. Khan, N. Almusallam, M. Ramzan, and M. Ahmed, “Credit Card Fraud Detection Using State-of-the-Art Machine Learning and Deep Learning Algorithms,” IEEE Access, vol. 10, pp. 39700–39715, 2022, doi: 10.1109/ACCESS.2022.3166891.
T. H. Lin and J. R. Jiang, “Credit card fraud detection with autoencoder and probabilistic random forest,” Mathematics, vol. 9, no. 21, Nov. 2021, doi: 10.3390/math9212683.
B. Via Tarissa and T. Dewayanto, “PENERAPAN MACHINE LEARNING DAN DEEP LEARNING PADA PENINGKATAN DETEKSI CREDIT CARD FRAUD-A SYSTEMATIC LITERATURE REVIEW,” DIPONEGORO JOURNAL OF ACCOUNTING, vol. 13, no. 3, pp. 1–15, 2024, [Online]. Available: http://ejournal-s1.undip.ac.id/index.php/accounting
Reva Geryansyah Afqal, “Analisis Deteksi dan Pencegahan Penipuan Kartu Kredit Menggunakan Teknik Data Mining dan Machine Learning,” Reva Geryansyah Afqal, no. Analisis Deteksi dan Pencegahan Penipuan Kartu Kredit Menggunakan Teknik Data Mining dan Machine Learning, 2023.
S. Nurohanisah, R. Astuti, and F. M. Basysyar, “DETEKSI BERITA PALSU MENGGUNAKAN ALGORITMA RANDOM FOREST,” 2024.
M. Mounika, D. Aravinda, and B. Ramesh, “Journal of Cardiovascular Disease Research Credit Card Fraud Detection using Random Forest Algorithm.”
S. Thongsuwan, S. Jaiyen, A. Padcharoen, and P. Agarwal, “ConvXGB: A new deep learning model for classification problems based on CNN and XGBoost,” Nuclear Engineering and Technology, vol. 53, no. 2, pp. 522–531, Feb. 2021, doi: 10.1016/j.net.2020.04.008.
A. Fitriani and D. B. Arianto, “Sustainabilty Accounting and Finance Journal Audit Risk: Machine Learning Untuk Klasifikasi Kecurangan Pada Perusahaan.” [Online]. Available: https://journal.umbandung.ac.id/index.php/safj
O. Raju, “CREDIT CARD FRAUD DETECTION USINGXGBOOSTCLASSIFIER,” International Journal of Techno-Engineering, vol. 8, no. 3, Mar. 2021.
R. Faizal, A. Abdullah, and M. W. Pangestika, “Perbandingan Random Forest Regressor Dan Decision Tree Regressor Untuk Prediksi Hasil Panen,” vol. 6, no. 2, pp. 247–253, 2025, doi: 10.37859/coscitech.v6i2.9966.










