Predicting Consumer Demand Based on Retail Stock Using the K-Nearest Neighbors Algorithm
DOI:
https://doi.org/10.35870/ijsecs.v4i2.2865Keywords:
K-NN, Data Mining, Retail Stock, ClassificationAbstract
Inefficient stock management, such as improper stock management, will result in excess or shortage of goods. Excess stock can cause high storage costs and the risk of unsold goods. Predict consumer needs based on stock. Analyze inefficient stock to improve shortages. One effective method for making this prediction is using the K-Nearest Neighbors (K-NN) algorithm. The K-NN algorithm is a simple but powerful machine-learning technique that can be used for classification and regression. The model scenario results show 24 objects in the Low-needs group and 14 in the High-needs group. Evaluation and performance testing using the Rapid Miner tool can also produce a relevant picture of the modelled scenario. The model implemented using the K-NN algorithm has an Accuracy value of 97.50% with a Standard Deviation of +/- 750%, then a Precision value of 100%, and a Recall value of 950%. By measuring model performance with cross-validation, the resulting accuracy has a standard deviation value, which aims to see the distance between the average accuracy and the accuracy of each experiment (iteration)
Downloads
References
Darmi, Y., & Setiawan, A. (2016). Penerapan Metode Clustering K-Means Dalam Pengelompokan Penjualan Produk. Jurnal Media Infotama, Universitas Muhammadiyah Bengkulu, 12(2), 148–157.
Hasanah, H., Larasati, W., & Komputer, F. I. (2019). Pemanfaatan Data Mining Untuk Mengelompokkan. Universitas Duta Bangsa Surakarta, 292–300.
Fahlevi, R. (2020). Penerapan Genetic Modified K-Nearest Neighbor Dalam Klasifikasi Penerima Beras Sejahtera.
Muttaqin, A. G., Auliasari, K., & Wahyuni, F. S. (2020). Penerapan Metode K-Nearest Neighbor Untuk Prediksi Penjualan Berbasis Web Pada PT Wika Industri Energy. Jati (Jurnal Mahasiswa Teknik Informatika), 4(2), 1–6. https://doi.org/10.36040/Jati.V4i2.2728
Mujilahwati, S., & Windasari, L. D. (2024). Implementasi Metode K-Nearest Neighbor (K-Nn) Untuk Memprediksi Penjualan Buah Di Indonesia Berbasis Website. Seminar Nasional Teknologi Sains, 3(1), 7–14. https://doi.org/10.29407/Stains.V3i1.4077
Iku, M. H., Mustofa, Y. A., & Kumala, I. S. (2019). Metode K-Nearest Neighbor Untuk Memprediksi Harga Eceran Beras Di Pasar Tradisional Gorontalo. Jurnal Cosphi, 3(2), 50–53.
Hamdani, R. (2020). Pengelompokkan Loyalitas Pelanggan Dengan Menggunakan Kombinasi Rfm Dan Algoritma K-Means. Journal Of Informatic Pelita Nusantara, 5(1), 7-13.
Pramana, I., & Sudiarsa, I. W. (2023). Penerapan Algoritma Naive Bayes Untuk Prediksi Penjualan Produk Terlaris Pada Cv Akusara Jaya Abadi. Jatisi (Jurnal Teknik Informatika), 10(4), 518–534.
Prastiwi, H., Pricilia, J., & Rasywir, E. (2022). Implementasi Data Mining Untuk Menentukan Persediaan Stok Barang Di Mini Market Menggunakan Metode K-Means Clustering. Jurnal Informasi dan Rekayasa Komputer (Jakakom), 2(1), 141–148. https://doi.org/10.33998/Jakakom.2022.2.1.34
Febriyanti, A., Bancin, P. V., & Amanda, S. (2022). Penerapan Metode K-Means Clustering Dalam Pengelompokan Data Penjualan Barang Pada PT Swasti Tunggal Mandiri. J-Com (Journal of Computer Science), 2(3), 205–210. https://doi.org/10.33330/J-Com.V2i3.1936
Sallaby, A. F., Alinse, R. T., Sari, V. N., & Ramadani, T. (2022). Pengelompokan Barang Menggunakan Metode K-Means Clustering Berdasarkan Hasil Penjualan Di Toko Widya Bengkulu. Jurnal Media Infotama, 18(1).
Fakhriza, M. H., & Umam, K. (2021). Analisis Produk Terlaris Menggunakan Metode K-Means Clustering Pada PT Sukanda Djaya. Jika (Jurnal Informasi dan Komputer Akuntansi), 5(1), 8. https://doi.org/10.31000/Jika.V5i1.3236
Alfani, W. P. R., Rozi, F., & Sukmana, F. (2021). Prediksi Penjualan Produk Unilever Menggunakan Metode K-Nearest Neighbor. Jipi (Jurnal Ilmiah Penelitian dan Pembelajaran Informatika), 6(1), 155–160. https://doi.org/10.29100/Jipi.V6i1.1910
Rismala, R., Ali, I., & Rinaldi, A. R. (2023). Penerapan Metode K-Nearest Neighbor Untuk Prediksi Penjualan Sepeda Motor Terlaris. Jati (Jurnal Mahasiswa Teknik Informatika), 7(1), 585–590. https://doi.org/10.36040/Jati.V7i1.6419
Irfayanti, Y., & Satria, M. I. (2020). Implementasi Metode K-Nearest Neighbor Untuk Prediksi Penjualan Beton Instan Pada PT Decon Multi Industri. Sentinel, 3(2), 288–300. https://doi.org/10.56622/Sentineljournal.V3i2.25
Saepudin, A., Aryanti, R., Fitriani, E., & Dahlia, D. (2020). Optimasi Algoritma SVM Dan k-NN Berbasis Particle Swarm Optimization Pada Analisis Sentimen Fenomena Tagar# 2019GantiPresiden. Jurnal Khatulistiwa Informatika, 6(1), 95-102.
Assistance, V. D. (2021). Optimasi Parameter K Pada Algoritma K-Nn Untuk Klasifikasi Prioritas Bantuan Pembangunan Desa. Jurnal Teknik Informatika, 20(1), 83–96.
Roni, S., Crysdian, C., & History, A. (2022). Jurnal Teknologi Dan Manajemen Informatika Studi Literature Analisis Potensi Pasar Marketplace Terhadap Penjualan. Jurnal Teknologi dan Manajemen Informatika, 8(2), 134–142.
Imron, M. A. (2020). Peningkatan Akurasi Algoritma K-Nearest Neighbor Menggunakan Normalisasi Z-Score dan Particle Swarm Optimization untuk Prediksi Customer Churn.
Desyanti, D., & Wulandari, D. (2022). Implementasi Algoritma K-Nearest Neighbour Dalam Memprediksi Stok Sepeda Motor. Building Informatics Technology Science, 4(3), 1576–1581. https://doi.org/10.47065/Bits.V4i3.2579.
Downloads
Published
Issue
Section
Categories
License
Copyright (c) 2024 Anindya Putri N.A, Wahyu Hadikristanto, Edora

This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
Authors who publish with this journal agree to the following terms:
1. Copyright Retention and Open Access License
Authors retain copyright of their work and grant the journal non-exclusive right of first publication under the Creative Commons Attribution 4.0 International License (CC BY 4.0).
This license allows unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.
2. Rights Granted Under CC BY 4.0
Under this license, readers are free to:
- Share — copy and redistribute the material in any medium or format
- Adapt — remix, transform, and build upon the material for any purpose, including commercial use
- No additional restrictions — the licensor cannot revoke these freedoms as long as license terms are followed
3. Attribution Requirements
All uses must include:
- Proper citation of the original work
- Link to the Creative Commons license
- Indication if changes were made to the original work
- No suggestion that the licensor endorses the user or their use
4. Additional Distribution Rights
Authors may:
- Deposit the published version in institutional repositories
- Share through academic social networks
- Include in books, monographs, or other publications
- Post on personal or institutional websites
Requirement: All additional distributions must maintain the CC BY 4.0 license and proper attribution.
5. Self-Archiving and Pre-Print Sharing
Authors are encouraged to:
- Share pre-prints and post-prints online
- Deposit in subject-specific repositories (e.g., arXiv, bioRxiv)
- Engage in scholarly communication throughout the publication process
6. Open Access Commitment
This journal provides immediate open access to all content, supporting the global exchange of knowledge without financial, legal, or technical barriers.
