Customer Segmentation and Purchase Behavior Analysis Using Hierarchical Agglomerative Clustering and Machine Learning Techniques

Main Article Content

David Lutta https://orcid.org/0009-0008-7977-8670
David Gichoya https://orcid.org/0009-0002-6050-3892
Julia Korongo https://orcid.org/0000-0002-0059-0878
Jael Gudu https://orcid.org/0000-0001-9720-8358

Keywords

Customer segmentation, hierarchical agglomerative clustering, purchase behavior prediction, machine learning, e-commerce analytics

Abstract

The heterogeneity of consumer behavior in digital marketplaces poses a significant challenge for firms seeking to optimize marketing resource allocation and predictive accuracy. This study proposes and validates a hybrid analytical framework that integrates Hierarchical Agglomerative Clustering (HAC) with supervised machine learning techniques to segment customers and predict purchase behavior. Grounded in Machine Learning Theory (MLT) and Computational Learning Theory (COLT), and operationalized through the Cross-Industry Standard Process for Data Mining (CRISP-DM), the research employs a three-stage pipeline: (1) segmentation via HAC using Ward's linkage and Euclidean distance, (2) segment-specific predictive modeling using Choice Model Trees (CMT), Random Forest, Support Vector Machines (SVM), K-Nearest Neighbors (KNN), and Logistic Regression, and (3) comprehensive evaluation using accuracy, precision, recall, F1-score, and ROC-AUC. Using a dataset of 50,000 customer records with demographic, behavioral, and transactional features, the HAC algorithm identified four distinct segments: High-Frequency Power Users, Price-Sensitive Deal Hunters, Low-Engagement Browsers, and High-Value Efficiency Shoppers. The hybrid segment-specific approach achieved a predictive accuracy of 84.33%, substantially outperforming global modeling benchmarks. The Choice Model Trees further provided interpretable decision rules such as the predictive thresholds of five product views and 200 seconds of browsing time enabling actionable managerial insights. The findings demonstrate that addressing customer heterogeneity through hierarchical segmentation prior to predictive modeling yields significant performance uplifts and enhances the interpretability of machine learning outputs for strategic marketing deployment.

Downloads

Download data is not yet available.
Abstract 30 | PDF Downloads 18

References

Chapman, P., Clinton, J., Kerber, R., Khabaza, T., Reinartz, T., Shearer, C., & Wirth, R. (2000). CRISP-DM 1.0: Step-by-step data mining guide. SPSS Inc. https://www.semanticscholar.org/paper/CRISP-DM-1.0%3A-Step-by-step-data-mining-guide-Chapman/54bad20bbc7938991bf34f86dde0babfbd2d5a72

Fayyad, U. M., Piatetsky-Shapiro, G., & Smyth, P. (1996). From data mining to knowledge discovery in databases. AI Magazine, 17(3), 37–54. https://doi.org/10.1609/aimag.v17i3.1230

Gomes, M. A., & Meisen, T. (2023). A review on customer segmentation methods for personalized customer targeting in e-commerce use cases. Information Systems and e-Business Management, 21, 527–570. https://doi.org/10.1007/s10257-023-00640-4

Ho, T., Nguyen, S., Nguyen, H., Nguyen, N., Man, D.-S., & Le, T.-G. (2023). An extended RFM model for customer behaviour and demographic analysis in retail industry. Business Systems Research Journal, 14(1), 1–17. https://doi.org/10.2478/bsrj-2023-0002

John, J., Shobayo, O., & Ogunleye, B. (2023). An exploration of clustering algorithms for customer segmentation in the UK retail market. Analytics, 2(4), 809–823. https://doi.org/10.3390/analytics2040042

Joung, J., & Kim, H. (2023). Interpretable machine learning-based approach for customer segmentation for new product development from online product reviews. International Journal of Information Management, 70, 102641. https://doi.org/10.1016/j.ijinfomgt.2023.102641

Luo, L., Li, B., Fan, X., Wang, Y., Koprinska, I., & Chen, F. (2023). Dynamic customer segmentation via hierarchical fragmentation-coagulation processes. Machine Learning, 112, 281–310. https://doi.org/10.1007/s10994-022-06276-8

McFadden, D. (1974). Conditional logit analysis of qualitative choice behavior. In P. Zarembka (Ed.), Frontiers in econometrics (pp. 105–142). Academic Press. https://eml.berkeley.edu/reprints/mcfadden/zaremb74.pdf

Rungruang, C., Riyapan, P., Intarasit, A., Chuarkham, K., & Muangprathub, J. (2023). RFM model customer segmentation based on hierarchical approach using FCA. Expert Systems with Applications, 234, 121449. https://doi.org/10.1016/j.eswa.2023.121449

Salminen, J., Mustak, M., Sufyan, M., & Jansen, B. J. (2023). How can algorithms help in segmenting users and customers? A systematic review and research agenda for algorithmic customer segmentation. Journal of Marketing Analytics, 11, 677–692. https://doi.org/10.1057/s41270-023-00235-5

Smith, W. R. (1956). Product differentiation and market segmentation as alternative marketing strategies. Journal of Marketing, 21(1), 3–8. https://doi.org/10.1177/002224295602100102

Wedel, M., & Kamakura, W. A. (2000). Market segmentation: Conceptual and methodological foundations (2nd ed.). Springer. https://doi.org/10.1007/978-1-4615-4651-1