Loyal Customer Segmentation Using RFM Model and K-Means Algorithm on E-Commerce Data - Hersa Safitri; Haviluddin Haviluddin; Anton Prafanto (Institut Sains dan Teknologi Terpadu Surabaya (d/h Sekolah Tinggi Teknik Surabaya), 2026)
Comprehensive customer segmentation in the e-commerce context is essential for supporting effective data-driven decision-making. This research aims to develop and validate a loyal customer segmentation model by integrating Recency, Frequency, and Monetary (RFM) analysis with the K-Means clustering algorithm to generate stable, well-separated, and managerially relevant clusters. The dataset analyzed comprises 392,732 transactions from 4,339 customers, obtained from a public e-commerce platform. The research workflow includes data preprocessing, RFM score computation, feature standardization, determination of the optimal number of clusters using the Elbow Method, and cluster evaluation using the Silhouette Coefficient and Davies–Bouldin Index (DBI). The experimental results indicate that a five-cluster configuration yields the best performance, achieving a Silhouette score of 0.6158 and a DBI of 0.7190. The stability of the five-cluster solution is confirmed over 30 random initializations (Silhouette = 0.6159 ± 0.0031; mean Adjusted Rand Index = 0.9892), and its practical value is demonstrated through a segment-level revenue contribution analysis and a comparison against six baseline methods. The Champions segment (comprising Top Champions and Champions) accounts for only 0.3% of the customer base yet contributes the highest total monetary value of US190,808.54. In contrast, 94.5% of customers are classified as at risk or hibernating. These findings demonstrate that integrating RFM with K-Means, validated across multiple evaluation metrics, yields a reliable, measurable, and actionable customer segmentation framework. This approach effectively supports the development of customer retention strategies and the optimization of data-driven customer value.