The Implementation of K-Means dan K-Medoids Algorithm for Customer Segmentation on E-commerce Data Transactions

Romadansyah Siagian, Pahala Sirait, Arwin Halim


Nowadays, e-commerce data transactions are commonly used by companies to provide new information. The data transaction can reveal customer segmentation or groups based on the similar characteristics and behavior of each customer. Data Mining is one of technique to conduct the customer segmentation through clustering method. The study aims to applied the clustering method on e-commerce data transactions by using both K-Means and K-Medoids algorithm. The result shows that both algorithms reveal optimum of cluster result with value of k = 3. The results are also indicating the conformity with the elbow method’s results and the Davies Bouldin Index validity test which shows that the optimal number of clusters is 3. The test results show that K-Medoids has the best performance with a ration value of 0.337575 compared to K-Means 0.3380724. Hence, K-Medoids are used in data clustering as the optimal cluster. The results of customer segmentation according to the Customer Loyalty Matrix consist of core customers, new customers, and lost customers.

Full Text:



J. Celement, 29 Oktober 2020. [Online]. Available:

F. Marisa, S. S. S. Ahmad, Z. I. M. Yusof, F. and T. M. A. Aziz, "Segmentation Model of Customer Lifetime Value in Small an Medium Enterprise (SMEs) using K-Means Clustering and LRFM Model," International Journal of Integrated Engineering, vol. 11, pp. 169 -180, 2019.

O. Dogan, E. Aycin and Z. A. Bulut, "Customer Segmentation by Using RFM Model and Clustering Method: A Case Study in Retail Industry," International Jurnal of Contemporary Economics and Administrative Sciences, vol. 8, pp. 1-19, 2018.

B. Kaur and P. K. Sharma, "Implementation of Customer Segmentation using Integrated Approach," International Journal of Innovative Technology and Exploring Engineering (IJITEE), vol. 8, no. 6S, pp. 770 - 772, 2019.

H. Singh and S. Srivastava, "Customer Segmentation in E-Commerce to Retain and Gain the Customers," International Journal of Advanced Science and Technology, vol. 29, no. 7, pp. 12846-12856, 2020.

D. Kandeil, A. Saad and S. M. Youssef, "A Two-phase Clustering Analysis for B2B Customer Segmentation," International Conference on Intelegent Networking and Collaborative System, pp. 221 - 228, 2014.

V. Babaiyan and S. A. Sarfarazi, "Analyzing Customers of South Khorasan Telecommunication Company with Expansion of RFM to LRFM Model," Journal of AI and Data Mining, vol. 7, no. 2, pp. 331 - 340, 2019.

E. U. Wahyuningtyas, R. R. M. Putri and S. , "Optimasi K-Means Untuk Clustering Dosen Berdasarkan Kinerja Akademik Menggunakan Algoritme Genetika Paralel," Jurnal Pengembangan Teknologi Informasi dan Ilmu Komputer, vol. 2, no. 8, pp. 2628 - 2635, 2018.

C. D. Rumiarti and I. Budi, "Segmentasi Pelanggan Pada Customer Relationship Management di Perusahaan Ritel: Studi Kasus PT Gramedia Asri Media," Jurnal Sistem Informasi (Jurnal of Information System), vol. 13, no. 1, pp. 1 - 10, 2017.

S. Monalisa, "Klasterisasi Customer Lifetime value dengan Model LRFM Menggunakan Algoritma K-Means," Jurnal Teknologi Informasi dan Ilmu Komputer (JTIIK), vol. 5, pp. 247 - 252, 2018.

R. Gustriansyah, N. Suhandi and F. Antony, "Clustering Optimization in RFM Analysis Based on K-Means," Indonesian Journal of Electrical Engineering and Computer Science, vol. 18, no. 1, pp. 470 - 477, 2020.

M. Aryuni, E. D. Madyatmadja and E. Miranda, "Penerapan K-Means Dan K-Medoids Clustering Pada Data Internet Banking Di Bank XYZ," Jurnal Teknik dan Ilmu Komputer, vol. 7, no. 27, pp. 349 - 356, 2018.

D. Chen, L. S. Sain and K. Guo, "Data Mining for The Online Retail Industry: A Case Study of RFM Model-based Customer Segmentation Using Data Mining," Journal of Database Marketing and Customer Strategy Management, vol. 19, no. 3, pp. 197 - 208, 2012.

J. Han, M. Kamber and J. Pie, Data mining: concepts and techniques, 3rd ed., United States of America: Morgan Kaufmann Publishers is an imprint of Elsevier, 2012.

M. Hubert and S. V. d. Veeken, "Outlier Detection for Skewed Data," Journal of Chemometrics: A Journal of the Chemometrics Society, vol. 22, no. 3-4, pp. 235 - 246, 2008.

H. W. Alomari and M. Stephan, "Towards slice-based semantic clone detection," in 2018 IEEE 12th International Workshop on Software Clones (IWSC), Campobasso, Italy, 2018.

S. Adinugroho and Y. A. Sari, Implementasi Data Mining Menggunakan Weka, Malang: Universitas Brawijaya Press, 2018.

J. Qi, Y. Yu, L. Wang and J. Liu, "K*-Means: An Effective and Efficient K-Means Clustering Algorithm," Atlanta, GA, 2016.

M. Nishom, "Perbandingan Akurasi Euclidean Distance, Minkowski DIstance, dan Manhattan DIstance pada Algoritma K-Means Clustering berbasis Chi-square," Jurnal Informatika: Jurnal Pengembangan IT (JPIT), vol. 4, no. 1, pp. 20 - 24, 2019.

I. Kamila, U. Khairunnisa and M. , "Perbandingan Algoritma K-Means dan K-Medoids untuk PengelompokanData Transaksi Bongkar Muat di Provinsi Riau," Jurnal Ilmiah Rekayasa dan Manajemen Sistem Informasi, vol. 5, no. 1, pp. 119 - 125, 2019.

R. A. Daoud, A. Amine, B. Bouikhalene and R. Lbibb, "Customer Segmentation Model in E-Commerce Using Clustering Techniques and LRFM Model: The Case of Online Store in Morocco," International Journal of Computer and Information Engineering, vol. 9, no. 8, pp. 2000 - 2010, 2015.

D. C. Li, W. L. Dai and W. T. Tseng, "A two-stage clustering method to analyze customer characteristics to build discriminative customer management: A case of textile manufacturing business," Expert System with Applications, vol. 38, no. 6, pp. 7186 - 7191, 2011.

G. N. W. Paramartha, D. E. Ratnawati and A. W. Widodo, "Analisis Perbandingan Metode K-Means Dengan Improved Semi-Supervised K-Means Pada Data Indeks Pembangunan Manusia (IPM)," Jurnal Pengembangan Teknologi Informasi dan Ilmu Komputer, vol. 1, no. 9, pp. 813 - 824, 2017.

E. Irwansyah and M. Faisal, Advanced Clustering: Teori dan Aplikasi, Yogyakarta: DeePublish, 2015.


Article Metrics

Abstract view : 375 times
PDF - 267 times


  • There are currently no refbacks.

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