Analisis Perbandingan Random Forest dan XGBoost dalam Prediksi Pembatalan Pesanan Shopee Menggunakan Interpretasi SHAP
Abstract
Order cancellation is a significant issue for e-commerce platforms because it can result in revenue loss, increased operational costs, and reduced transaction management efficiency. This study aims to compare the performance of Random Forest and Extreme Gradient Boosting (XGBoost) in predicting customer order cancellations on Shopee and to interpret the factors contributing to the prediction outcomes using an Explainable Artificial Intelligence approach based on SHapley Additive exPlanations (SHAP). The study employed the Shopee Consumer Behaviour Cancellation Order Analysis dataset obtained from Kaggle. The research process consisted of data preprocessing, dataset partitioning using the Stratified Train-Test Split method with an 80:20 ratio, implementation of both algorithms, model evaluation using Accuracy, Precision, Recall, F1-Score, and Receiver Operating Characteristic–Area Under Curve (ROC-AUC), followed by model interpretation using SHAP. The evaluation results indicate that Random Forest achieved better performance across most evaluation metrics, while XGBoost obtained a slightly higher ROC-AUC value. SHAP analysis identified Total Discount, Buyer-Paid Shipping Cost, Estimated Shipping Cost, and Estimated Shipping Fee Deduction as the variables contributing most to order cancellation predictions.These findings indicate that combining predictive algorithms with an Explainable Artificial Intelligence approach not only supports the classification of order cancellations but also provides insights into the factors influencing prediction outcomes, which can serve as a consideration for reducing order cancellations on e-commerce platforms.
Downloads
References
R. Fandiyanto et al., “Perkembangan E-Commerce Dari Masa Ke Masa: Sejarah, Tren, Dan Faktor-Faktor Yang Memengaruhi Kemajuan Transaksi Online Di Indonesia,” Jurnal Mahasiswa Entrepreneurship (JME), vol. 4, no. 3, p. 448, 2025, doi: 10.36841/jme.v4i3.6574.
Z. Alamin, R. Missouri, S. Sutriawan, F. Fathir, and K. Khairunnas, “Perkembangan E-commerce: Analisis Dominasi Shopee sebagai Primadona Marketplace di Indonesia,” J-ESA (Jurnal Ekonomi Syariah), vol. 6, no. 2, pp. 120–131, 2023, doi: 10.52266/jesa.v6i2.2484.
A. M. Hikmah, M. Mahmud, and T. A. Darodjat, “Modeling the Drivers of Online Purchase Decisions: An Empirical Study of Shopee Users in Indonesia,” International Journal Of Accounting, Management, And Economics Research, vol. 3, no. 1, pp. 77–95, Oct. 2025, doi: 10.56696/ijamer.v3i1.164.
K. ŞAHİNBAŞ, “Predicting Order Cancellations for E-Commerce Domain: A Proposed Model Based on Retailing Experience,” İnsan ve Toplum Bilimleri Araştırmaları Dergisi, vol. 11, no. 3, pp. 1493–1514, Sep. 2022, doi: 10.15869/itobiad.1127578.
I. Boukrouh and A. Azmani, “Explainable machine learning models applied to predicting customer churn for e-commerce,” IAES International Journal of Artificial Intelligence, vol. 14, no. 1, pp. 286–297, 2025, doi: 10.11591/ijai.v14.i1.pp286-297.
R. Alamsyah, “Using Random Forest and Support Vector Machine Algorithms to Predict Online Shopper Purchase Intention from E-Commerce Session Data,” International Journal for Applied Information Management, vol. 4, no. 2, pp. 84–96, Jun. 2024, doi: 10.47738/ijaim.v4i2.81.
Z. S. Sarı, B. Taşkapı, G. Dağdaş, and M. F. Akay, “Development of Machine Learning-Based Sales Cancellation/Return Forecasting Models for the E-Commerce Industry,” in International Conference on Advances in Electrical-Electronics Engineering and Computer Science Proceedings, SETSCI, Nov. 2024, pp. 17–21. doi: 10.36287/setsci.19.5.022.
Angelin and S. A. Sanjaya, “Minimizing E-commerce Order Cancellation Cost Using Shap-based Explainable XGBoost,” in 2025 4th International Conference on Smart Cities, Automation & Intelligent Computing Systems (ICON-SONICS), IEEE, Oct. 2025, pp. 164–169. doi: 10.1109/ICON-SONICS67145.2025.11309270.
R. E. Bawack, S. F. Wamba, K. D. A. Carillo, and S. Akter, “Artificial intelligence in E-Commerce: a bibliometric study and literature review,” Electronic Markets, vol. 32, no. 1, pp. 297–338, Mar. 2022, doi: 10.1007/s12525-022-00537-z.
P. Chugh and V. Jain, “Artificial Intelligence (AI) Empowerment in E-Commerce: A Bibliometric Voyage,” NMIMS Management Review, vol. 32, no. 3, pp. 159–173, Sep. 2024, doi: 10.1177/09711023241303621.
J. A. Bastos and M. I. Bernardes, “Understanding Online Purchases with Explainable Machine Learning,” Information, vol. 15, no. 10, p. 587, Sep. 2024, doi: 10.3390/info15100587.
R. Maulidia and W. Yustanti, “Implementation of the Support Vector Machine (SVM) Algorithm in Predicting Transaction Cancellations at Shopee E-commerce,” Journal of Emerging Information Systems and Business Intelligence (JEISBI), vol. 6, no. 1, Apr. 2025, doi: 10.26740/jeisbi.v6i1.64414.
F. N. F. Insani and Denny, “Optimizing E-Commerce in Indonesia: Ensemble Learning for Predicting Potential Buyers,” Indonesian Journal of Computer Science, vol. 13, no. 1, Feb. 2024, doi: 10.33022/ijcs.v13i1.3690.
D. Amanda Ardhani and K. D. Tania, “Knowledge Discovery on E-Commerce Customer Churn Using Interpretable Machine Learning: A Comparative Study of SHAP-Based Classifiers,” Journal of Applied Informatics and Computing, vol. 9, no. 5, pp. 2695–2702, Oct. 2025, doi: 10.30871/jaic.v9i5.10811.
Christoph Molnar, Interpretable Machine Learning: A Guide for Making Black Box Models Explainable, 3rd ed. Christoph Molnar, 2025. [Online]. Available: https://christophm.github.io/interpretable-ml-book/
G. Vilone and L. Longo, “Notions of explainability and evaluation approaches for explainable artificial intelligence,” Information Fusion, vol. 76, pp. 89–106, Dec. 2021, doi: 10.1016/j.inffus.2021.05.009.
J. Brasse, H. R. Broder, M. Förster, M. Klier, and I. Sigler, “Explainable artificial intelligence in information systems: A review of the status quo and future research directions,” Electronic Markets, vol. 33, no. 1, p. 26, Dec. 2023, doi: 10.1007/s12525-023-00644-5.
W. Priatna, Hindriyanto Dwi Purnomo, Ade Iriani, Irwan Sembiring, and Theophilus Wellem, “Optimizing Multilayer Perceptron with Cost-Sensitive Learning for Addressing Class Imbalance in Credit Card Fraud Detection,” Jurnal RESTI (Rekayasa Sistem dan Teknologi Informasi), vol. 8, no. 4, pp. 563–570, Aug. 2024, doi: 10.29207/resti.v8i4.5917.
N. Kiesler et al., “Where’s the Data? Finding and Reusing Datasets in Computing Education,” in Working Group Reports on 2023 ACM Conference on Global Computing Education, New York, NY, USA: ACM, Sep. 2024, pp. 31–60. doi: 10.1145/3598579.3689378.
J. Hu and S. Szymczak, “A review on longitudinal data analysis with random forest,” Brief. Bioinform., vol. 24, no. 2, Mar. 2023, doi: 10.1093/bib/bbad002.
J. H. Cabot and E. G. Ross, “Evaluating prediction model performance,” Surgery, vol. 174, no. 3, pp. 723–726, Sep. 2023, doi: 10.1016/j.surg.2023.05.023.
M. Li, H. Sun, Y. Huang, and H. Chen, “Shapley value: from cooperative game to explainable artificial intelligence,” Autonomous Intelligent Systems, vol. 4, no. 1, p. 2, Feb. 2024, doi: 10.1007/s43684-023-00060-8.
M. Asfi, B. Warsito, and A. Wibowo, “Enhancing Explainable AI: Leveraging SHAP for Transparent Decision-Making in Machine Learning,” in 2024 Ninth International Conference on Informatics and Computing (ICIC), IEEE, Oct. 2024, pp. 1–6. doi: 10.1109/ICIC64337.2024.10956244.
F. Le and J. Zhai, “Research on cross-border e-commerce customer churn prediction based on enhanced XGBoost algorithm with temporal-spatial features,” Journal of Computational Methods in Sciences and Engineering, vol. 25, no. 5, pp. 4407–4418, Sep. 2025, doi: 10.1177/14727978251337888.
Y. Chen, H. Liu, Z. Wen, and W. Lin, “How Explainable Machine Learning Enhances Intelligence in Explaining Consumer Purchase Behavior: A Random Forest Model with Anchoring Effects,” Systems, vol. 11, no. 6, p. 312, Jun. 2023, doi: 10.3390/systems11060312.
J. A. Bastos and M. I. Bernardes, “Understanding Online Purchases with Explainable Machine Learning,” Information, vol. 15, no. 10, p. 587, Sep. 2024, doi: 10.3390/info15100587.
Bila bermanfaat silahkan share artikel ini
Berikan Komentar Anda terhadap artikel Analisis Perbandingan Random Forest dan XGBoost dalam Prediksi Pembatalan Pesanan Shopee Menggunakan Interpretasi SHAP
Pages: 820-832
Copyright (c) 2026 Muhammad Bayu Samudra, Mira Afrina, Allsela Meiriza, Rizka Dhini Kurnia, Ardina Ariani

This work is licensed under a Creative Commons Attribution 4.0 International License.
Authors who publish with this journal agree to the following terms:
- Authors retain copyright and grant the journal right of first publication with the work simultaneously licensed under Creative Commons Attribution 4.0 International License that allows others to share the work with an acknowledgment of the work's authorship and initial publication in this journal.
- Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the journal's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgment of its initial publication in this journal.
- Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work (Refer to The Effect of Open Access).





















