Customer Segmentation Based on Loyalty Level Using K-Means and LRFM Feature Selection in Retail Online Store


  • Tiara Lailatul Nikmah Universitas Negeri Semarang, Semarang, Indonesia
  • Nur Hazimah Syani Harahap Universitas Negeri Semarang, Semarang, Indonesia
  • Gina Cahya Utami Universitas Amikom Purwokerto, Purwokerto, Indonesia
  • Muhammad Mirza Razzaq Universitas Dian Nuswantoro, Semarang, Indonesia



Customer Segmentation, Online Retail, K-Means, LRFM


Customer experience is a key component in increasing sales numbers. Customers are important assets that must be kept up for a corporation or firm. Prioritizing customer service is one way to protect client loyalty. To ensure that service priority is right on target, this research was conducted on groups of consumers who are anticipated to have high business prospects. The 2011 retail online shop sales dataset with 379,980 records and eight char-acteristics was used. The length, recency, frequency, and monetary (LRFM) feature selection approach was used in the study process to select features for further segmentation using the K-Means data mining method to define consumer types. Following the completion of the research, clients were divided into four categories: Premium Loyalty, Inertia Loyalty, Latent Loyalty, and No Loyalty. The correct clustering results are displayed in the vali-dation test using the Silhouette Score Index technique, which yielded a score value of 0.943898. Based on the outcomes of this segmentation, business actors may prioritize providing clients with the proper service.


Download data is not yet available.


S. M. Taj and A. Kumaravel, “Intentions of online shoppers prediction by fuzzy petri nets construction,†Int. J. Sci. Technol. Res., vol. 9, no. 2, pp. 1761–1768, 2020.

Y. Christian, “Comparison of machine learning algorithms using weka and sci-kit learn in classifying online shopper intention,†J. Informatics Telecommun. Eng., vol. 3, no. 1, pp. 58–66, 2019.

K. C. Koththagoda and H. Herath, “Factors influencing online purchasing intention: The mediation role of consumer attitude,†J. Mark. Consum. Res., vol. 42, no. 2003, pp. 66–74, 2018.

C. O. Sakar, S. O. Polat, M. Katircioglu, and Y. Kastro, “Real-time prediction of online shoppers’ purchasing intention using multilayer perceptron and LSTM recurrent neural networks,†Neural Comput. Appl., vol. 31, pp. 6893–6908, 2019.

M. R. Kabir, F. Bin Ashraf, and R. Ajwad, “Analysis of different predicting model for online shoppers’ purchase intention from empirical data,†in 2019 22nd International Conference on Computer and Information Technology (ICCIT), 2019, pp. 1–6.

T. Brian and A. Sanwidi, “Implementasi Algoritma Apriori Untuk Market Basket Analysis Berbasis R,†J. ELTIKOM J. Tek. Elektro, Teknol. Inf. dan Komput., vol. 2, no. 1, pp. 1–8, 2018.

C. S. G. Dhas, N. Yuvaraj, N. V Kousik, and T. D. Geleto, “D-PPSOK clustering algorithm with data sampling for clustering big data analysis,†in System Assurances, Elsevier, 2022, pp. 503–512.

S. Saeed, H. Bin Haroon, M. Naqvi, N. Z. Jhanjhi, M. Ahmad, and L. Gaur, “A systematic mapping study of low-grade tumor of brain cancer and csf fluid detecting approaches and parameters,†Approaches Appl. Deep Learn. Virtual Med. Care, pp. 236–259, 2022.

F. Marisa, S. S. S. Ahmad, Z. I. M. Yusof, F. Hunaini, and T. M. A. Aziz, “Segmentation model of customer lifetime value in small and medium enterprise (SMEs) using K-means clustering and LRFM model,†Int. J. Integr. Eng., vol. 11, no. 3, 2019.

A. D. Savitri, F. A. Bachtiar, and N. Y. Setiawan, “Segmentasi Pelanggan Menggunakan Metode K-Means Clustering Berdasarkan Model RFM Pada Klinik Kecantikan (Studi Kasus: Belle Crown Malang),†J. Pengemb. Teknol. Inf. Dan Ilmu Komput. E-ISSN, vol. 2548, 2009.

G. Chen, B. Sheng, R. Luo, and P. Jia, “A parallel strategy for predicting the quality of welded joints in automotive bodies based on machine learning,†J. Manuf. Syst., vol. 62, pp. 636–649, 2022.

T. Saheb, M. Dehghani, and T. Saheb, “Artificial intelligence for sustainable energy: A contextual topic modeling and content analysis,†Sustain. Comput. Informatics Syst., vol. 35, p. 100699, 2022.

D. Jollyta, S. Efendi, M. Zarlis, and H. Mawengkang, “Optimasi Cluster Pada Data Stunting: Teknik Evaluasi Cluster Sum of Square Error dan Davies Bouldin Index,†in Prosiding Seminar Nasional Riset Information Science (SENARIS), 2019, vol. 1, pp. 918–926.

S. F. Hussain and M. Haris, “A k-means based co-clustering (kCC) algorithm for sparse, high dimensional data,†Expert Syst. Appl., vol. 118, pp. 20–34, 2019.

S. Khodabandehlou, “Designing an e-commerce recommender system based on collaborative filtering using a data mining approach,†Int. J. Bus. Inf. Syst., vol. 31, no. 4, pp. 455–478, 2019.

E. Bakhshizadeh, H. Aliasghari, R. Noorossana, and R. Ghousi, “Customer Clustering Based on Factors of Customer Lifetime Value with Data Mining Technique (Case Study: Software Industry),†Int. J. Ind. Eng. Prod. Res., vol. 33, no. 1, pp. 1–16, 2022.

R. Rahmadianti, A. Dhini, and E. Laoh, “Estimating customer lifetime value using LRFM model in pharmaceutical and medical device distribution company,†in 2020 International Conference on ICT for Smart Society (ICISS), 2020, pp. 1–5.

T. L. Nikmah, M. Z. Ammar, Y. R. Allatif, R. M. P. Husna, P. A. Kurniasari, and A. S. Bahri, “Comparison of LSTM, SVM, and naive bayes for classifying sexual harassment tweets,†J. Soft Comput. Explor., vol. 3, no. 2, pp. 131–137, 2022.

A. D. Rachid, A. Abdellah, B. Belaid, and L. Rachid, “Clustering prediction techniques in defining and predicting customers defection: The case of e-commerce context,†Int. J. Electr. Comput. Eng., vol. 8, no. 4, p. 2367, 2018.

S. Monalisa, “Analysis outlier data on rfm and lrfm models to determining customer loyalty with dbscan algorithm,†in 2018 International Symposium on Advanced Intelligent Informatics (SAIN), 2018, pp. 1–5.

S. Fatahi and M. Rabiei, “Users clustering based on search behavior analysis using the LRFM model (case study: Iran scientific information database (Ganj)),†Iran. J. Inf. Process. Manag., vol. 36, no. 2, pp. 419–442, 2022.

N. H. Syani, A. Amirullah, M. B. Saputro, and I. A. Tamaroh, “Classification of potential customers using C4. 5 and k-means algorithms to determine customer service priorities to maintain loyalty,†J. Soft Comput. Explor., vol. 3, no. 2, pp. 123–130, 2022.

M. I. Dzulhaq, K. W. Sari, S. Ramdhan, and R. Tullah, “Customer segmentation based on RFM value using K-means algorithm,†in 2019 Fourth International Conference on Informatics and Computing (ICIC), 2019, pp. 1–7.

R. Gustriansyah, N. Suhandi, and F. Antony, “Clustering optimization in RFM analysis based on k-means,†Indones. J. Electr. Eng. Comput. Sci., vol. 18, no. 1, pp. 470–477, 2020.

D. Marutho, S. H. Handaka, and E. Wijaya, “The determination of cluster number at k-mean using elbow method and purity evaluation on headline news,†in 2018 international seminar on application for technology of information and communication, 2018, pp. 533–538.

M. A. Masud, J. Z. Huang, C. Wei, J. Wang, I. Khan, and M. Zhong, “I-nice: A new approach for identifying the number of clusters and initial cluster centres,†Inf. Sci. (Ny)., vol. 466, pp. 129–151, 2018.

F. Bin Ashraf, A. Matin, M. S. R. Shafi, and M. U. Islam, “An Improved K-means Clustering Algorithm for Multi-dimensional Multi-cluster data Using Meta-heuristics,†in 2021 24th International Conference on Computer and Information Technology (ICCIT), 2021, pp. 1–6.

H. Nguyen, X.-N. Bui, Q.-H. Tran, and N.-L. Mai, “A new soft computing model for estimating and controlling blast-produced ground vibration based on hierarchical K-means clustering and cubist algorithms,†Appl. Soft Comput., vol. 77, pp. 376–386, 2019.

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, pp. 1–16, 2021.

O. Dogan, E. Ayçin, and Z. Bulut, “Customer segmentation by using RFM model and clustering methods: a case study in retail industry,†Int. J. Contemp. Econ. Adm. Sci., vol. 8, 2018.

R. D. Firdaus, T. G. Laksana, and R. D. Ramadhani, “Pengelompokan Data Persediaan Obat Menggunakan Perbandingan Metode K-Means Dengan Hierarchical Clustering Single Linkage,†INISTA J. Informatics, Inf. Syst. Softw. Eng. Appl., vol. 2, no. 1, pp. 33–48, 2019.




How to Cite

Nikmah, T.L. et al. 2023. Customer Segmentation Based on Loyalty Level Using K-Means and LRFM Feature Selection in Retail Online Store. Jurnal ELTIKOM : Jurnal Teknik Elektro, Teknologi Informasi dan Komputer. 7, 1 (Jun. 2023), 21–28. DOI: