Hybrid Learning for Automated E-commerce Churn Prediction with XGBoost and SHAP
DOI:
https://doi.org/10.57152/malcom.v6i3.2833Keywords:
Customer Churn, E-Commerce, Explainable AI (XAI), Hybrid Learning, XGBoostAbstract
Customer retention is a critical challenge in the e-commerce industry, yet many platforms frequently suffer from a lack of explicit labels to identify potential defectors (churn). This research proposes a hybrid unsupervised-supervised learning framework to perform automated churn classification using the high-dimensional Olist Brazilian E-commerce dataset. The first stage employs K-Means Clustering to objectively generate churn labels based on Recency, Frequency, and Monetary (RFM) features. The second stage applies an Extreme Gradient Boosting (XGBoost) model, augmented by the Synthetic Minority Over-sampling Technique (SMOTE), to address the inherent class imbalance typical of transactional data. Experimental results demonstrate that the proposed model achieved a robust accuracy of 72% with a churn recall rate of 69%. Interpretability analysis using SHapley Additive exPlanations (SHAP) revealed that delivery duration and customer review scores are the most dominant predictors of churn, significantly outweighing financial metrics. These findings contribute a novel integration of automated labeling and model transparency, enabling e-commerce managers to implement proactive, data-driven customer retention strategies.
Downloads
References
X. Zhang, A. Ghosh, and A. Ali, “Research on Customer Retention Strategy in the E-commerce Environment,” vol. 5, 2024, doi: 10.6981/FEM.202402_5(2).0014.
D. Pratama, I. Wulandari, F. Hidayat, and C. Lim, “Customer Relationship Management (CRM) Integration in E-Commerce: Impacts on Consumer Loyalty and Retention,” Journal of Economics and Management, vol. 3, no. 2, pp. 68–74, Aug. 2025, doi: 10.70716/ecoma.v3i2.251.
S. Hu and A. Chen, “Data-Driven Customer Retention Strategies in E-Commerce: A Fuzzy Z-Number Approach,” IEEE Access, vol. 13, pp. 75384–75395, 2025, doi: 10.1109/ACCESS.2025.3550190.
E. L. Mountassir and J. E. & Allam S, “E-Commerce Customer Loyalty: The Need for Longitudinal Research.,” African Scientific Journal «, vol. 03, pp. 551–0588, 2025, doi: 10.5281/zenodo.17321301.
W. Dongyan and C. A. Purba, “Customer Retention Strategies in Emerging Market E - Commerce,” Journal of Political Stability Archive, vol. 3, no. 3, pp. 1057–1064, Sep. 2025, doi: 10.63468/jpsa.3.3.72.
T. Ozcan, “Customer Segmentation Using an Extended RFM Model and Clustering Algorithms in E-Commerce,” Journal of Theoretical and Applied Electronic Commerce Research, vol. 21, no. 5, p. 142, May 2026, doi: 10.3390/jtaer21050142.
G. Marín Díaz, “A Fuzzy-XAI Framework for Customer Segmentation and Risk Detection: Integrating RFM, 2-Tuple Modeling, and Strategic Scoring,” Mathematics, vol. 13, no. 13, Jul. 2025, doi: 10.3390/math13132141.
M. M. Msallam, Y. Ar, S. Demir, and B. Tugrul, “A deep learning architecture for analyzing and predicting customer churn data in e-commerce,” PeerJ Comput. Sci., vol. 12, p. e3800, May 2026, doi: 10.7717/peerj-cs.3800.
K. Kaur, “Augmented Business Intelligence for Predictive Customer Segmentation,” Frontiers in Business Innovations and Management, vol. 03, no. 01, pp. 01–14, Jan. 2026, doi: 10.64917/fbim/Volume03Issue01-01.
K. W. De Bock, M. Bogaert, and P. du Jardin, “Ensemble learning for operations research and business analytics,” Oct. 01, 2025, Springer. doi: 10.1007/s10479-025-06852-w.
H. Cheng and J. He, “Advanced customer churn prediction for a music streaming digital marketing service using attention graph-based deep learning approach,” Sci. Rep., vol. 15, no. 1, Dec. 2025, doi: 10.1038/s41598-025-28357-z.
Y. Suh, “Machine learning based customer churn prediction in home appliance rental business,” J. Big Data, vol. 10, no. 1, Dec. 2023, doi: 10.1186/s40537-023-00721-8.
S. Najafi, M. H. Sepanj, and F. Jafari, “RadarSeq: A Temporal Vision Framework for User Churn Prediction via Radar Chart Sequences,” Jun. 2025, [Online]. Available: http://arxiv.org/abs/2506.17325
A. G. V?duva, S. V. Oprea, A. M. Niculae, A. Bâra, and A. I. Andreescu, “Improving Churn Detection in the Banking Sector: A Machine Learning Approach with Probability Calibration Techniques,” Electronics (Switzerland), vol. 13, no. 22, Nov. 2024, doi: 10.3390/electronics13224527.
R. Liu et al., “An Intelligent Hybrid Scheme for Customer Churn Prediction Integrating Clustering and Classification Algorithms,” Applied Sciences (Switzerland), vol. 12, no. 18, Sep. 2022, doi: 10.3390/app12189355.
X. Xiahou and Y. Harada, “B2C E-Commerce Customer Churn Prediction Based on K-Means and SVM,” Journal of Theoretical and Applied Electronic Commerce Research, vol. 17, no. 2, pp. 458–475, Jun. 2022, doi: 10.3390/jtaer17020024.
S. M. Shrestha and A. Shakya, “A Customer Churn Prediction Model using XGBoost for the Telecommunication Industry in Nepal,” in Procedia Computer Science, Elsevier B.V., 2022, pp. 652–661. doi: 10.1016/j.procs.2022.12.067.
M. Imani, A. Beikmohammadi, and H. R. Arabnia, “Comprehensive Analysis of Random Forest and XGBoost Performance with SMOTE, ADASYN, and GNUS Under Varying Imbalance Levels,” Technologies (Basel)., vol. 13, no. 3, Mar. 2025, doi: 10.3390/technologies13030088.
E. Yuliawan, L. Sanny, H. Saroso, and S. Candra, “How gamification affects switching behaviors in the mobile-commerce platform: the role of customer engagement and switching cost,” Front. Commun. (Lausanne)., vol. 10, 2025, doi: 10.3389/fcomm.2025.1608764.
A. D. Do, V. L. Ta, P. T. Bui, N. T. Do, Q. T. Dong, and H. T. Lam, “The Impact of the Quality of Logistics Services in E-Commerce on the Satisfaction and Loyalty of Generation Z Customers,” Sustainability (Switzerland), vol. 15, no. 21, Nov. 2023, doi: 10.3390/su152115294.
K. Hidayat and M. I. Idrus, “The effect of relationship marketing towards switching barrier, customer satisfaction, and customer trust on bank customers,” J. Innov. Entrep., vol. 12, no. 1, Dec. 2023, doi: 10.1186/s13731-023-00270-7.
O. Akande, E. O. Asani, and B. Dautare, “Customer Segmentation Through RFM Analysis and K-Means Clustering: Leveraging Data-Driven Insights for Effective Marketing Strategy,” Ceddi Journal of Information System and Technology (JST), vol. 3, no. 1, pp. 14–25, Apr. 2024, doi: 10.56134/jst.v3i1.81.
A. H. L. Chen and S. Gunawan, “Enhancing Retail Transactions: A Data-Driven Recommendation Using Modified RFM Analysis and Association Rules Mining,” Applied Sciences (Switzerland), vol. 13, no. 18, Sep. 2023, doi: 10.3390/app131810057.
J. Liao, A. Jantan, Y. Ruan, and C. Zhou, “Multi-Behavior RFM Model Based on Improved SOM Neural Network Algorithm for Customer Segmentation,” IEEE Access, vol. 10, pp. 122501–122512, 2022, doi: 10.1109/ACCESS.2022.3223361.
S. Naeem, A. Ali, S. Anam, and M. M. Ahmed, “An Unsupervised Machine Learning Algorithms: Comprehensive Review,” International Journal of Computing and Digital Systems, vol. 13, no. 1, pp. 911–921, 2023, doi: 10.12785/ijcds/130172.
O. A. Bello, A. Folorunso, O. E. Ejiofor, F. Z. Budale, K. Adebayo, and O. A. Babatunde, “Machine Learning Approaches for Enhancing Fraud Prevention in Financial Transactions,” International Journal of Management Technology, vol. 10, no. 1, pp. 85–108, 2023, doi: 10.37745/ijmt.2013/vol10n185109.
S. F. Pratama, “User Profiling Based on Financial Transaction Patterns: A Clustering Approach for User Segmentation,” International Journal for Applied Information Management, vol. 4, no. 4, pp. 217–228, Dec. 2024, doi: 10.47738/ijaim.v4i4.92.
G. S. Nadella, K. Meduri, H. Gonaygunta, S. Satish, S. E. Vadakkethil, and S. Pillai, “Blockchain Fraud Detection Using Unsupervised Learning: Anomalous Transaction Patterns Detection Using K-Means Clustering,” in ACM International Conference Proceeding Series, Association for Computing Machinery, Oct. 2024, pp. 407–412. doi: 10.1145/3675888.3676080.
M. E. Saleh and N. Abd-Alsabour, “Improved Decision Tree, Random Forest, and XGBoost Algorithms for Predicting Client Churn in the Telecommunications Industry,” 2024. [Online]. Available: www.ijacsa.thesai.org
R. E. Ako et al., “Effects of Data Resampling on Predicting Customer Churn via a Comparative Tree-based Random Forest and XGBoost,” Journal of Computing Theories and Applications, vol. 2, no. 1, pp. 86–101, Jun. 2024, doi: 10.62411/jcta.10562.
V. Diéz-Obrero et al., “Transcriptome-Wide Association Study for Inflammatory Bowel Disease Reveals Novel Candidate Susceptibility Genes in Specific Colon Subsites and Tissue Categories,” J. Crohns Colitis, vol. 16, no. 2, pp. 275–285, Feb. 2022, doi: 10.1093/ecco-jcc/jjab131.
S. E. Awan, M. Bennamoun, F. Sohel, F. M. Sanfilippo, and G. Dwivedi, “Imputation of Missing Data with Class Imbalance using Conditional Generative Adversarial Networks,” Dec. 2020, [Online]. Available: http://arxiv.org/abs/2012.00220
A. Sharma, N. Patel, and R. Gupta, “Enhancing Predictive Customer Retention Using Machine Learning Algorithms: A Comparative Study of Random Forest, XGBoost, and Neural Networks Authors,” 2025.
H. A. Mengash, N. Alruwais, F. Kouki, C. Singla, E. S. Abd Elhameed, and A. Mahmud, “Archimedes Optimization Algorithm-Based Feature Selection with Hybrid Deep-Learning-Based Churn Prediction in Telecom Industries,” Biomimetics, vol. 9, no. 1, Jan. 2024, doi: 10.3390/biomimetics9010001.
J. Roy, S. K. Singh, and L. Shaw, “Customer Churn Prediction on Structured Data Using FT-Transformer and Stacking Ensembles,” IEEE Access, 2026, doi: 10.1109/ACCESS.2026.3686374.
X. Liu, G. Xia, X. Zhang, W. Ma, and C. Yu, “Customer churn prediction model based on hybrid neural networks,” Sci. Rep., vol. 14, no. 1, Dec. 2024, doi: 10.1038/s41598-024-79603-9.
A. Khattak, Z. Mehak, H. Ahmad, M. U. Asghar, M. Z. Asghar, and A. Khan, “Customer churn prediction using composite deep learning technique,” Sci. Rep., vol. 13, no. 1, Dec. 2023, doi: 10.1038/s41598-023-44396-w.
R. Suguna, J. Suriya Prakash, H. Aditya Pai, T. R. Mahesh, V. Vinoth Kumar, and T. E. Yimer, “Mitigating class imbalance in churn prediction with ensemble methods and SMOTE,” Sci. Rep., vol. 15, no. 1, Dec. 2025, doi: 10.1038/s41598-025-01031-0.
A. Balouchi et al., “Wangiri Fraud Detection: A Comprehensive Approach to Unlabeled Telecom Data,” Future Internet, vol. 18, no. 1, p. 15, Dec. 2025, doi: 10.3390/fi18010015.
L. Qiqi, S. Roopali, P. Charin, F. Tanner, K. Namita, and C. Shreya, “Segment Discovery: Enhancing E-commerce Targeting,” in CEUR Workshop Proceedings, CEUR-WS, 2024, pp. 1–9. doi: 10.1145/nnnnnnn.nnnnnnn.
Z. You, Z. Wu, and Y.-G. Jiang, “Learning Accurate Segmentation Purely from Self-Supervision,” Feb. 2026, [Online]. Available: http://arxiv.org/abs/2602.23759
N. Ahmad, M. J. Awan, H. Nobanee, A. M. Zain, A. Naseem, and A. Mahmoud, “Customer Personality Analysis for Churn Prediction Using Hybrid Ensemble Models and Class Balancing Techniques,” IEEE Access, vol. 12, pp. 1865–1879, 2024, doi: 10.1109/ACCESS.2023.3334641.
A. M. Asfe, M. R. Rahman, and M. S. Hossain, “MNeuralTab: Integrating meta-modeling and neural networks for customer churn prediction in e-commerce,” Discover Applied Sciences, vol. 7, no. 6, Jun. 2025, doi: 10.1007/s42452-025-07157-0.
Y. Yu and X. Qiu, “Machine Learning-Based Sales Forecasting Method for Cross-Border E-Commerce Products,” in Proceedings of 2025 2nd International Conference on Economic Data Analytics and Artificial Intelligence, EDAI 2025, Association for Computing Machinery, Inc, Mar. 2026, pp. 328–332. doi: 10.1145/3789297.3789349.
S. Masood, “Predicting Sales and Analysing Customer Lifetime Value (CLV) in the E-Commerce Industry Using Machine Learning Methods,” 2025.
A. M. Sharifnia, D. E. Kpormegbey, D. K. Thapa, and M. Cleary, “A Primer of Data Cleaning in Quantitative Research: Handling Missing Values and Outliers,” J. Adv. Nurs., vol. 82, no. 1, pp. 970–975, Jan. 2026, doi: 10.1111/jan.16908.
K. M. Sujon, R. Hassan, K. Choi, and M. A. Samad, “Accuracy, precision, recall, f1-score, or MCC? empirical evidence from advanced statistics, ML, and XAI for evaluating business predictive models,” J. Big Data, vol. 12, no. 1, Dec. 2025, doi: 10.1186/s40537-025-01313-4.
A. S. AlSalehy and M. Bailey, “Improving Time Series Data Quality: Identifying Outliers and Handling Missing Values in a Multilocation Gas and Weather Dataset,” Smart Cities, vol. 8, no. 3, Jun. 2025, doi: 10.3390/smartcities8030082.
A. Salhi, R. Alshamrani, A. Althbiti, A. Ismail, M. Abd-ElRahman, and B. M. Hassan, “Optimizing high dimensional data classification with a hybrid AI driven feature selection framework and machine learning schema,” Sci. Rep., vol. 15, no. 1, Dec. 2025, doi: 10.1038/s41598-025-08699-4.
R. Verma, D. Rathor, S. Kumar, M. Mishra, and M. Baranwal, “Enhancing customer repurchase prediction: Integrating classification algorithms with RFM analysis for precision and actionable insights: RFM-based customer repurchase enhancement,” IIMB Management Review, vol. 37, no. 2, Jun. 2025, doi: 10.1016/j.iimb.2025.100574.
M. Walid, M. Ashar, and H. W. Herwanto, “Evaluating the Data Imputation Impact on Gradient Boosting Model Predictive Performance in Sensor Failure Recovery for Smart Irrigation Systems,” Engineering, Technology and Applied Science Research, vol. 16, no. 2, pp. 34452–34459, Jan. 2026, doi: 10.48084/etasr.17776.
P. Golchian and M. N. Wright, “Imputation Uncertainty in Interpretable Machine Learning Methods,” Dec. 2025, [Online]. Available: http://arxiv.org/abs/2512.17689
T. L. Vo, T. Nguyen, L. M. Lopez-Ramos, H. L. Hammer, M. A. Riegler, and P. Halvorsen, “Explainability of Machine Learning Models under Missing Data,” Jan. 2025, [Online]. Available: http://arxiv.org/abs/2407.00411
Z. Hu, “Machine Learning-Based Prediction and Interpretability Analysis of Logistics Delay Risks in E-commerce Supply Chains,” Association for Computing Machinery (ACM), Nov. 2025, pp. 234–241. doi: 10.1145/3779475.3779510.
G. Hui, A. Al Mamun, M. N. H. Reza, and W. M. H. W. Hussain, “An empirical study on logistic service quality, customer satisfaction, and cross-border repurchase intention,” Heliyon, vol. 11, no. 1, Jan. 2025, doi: 10.1016/j.heliyon.2024.e41156.
E. Indrajith and D. A. Sanjula, Explainability, risk modeling, and segmentation based customer churn analytics for personalized retention in e-commerce. IEEE, 2026.
K. Peng, Y. Peng, and W. Li, “Research on customer churn prediction and model interpretability analysis,” PLoS One, vol. 18, no. 12 December, Dec. 2023, doi: 10.1371/journal.pone.0289724.
E. A. Ali and E.-H. Mohammed, “Explainable AI-driven customer churn prediction: a multi-model ensemble approach with SHAP-based feature analysis,” 2026.
Downloads
Published
How to Cite
Issue
Section
License
Copyright (c) 2026 Amir Acalapati Henry, Abdul Hamid Arribathi, Henderi Henderi

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
Copyright © by Author; Published by Institut Riset dan Publikasi Indonesia (IRPI)
This Indonesian Journal of Machine Learning and Computer Science is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.










