Customer Segmentation in E-Commerce Based on the Recency, Frequency, and Monetary (RFM) Model and K-Means Clustering
Abstract
Reliable customer segmentation is difficult when studies report final clusters without showing how data cleaning and cluster-number choices affect validity. This study examines customer segmentation in e-commerce using the Recency, Frequency, and Monetary (RFM) model and K-Means clustering. The Online Retail II dataset contains 1,067,371 invoice-line records from 1 December 2009 to 9 December 2011. After removing missing customer identifiers, cancelled invoices, and non-positive quantities or prices, 805,549 valid purchase rows and 5,878 customers remained. RFM indicators were log-transformed, standardized, and clustered with candidate values from k = 2 to k = 8. Although k = 2 achieved the highest silhouette score (0.440), k = 4 was retained as a more interpretable exploratory solution with a positive silhouette score (0.365). The four segments reveal strong value concentration: high-value loyal customers represent 19.0% of customers but 72.2% of valid spending, while dormant low-value customers represent 35.0% of customers but only 4.0% of spending. The results show how a transparent RFM-based workflow can support retention and reactivation priorities while requiring experimental validation before managerial deployment.
References
- Chen, D., Sain, S. L., & Guo, K. (2012). Data mining for the online retail industry: A case study of RFM model-based customer segmentation using data mining.Journal of Database Marketing & Customer Strategy Management, 19(3), 197–208. https://doi.org/10.1057/dbm.2012.17
- Cheng, C.-H., & Chen, Y.-S. (2009). Classifying the segmentation of customer value via RFM model and RS theory.Expert Systems with Applications, 36(3), 4176–4184. https://doi.org/10.1016/j.eswa.2008.04.003
- Fader, P. S., Hardie, B. G. S., & Lee, K. L. (2005). RFM and CLV: Using iso-value curves for customer base analysis.Journal of Marketing Research, 42(4), 415–430. https://doi.org/10.1509/jmkr.2005.42.4.415
- 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(3), 527–570. https://doi.org/10.1007/s10257-023-00640-4
- John, J. M., 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
- Alamsyah, Prasetyo, P. E., Sunyoto, Bintari, S. H., Saputro, D. D., Rohman, S., & Pratama, R. N. (2022). Customer segmentation using the integration of the Recency Frequency Monetary model and the K-Means cluster algorithm.Scientific Journal of Informatics, 9(2), 189–196. https://doi.org/10.15294/sji.v9i2.39437
- Chen, D., & UCI Machine Learning Repository. (2019). Online retail II [Data set].UCI Machine Learning Repository. https://doi.org/10.24432/C5CG6D
- Rousseeuw, P. J. (1987). Silhouettes: A graphical aid to the interpretation and validation of cluster analysis.Journal of Computational and Applied Mathematics, 20, 53–65. https://doi.org/10.1016/0377-0427(87)90125-7
- Chalechema, S., Saini, M. L., Perla, I., & Shivanand, A. V. (2023). Customer segmentation using K means algorithm and RFM model. In2023 International Conference on Computing, Communication, and Intelligent Systems (ICCCIS)(pp. 393–398). https://doi.org/10.1109/ICCCIS60361.2023.10425556
- Antonius, V. H., & Fitrianah, D. (2024). Enhancing customer segmentation insights by using RFM + discount proportion model with clustering algorithms.International Journal of Advanced Computer Science and Applications, 15(3), 902–911. https://doi.org/10.14569/IJACSA.2024.0150390
- Wong, C.-G., Tong, G.-K., & Haw, S.-C. (2024). Exploring customer segmentation in e-commerce using RFM analysis with clustering techniques.Journal of Telecommunications and the Digital Economy, 12(3), 97–125. https://jtde.telsoc.org/index.php/jtde/article/view/978
- Al Hamid, B., & Wiradinata, T. (2026). RFM-based customer segmentation using K-Means clustering for marketing strategy optimization at Queen Audio.Journal of Applied Informatics and Computing, 10(2), 1828–1833. https://doi.org/10.30871/jaic.v10i2.12302