Penerapan Algoritma K-Means Clustering untuk Pengelompokan Pola Penjualan Sembilan Bahan Pokok pada Pusat Distribusi Berbasis Dataset Kaggle
DOI:
https://doi.org/10.47065/bulletincsr.v6i4.1054Keywords:
Data Mining; K-Means; Clustering; Sales Data; Staple Food ProductsAbstract
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.
Downloads
References
F. D. Rahman, M. I. Zulfa, and A. Taryana, “Clustering dan Klasifikasi Data Cuaca Kota Cilacap Menggunakan K-Means dan Random Forest,” SINTA: Jurnal Sistem Informasi dan Teknologi Komputasi, vol. 1, no. 2, pp. 90–97, Apr. 2024, doi: 10.61124/sinta.v1i2.15.
Y. P. Anggriani and A. Arif, “Implementasi Algoritma K-Means Clustering dalam Menentukan Pola Penjualan Produk,” JATI (Jurnal Mahasiswa Teknik Informatika), vol. 8, no. 2, pp. 1820–1825, 2024.
I. Riadi, Herman, Fitriah, and Suprihatin, “Optimizing Inventory with Frequent Pattern Growth Algorithm for Small and Medium Enterprises,” MATRIK: Jurnal Manajemen, Teknik Informatika, dan Rekayasa Komputer, vol. 23, no. 1, pp. 169–182, Nov. 2023, doi: 10.30812/matrik.v23i1.3363.
Fitriah, I. Riadi, and Herman, “Analisis Data Mining Sistem Inventory Menggunakan Algoritma Apriori,” Decode: Jurnal Pendidikan Teknologi Informasi, vol. 3, no. 1, pp. 118–129, 2023, doi: 10.51454/decode.v3i1.132.
I. Riadi, Herman, Fitriah, A. Muis, and M. Yunus, “Implementation of Association Rule Using Apriori Algorithm and Frequent Pattern Growth for Inventory Control,” Jurnal Infotel, vol. 15, no. 4, pp. 369–378, Nov. 2023, doi: 10.20895/infotel.v15i4.980.
P. Apriyani, A. R. Dikananda, and I. Ali, “Penerapan Algoritma K-Means dalam Klasterisasi Kasus Stunting Balita Desa Tegalwangi,” Jurnal Ilmu Komputer dan Sistem Informasi, 2023.
R. Y. Simanullang and M. Iqbal, “Pengelompokan Pola Interaksi Pengguna Media Sosial Menggunakan Algoritma K-Means untuk Pemetaan Aktivitas Online,” Jurnal Informatika dan Manajemen (JIMAT), vol. 6, no. 1, pp. 37–43, Jan. 2026, doi: 10.47065/jimat.v6i1.954.
A. Fauzan, N. Suarna, I. Ali, and H. Susana, “Penerapan Algoritma K-Means Clustering untuk Meningkatkan Model Pengelompokan dan Kinerja Jaringan Wi-Fi secara Optimal,” Jurnal Ilmu Komputer dan Sistem Informasi, vol. 13, no. 2, 2025.
M. A. Bui and A. Bahtiar, “Implementasi Metode Algoritma K-Means Clustering untuk Mengelompokkan Transaksi Penjualan Barang di Toko Arino,” JATI (Jurnal Mahasiswa Teknik Informatika), vol. 8, no. 2, pp. 1451–1456, 2024, doi: 10.36040/jati.v8i2.8975.
I. Syafrinal and E. L. Febrianti, “Penerapan Algoritma K-Means pada Aplikasi Data Mining untuk Menentukan Pola Penjualan (Studi Kasus: Zahra Mart),” Jurnal Teknologi Informasi, vol. 13, no. 1, pp. 31–40, 2023.
M. Fajar, N. Rahaningsih, and R. D. Dana, “Analisis Pola Penjualan Obat di Apotek AN-NAAFI Menggunakan Metode K-Means Clustering,” JATI (Jurnal Mahasiswa Teknik Informatika), vol. 8, no. 1, pp. 486–492, 2024, doi: 10.36040/jati.v8i1.8395.
A. Yahya and R. Kurniawan, “Implementation of K-Means Algorithm for Clustering Sales Data Based on Sales Patterns,” Jurnal Ilmu Komputer dan Sistem Informasi, vol. 5, no. 1, pp. 350–358, Jan. 2025.
A. A. Dermawan, A. Lawi, D. A. Putera, and D. E. Kurniawan, “Optimizing Inventory Management: Data-Driven Insights from K-Means Clustering Analysis of Prescription Patterns,” Scientific Journal of Informatics, vol. 11, no. 3, pp. 811–820, Aug. 2024.
N. A. Basulina, S. Gustiani, S. Amalia, A. Sabila, and A. Ibrahim, “Identifikasi Waktu Optimal Posting terhadap Pola Engagement Sosial Media Menggunakan Metode K-Means Clustering,” Jurnal Media Informatika Budidarma, vol. 9, no. 4, pp. 6237–6244, Oct. 2025.
I. Safira, R. Salkiawati, and W. Priatna, “Penerapan Algoritma K-Means untuk Mengetahui Pola Persediaan Barang pada Toko Raja Bekasi,” Jurnal Teknik Informatika dan Sistem Informasi, vol. 3, no. 1, pp. 99–110, 2022.
R. A. Indraputra and R. Fitriana, “K-Means Clustering Data COVID-19,” Jurnal Ilmu Komputer dan Sistem Informasi, vol. 10, no. 3, pp. 275–282, 2022.
D. Y. D. Setiawan, W. Hadikristanto, and Edora, “Grouping Production Goods Requirements Using the K-Means Clustering Method,” International Journal Software Engineering and Computer Science (IJSECS), vol. 4, no. 2, pp. 418–429, Aug. 2024, doi: 10.35870/ijsecs.v4i2.2863.
N. M. Fithryani, A. R. Dikananda, and D. Rohman, “Algoritma K-Means untuk Pengelompokan Data Penjualan,” Jurnal Ilmu Komputer dan Sistem Informasi, vol. 13, no. 1, pp. 997–1003, 2025.
M. Fajar, M. Adji, and G. Dwilestari, “Analisis Data Transaksi Penjualan Barang Menggunakan Teknik K-Means Clustering,” Jurnal Ilmu Komputer dan Sistem Informasi, vol. 9, no. 1, pp. 619–625, 2025.
P. D. P. Silitonga and I. Sri, “Klusterisasi Pola Penyebaran Penyakit Pasien Berdasarkan Usia Pasien dengan Menggunakan K-Means Clustering,” Jurnal Ilmu Komputer dan Sistem Informasi, vol. 6, no. 2, pp. 2005–2008, 2017.
K. P. Sinaga and M.-S. Yang, “Unsupervised K-Means Clustering Algorithm,” IEEE Access, vol. 8, pp. 80716–80727, 2022, doi: 10.1109/ACCESS.2022.2988796.
N. F. Adani, D. Rosadi, and A. B. Setiawan, “Implementasi Data Mining untuk Pengelompokan Data Penjualan Berdasarkan Pola Pembelian Menggunakan Algoritma K-Means Clustering pada Toko Syihan,” Jurnal Informatika Terapan, vol. 5, no. 1, pp. 1–11, 2019.
S. Nurajizah and A. Salbinda, “Penerapan Data Mining Metode K-Means Clustering untuk Analisa Penjualan pada Toko Fashion Hijab Banten,” Jurnal Teknologi dan Komunikasi, vol. 7, no. 2, pp. 158–163, 2021, doi: 10.31294/jtk.v4i2.
S. Pujiono, R. Astuti, and F. M. Basysyar, “Implementasi Data Mining untuk Menentukan Pola Penjualan Produk Menggunakan Algoritma K-Means Clustering,” JATI (Jurnal Mahasiswa Teknik Informatika), vol. 8, no. 1, pp. 615–620, Feb. 2024, doi: 10.36040/jati.v8i1.8360.
Bila bermanfaat silahkan share artikel ini
Berikan Komentar Anda terhadap artikel Penerapan Algoritma K-Means Clustering untuk Pengelompokan Pola Penjualan Sembilan Bahan Pokok pada Pusat Distribusi Berbasis Dataset Kaggle
ARTICLE HISTORY
How to Cite
Issue
Section
Copyright (c) 2026 Fitriah Fitriah, Dia Komalla, Muhajir Yunus

This work is licensed under a Creative Commons Attribution 4.0 International License.
Authors who publish with this journal agree to the following terms:
- Authors retain copyright and grant the journal right of first publication with the work simultaneously licensed under Creative Commons Attribution 4.0 International License 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 (Refer to The Effect of Open Access).













