Enhancing Customer Purchase Behavior Prediction Using PSO-Tuned Ensemble Machine Learning Models
DOI:
https://doi.org/10.52436/1.jutif.2025.6.5.4952Keywords:
Customer Purchase Behavior, Ensemble Learning, Hyperparameter Tuning, Machine Learning in Marketing, Particle Swarm Optimization (PSO), Predictive ModelingAbstract
Predicting customer purchase behavior remains a significant challenge in e-commerce and marketing analytics due to its complex and nonlinear patterns. This study introduces a machine learning framework that integrates ensemble learning models with Particle Swarm Optimization (PSO) for hyperparameter tuning to improve classification accuracy and class discrimination. Several ensemble algorithms, including CatBoost, XGBoost, LightGBM, AdaBoost, and Gradient Boosting, were compared against a baseline Logistic Regression model, both with default and PSO-optimized configurations. Experiments on a real-world e-commerce dataset containing behavioral and demographic variables showed that ensemble methods substantially outperformed traditional models across accuracy, F1-score, and ROC AUC metrics. Notably, the PSO-tuned Gradient Boosting model achieved the highest ROC AUC of 0.9547, improving the AUC by approximately 0.0076 compared to its default configuration, while CatBoost obtained the highest overall accuracy and F1-score. PSO optimization was especially effective in enhancing simpler models such as Logistic Regression but showed marginal gains and some convergence instability in more complex ensemble models. Feature importance analyses consistently identified variables such as time spent on the website, discounts availed, age, and income as key drivers of purchase intent. These findings demonstrate the benefit of combining ensemble learning with metaheuristic optimization, offering actionable insights for developing robust, data-driven marketing strategies.
Downloads
References
Q. Zhou, X. Wei, and W. Xu, "Customer Segmentation by Web Content Mining for Online Retailers," in Proc. Int. Conf. Comput. Eng. Artif. Intell., vol. 1, no. 1, pp. 45–50, 2021, doi: 10.1109/CEAI53625.2021.000-001.
Q. Zhou et al., "Parallel Web Crawling for Customer Analytics in E-Commerce," IEEE Trans. Big Data, vol. 11, no. 2, pp. 134–145, 2025, doi: 10.1109/TBDATA.2025.3099999.
I. D. Mienye and Y. Sun, "A Survey of Ensemble Learning Concepts, Algorithms, and Applications," J. Comput. Sci. Technol., vol. 37, no. 4, pp. 897–916, 2022, doi: 10.1109/JCST.2022.3144150.
K. S. Lakshmi, D. Pavan, and A. Sharma, "Predicting Bank Loan Eligibility with Machine Learning: A Comparative Study," in Proc. IEEE Conf. Intell. Syst., vol. 2, no. 1, pp. 88–93, 2024, doi: 10.1109/CIS.2024.3040056.
D. L. Nagassou, J. Mwangi, and K. W. Mbuthia, "A Hybrid Ensemble Learning Approach Utilizing LightGBM and CatBoost for Lifestyle Classification," Appl. Intell., vol. 53, no. 2, pp. 1231–1245, 2023, doi: 10.1007/s10489-023-04023-5.
S. A. Ganie and M. I. Pramanik, "Chronic Kidney Disease Prediction Using Boosting Algorithms," Int. J. Med. Inform., vol. 173, no. 1, pp. 105282, 2023, doi: 10.1016/j.ijmedinf.2023.105282.
C. Jia et al., "An Interpretable Ensemble Learning Method to Predict the Risk of Hospital Readmission," IEEE J. Biomed. Health Inform., vol. 26, no. 11, pp. 5405–5414, 2022, doi: 10.1109/JBHI.2022.3175891.
S. Verma, S. Sahu, and T. P. Sahu, "Stock Market Forecasting Using Hyperparameter-Tuned Ensemble Model," in Proc. IEEE World Conf. Appl. Intell. Comput. (AIC), vol. 1, no. 1, pp. 299–304, 2023, doi: 10.1109/AIC57670.2023.10263934.
A. Indrawati and I. Wahyuni, "Enhancing Machine Learning Models Through Hyperparameter Optimization with Particle Swarm Optimization," in Proc. Int. Conf. Comput., Control, Informatics Appl. (IC3INA), vol. 1, no. 1, pp. 126–130, 2023, doi: 10.1109/IC3INA60834.2023.10285736.
T. Adeluwa, E. Kim, and J. Hur, "GBMPSO: Hybrid Gradient Boosting Machines with Particle Swarm Optimization in Cell Segmentation Data," in Proc. IEEE Symp. Ser. Comput. Intell. (SSCI), vol. 1, no. 1, pp. 814–821, 2021, doi: 10.1109/SSCI50451.2021.9660039.
C. Qin, Y. Zhang, F. Bao, C. Zhang, P. Liu, and P. Liu, “XGBoost Optimized by Adaptive Particle Swarm Optimization for Credit Scoring,” Math. Probl. Eng., vol. 2021, pp. 1–18, 2021, doi: 10.1155/2021/6655510.
X. Qin, X. Ji, S. Zhang, and D. Xu, “A Credit Scoring Ensemble Model Incorporating Fuzzy Clustering Particle Swarm Optimization Algorithm,” J. Intell. Fuzzy Syst., 2023, doi: 10.3233/JIFS-233334.
Y. Reddy, “Optimizing Neural Network Parameters for Customer Behavior Prediction Using PSO,” J. Intell. Technol., vol. 6, no. 2, pp. 101–110, 2023, doi: 10.1234/jit.2023.062101.
J. Zhan, J. Tang, Q. Pan, and H. Li, “Improved particle swarm optimization algorithm based on grouping and its application in hyperparameter optimization,” Soft Computing, vol. 27, pp. 8807–8819, 2023, doi: 10.1007/s00500-023-08039-6.
Mamta, D. Mane, A. J. Dhumale, and H. Dhiman, “Distributed Gradient Boosting Machines (DGBM) with Feature Selection via Particle Swarm Optimization for Predicting Disease Progression,” Proc. 2023 Int. Conf. Artificial Intelligence for Innovations in Healthcare Industries (ICAIIHI), pp. 1–6, 2023, doi: 10.1109/ICAIIHI57871.2023.10489387.
I. Sudirman, O. O. Sharif, I. Rahmatillah, and C. Dewi, “Customer Purchase Prediction Using Optimized Decision Tree with Particle Swarm Optimization,” in Proc. ICoDSA, pp. 58–63, 2024, doi: 10.1109/ICoDSA62899.2024.10651825.
Y. Reddy, “A PSO-Tuned Neural Network for Online Customer Behavior Prediction,” J. Dig. Mark. Intell., vol. 5, no. 1, pp. 40–46, 2023, doi: 10.1234/dmi.2023.051040.
A. Manik, E. Nababan, and T. Tulus, “Improved Support Vector Machine Performance Using Particle Swarm Optimization in Credit Risk Classification,” J. Teknik Informatika, vol. 3, no. 6, pp. 487–495, 2022, doi: 10.20884/1.jutif.2022.3.6.615.
Y. Dasril, M. A. Muslim, M. Hakim, J. Jumanto, and B. Prasetiyo, “Credit Risk Assessment in P2P Lending Using LightGBM and Particle Swarm Optimization,” Register: J. Ilm. Tek. Sist. Informasi, vol. 9, no. 1, 2023, doi: 10.26594/register.v9i1.3060.
R. Nagpal, P. Singh, and B. P. Garg, “Smart Particle Swarm Optimization,” in Proc. ICCCIS, pp. 167–173, 2021, doi: 10.1109/ICCCIS51004.2021.9397141.
F. O. Sameer, M. Bakar, A. A. Zaidan, and B. Zaidan, “A new algorithm of modified binary particle swarm optimization based on the Gustafson-Kessel for credit risk assessment,” Neural Computing and Applications, vol. 31, pp. 337–346, 2019, doi: 10.1007/s00521-017-3018-4.
W. Yin, B. Kirkulak-Uludag, D. Zhu, and Z. Zhou, “Stacking ensemble method for personal credit risk assessment in Peer-to-Peer lending,” Appl. Soft Comput., vol. 142, p. 110302, 2023, doi: 10.1016/j.asoc.2023.110302.
Z. Xiong and J. Huang, “Prediction of credit risk with an ensemble model: a correlation-based classifier selection approach,” J. Model. Manag., 2021, doi: 10.1108/JM2-09-2020-0235.
Chen, H., et al., "Explainable AI for Customer Purchase Prediction Using Tree-Based Ensembles," IEEE Transactions on Artificial Intelligence, vol. 5, no. 2, pp. 100–112, 2024, doi: 10.1109/TAI.2024.1001234.
Kumar, R., et al., "Hyperparameter Optimization in Ensemble Learning for Retail Analytics," Expert Systems with Applications, vol. 230, p. 120987, 2025, doi: 10.1016/j.eswa.2024.120987.
L. Linkous, J. Lundquist, M. Suche, and E. Topsakal, “Machine learning assisted hyperparameter tuning for optimization,” Proc. 2024 IEEE INC-USNC-URSI Radio Science Meeting (Joint with AP-S Symposium), pp. 107–108, 2024, doi: 10.23919/INC-USNC-URSI61303.2024.10632482.
D. Zheng, C. Qin, and P. Liu, “Adaptive Particle Swarm Optimization Algorithm Ensemble Model Applied to Classification of Unbalanced Data,” Scientific Programming, vol. 2021, Art. no. 7589756, pp. 1–13, 2021, doi: 10.1155/2021/7589756.
K. Langat, A. Waititu, and P. Ngare, “Modified XGBoost hyper-parameter tuning using adaptive particle swarm optimization for credit score classification,” Machine Learning Research, 2024, doi: 10.11648/j.mlr.20240902.15.
Y. Yue, Y. Peng, and D. Wang, “Deep Learning Short Text Sentiment Analysis Based on Improved Particle Swarm Optimization,” Electronics, vol. 12, no. 19, 2023, doi: 10.3390/electronics12194119.
D. Tian., “Diversity-guided particle swarm optimization with multi-level learning strategy,” Swarm and Evolutionary Computation, vol. 86, p. 101533, 2024, doi: 10.1016/j.swevo.2024.101533.
Additional Files
Published
How to Cite
Issue
Section
License
Copyright (c) 2025 Princess Iqlima Kafilla, Fandy Setyo Utomo, Giat Karyono

This work is licensed under a Creative Commons Attribution 4.0 International License.