Combining RFM-Based Customer Segmentation and K-Means Clustering to Optimize E-Commerce Marketing Strategies
DOI:
https://doi.org/10.12928/mf.v8i2.15807Keywords:
Customer Segmentation, Customer Profiling, K-Means Clustering, RFM Model, E-commerceAbstract
This research examines the shift of consumers from offline shopping to online shopping through e-commerce platforms, driven by convenience, product variety, discounts, and rapid technological advancements such as the internet, smartphones, big data, and machine learning. The study utilizes a transactional dataset containing attributes such as InvoiceNo, StockCode, Description, Quantity, InvoiceDate, UnitPrice, CustomerID, and Country to perform customer segmentation. The segmentation process is conducted using the K-means clustering algorithm combined with the RFM (Recency, Frequency, Monetary) model to develop comprehensive customer profiles. This approach aims to identify distinct customer groups and support the creation of more targeted and personalized marketing strategies. The quality of clustering results is evaluated using the Silhouette Score to ensure optimal grouping performance. The entire data processing, analysis, and modeling are implemented using Python as the primary tool. The research methodology includes literature review, data collection, data preprocessing, clustering model development, customer profile analysis, and evaluation and validation of results. The findings are expected to provide valuable insights into customer behavior, enabling e-commerce businesses to enhance marketing effectiveness, improve customer retention, and attract new customers. Ultimately, this study contributes to the development of data-driven marketing strategies that improve customer satisfaction and business performance in the digital commerce environment.
References
A.-Y. Al-Yasir, M. Afdal, Z. Zarnelly, and A. Marsal, “Analisis Loyalitas Pelanggan Business To Business Berdasarkan Model RFM Menggunakan Algoritma Fuzzy C-Means: Business to Business Customer Loyalty Analysis Based on RFM Model Using Fuzzy C-Means Algorithm,” MALCOM Indones. J. Mach. Learn. Comput. Sci., vol. 4, no. 1, pp. 359–365, Jan. 2024, doi: 10.57152/malcom.v4i1.1163.
M. Skare, B. Gavurova, and M. Rigelsky, “Innovation activity and the outcomes of B2C, B2B, and B2G E-Commerce in EU countries,” J. Bus. Res., vol. 163, p. 113874, Aug. 2023, doi: 10.1016/j.jbusres.2023.113874.
E. Yıldız, C. Güngör Şen, and E. E. Işık, “A Hyper-Personalized Product Recommendation System Focused on Customer Segmentation: An Application in the Fashion Retail Industry,” J. Theor. Appl. Electron. Commer. Res., vol. 18, no. 1, pp. 571–596, Mar. 2023, doi: 10.3390/jtaer18010029.
T. T. A. Ngo, H. L. T. Nguyen, H. P. Nguyen, H. T. A. Mai, T. H. T. Mai, and P. L. Hoang, “A comprehensive study on factors influencing online impulse buying behavior: Evidence from Shopee video platform,” Heliyon, vol. 10, no. 15, p. e35743, Aug. 2024, doi: 10.1016/j.heliyon.2024.e35743.
P. Anitha and M. M. Patil, “RFM model for customer purchase behavior using K-Means algorithm,” J. King Saud Univ. - Comput. Inf. Sci., vol. 34, no. 5, pp. 1785–1792, May 2022, doi: 10.1016/j.jksuci.2019.12.011.
B. Sohrabi and A. Khanlari, “Targeting Customers : a Fuzzy Classification Approach,” Int. J. Eng., vol. 23, no. 3, pp. 323–336, 2010.
A. J. Christy, A. Umamakeswari, L. Priyatharsini, and A. Neyaa, “RFM ranking – An effective approach to customer segmentation,” J. King Saud Univ. - Comput. Inf. Sci., vol. 33, no. 10, pp. 1251–1257, Dec. 2021, doi: 10.1016/j.jksuci.2018.09.004.
F. Barrera, M. Segura, and C. Maroto, “Multiple criteria decision support system for customer segmentation using a sorting outranking method,” Expert Syst. Appl., vol. 238, p. 122310, Mar. 2024, doi: 10.1016/j.eswa.2023.122310.
Nofrizal, U. Juju, Sucherly, A. N, I. Waldelmi, and Aznuriyandi, “Changes and determinants of consumer shopping behavior in E-commerce and social media product Muslimah,” J. Retail. Consum. Serv., vol. 70, p. 103146, Jan. 2023, doi: 10.1016/j.jretconser.2022.103146.
C. Rungruang, P. Riyapan, A. Intarasit, K. Chuarkham, and J. Muangprathub, “RFM model customer segmentation based on hierarchical approach using FCA,” Expert Syst. Appl., vol. 237, p. 121449, Mar. 2024, doi: 10.1016/j.eswa.2023.121449.
B. N. Yulisasih, R. A. Surya, P. Widiandana, M. I. Aulia, and S. Hartina, “Pemberdayaan Pemuda Sebagai Pendamping Teknologi Dalam Digitalisasi Layanan Posyandu,” J. Pengabdi. Abhinaya, vol. 1, no. 2, pp. 83–89, Oct. 2025.
F. Zhao, G. Jiang, Y. Zhang, and S. Sayed Merajuddin, “Online sales and corporate innovation preference: The impact of e-commerce emergence on corporate innovation behavior,” Finance Res. Lett., vol. 64, p. 105447, Jun. 2024, doi: 10.1016/j.frl.2024.105447.
S. H. Shihab, S. Afroge, and S. Z. Mishu, “RFM Based Market Segmentation Approach Using Advanced K-means and Agglomerative Clustering: A Comparative Study,” in 2019 International Conference on Electrical, Computer and Communication Engineering (ECCE), Cox’sBazar, Bangladesh: IEEE, Feb. 2019, pp. 1–4. doi: 10.1109/ECACE.2019.8679376.
X. Pu, C. Song, and J. Huang, “Research on Optimization of Customer Value Segmentation Based on Improved K-Means Clustering Algorithm,” in 2020 IEEE 3rd International Conference on Information Systems and Computer Aided Education (ICISCAE), Dalian, China: IEEE, Sep. 2020, pp. 538–542. doi: 10.1109/ICISCAE51034.2020.9236867.
S. Guney, S. Peker, and C. Turhan, “A Combined Approach for Customer Profiling in Video on Demand Services Using Clustering and Association Rule Mining,” IEEE Access, vol. 8, pp. 84326–84335, 2020, doi: 10.1109/ACCESS.2020.2992064.
H.-H. Zhao, X.-C. Luo, R. Ma, and X. Lu, “An Extended Regularized K-Means Clustering Approach for High-Dimensional Customer Segmentation With Correlated Variables,” IEEE Access, vol. 9, pp. 48405–48412, 2021, doi: 10.1109/ACCESS.2021.3067499.
K. Tabianan, S. Velu, and V. Ravi, “K-Means Clustering Approach for Intelligent Customer Segmentation Using Customer Purchase Behavior Data,” Sustainability, vol. 14, no. 12, p. 7243, Jun. 2022, doi: 10.3390/su14127243.
H. (Hojatollah) Hamidi and B. Haghi, “An approach based on data mining and genetic algorithm to optimizing time series clustering for efficient segmentation of customer behavior,” Comput. Hum. Behav. Rep., vol. 16, p. 100520, Dec. 2024, doi: 10.1016/j.chbr.2024.100520.
W. A. Prastyabudi, A. N. Alifah, and A. Nurdin, “Segmenting the Higher Education Market: An Analysis of Admissions Data Using K-Means Clustering,” Procedia Comput. Sci., vol. 234, pp. 96–105, 2024, doi: 10.1016/j.procs.2024.02.156.
C. Shi, B. Wei, S. Wei, W. Wang, H. Liu, and J. Liu, “A quantitative discriminant method of elbow point for the optimal number of clusters in clustering algorithm,” EURASIP J. Wirel. Commun. Netw., vol. 2021, no. 1, p. 31, Dec. 2021, doi: 10.1186/s13638-021-01910-w.
A. Abernathy and M. E. Celebi, “The incremental online k-means clustering algorithm and its application to color quantization,” Expert Syst. Appl., vol. 207, p. 117927, Nov. 2022, doi: 10.1016/j.eswa.2022.117927.
M. Kanwal, N. A. Khan, and A. A. Khan, “A Machine Learning Approach to User Profiling for Data Annotation of Online Behavior,” Comput. Mater. Contin., vol. 78, no. 2, pp. 2419–2440, 2024, doi: 10.32604/cmc.2024.047223.
Sulistiani, Rakyatol Hasanah, Anggun Sindiana, Ahmad Rizky Nusantara Habibi, Minhajul Abidin, and Asno Azzawagama Firdaus, “Peningkatan Literasi Gizi Melalui Kegiatan Edukasi dan Pendokumentasian Makan Bergizi Gratis,” J. Pengabdi. Abhinaya, vol. 1, no. 2, pp. 49–55, Oct. 2025, doi: 10.64021/jpa.1.2.49-55.2025.
A. Wasilewski, K. Juszczyszyn, and V. Suryani, “Multi-factor evaluation of clustering methods for e-commerce application,” Egypt. Inform. J., vol. 28, p. 100562, Dec. 2024, doi: 10.1016/j.eij.2024.100562.
J. Zhou, L. Zhai, and A. A. Pantelous, “Market segmentation using high-dimensional sparse consumers data,” Expert Syst. Appl., vol. 145, p. 113136, May 2020, doi: 10.1016/j.eswa.2019.113136.
J.-J. Jonker, N. Piersma, and D. Van Den Poel, “Joint optimization of customer segmentation and marketing policy to maximize long-term profitability,” Expert Syst. Appl., vol. 27, no. 2, pp. 159–168, Aug. 2004, doi: 10.1016/j.eswa.2004.01.010.
L. Wang, T. R. A. L. Pertheban, T. Li, and L. Zhao, “Application of business intelligence based on big data in E-commerce data evaluation,” Heliyon, vol. 10, no. 21, p. e38768, Nov. 2024, doi: 10.1016/j.heliyon.2024.e38768.
Downloads
Published
Issue
Section
License
Copyright (c) 2026 Baiq Nikum Yulisasih, Panggah Widiandana, Muhammad Immawan Aulia, Rizky Andhika, Siti Hartinah

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
Start from 2019 issues, authors who publish with JURNAL MOBILE AND FORENSICS agree to the following terms:
- Authors retain copyright and grant the journal right of first publication with the work simultaneously licensed under a Creative Commons Attribution License (CC BY-SA 4.0) 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.

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





