Bulletin of Computer Science Research
Vol. 6 No. 4 (2026): June 2026

Penerapan Algoritma K-Means Clustering untuk Pengelompokan Pola Penjualan Sembilan Bahan Pokok pada Pusat Distribusi Berbasis Dataset Kaggle

Fitriah Fitriah (Universitas Muhammadiyah Bengkulu, Bengkulu)
Dia Komalla (Universitas Muhammadiyah Bengkulu, Bengkulu)
Muhajir Yunus (Universitas Muhammadiyah Gorontalo, Gorontalo)



Article Info

Publish Date
30 Jun 2026

Abstract

Sales data management of staple food products (sembako) is an important concern for distribution centers because stock storage decisions are still largely based on the estimation or experience of warehouse staff rather than on adequate historical data analysis. This condition creates the risk of overstocking slow-moving products on one hand, and stockouts of high-demand products on the other, potentially causing operational losses. This study aims to apply the K-Means algorithm to cluster staple food sales data based on sales patterns, using product type and total units sold as variables after being encoded and scaled. The dataset used was obtained from Kaggle, consisting of 1,200 sales transaction records. The research stages include problem identification, data collection, data pre-processing (cleaning, transformation, and standardization), implementation of the K-Means algorithm with k=3, result analysis, and model evaluation using the Silhouette Score. The clustering process was carried out using Python libraries in Google Colaboratory. The results show that all sales data were successfully grouped into three clusters labeled -1, 0, and 1, namely cluster -1 (not in demand), cluster 0 (less in demand), and cluster 1 (in demand). Cluster 1 dominates with 930 data points (77.5%), cluster 0 contains 269 data points (22.4%), while cluster -1 contains only 1 data point (0.1%), indicating an outlier among products with very low sales volume. These findings demonstrate that the K-Means algorithm is effective in identifying sales patterns and can be used as a basis for decision-making in inventory management strategies at distribution centers, particularly in determining storage priorities based on product demand levels.

Copyrights © 2026






Journal Info

Abbrev

bulletincsr

Publisher

Subject

Computer Science & IT

Description

Bulletin of Computer Science Research covers the whole spectrum of Computer Science, which includes, but is not limited to : • Artificial Immune Systems, Ant Colonies, and Swarm Intelligence • Bayesian Networks and Probabilistic Reasoning • Biologically Inspired Intelligence • Brain-Computer ...