Performance Analysis of K-Nearest Neighbor and Naive Bayes Algorithms on the Wine Dataset

Main Article Content

tri wahyuni
Ayla Zhafira
Rahma Yulia Sifa

Abstract




 
 





Advancements in computational technology have positioned classification as an essential tool for automated decision-making. This study presents a comparative analysis of the performance of two popular classification algorithms, K-Nearest Neighbor (KNN) and Naive Bayes, applied to the Wine Dataset. The research aims to determine the most optimal model in terms of accuracy and execution efficiency. A quantitative experimental method was employed, incorporating StandardScaler preprocessing and a 70% training–30% testing data split. The results show that Gaussian Naive Bayes (GNB) outperforms KNN with a perfect accuracy of 100% and the fastest execution time (0.0037 seconds). In contrast, KNN (k = 5) achieved an accuracy of 94.44% with slower computational performance. The strong performance of GNB is supported by the characteristics of the Wine Dataset, which align well with the feature independence assumption. The contribution of this study lies in providing empirical evidence and practical guidance for selecting efficient algorithms for small to medium-sized structured datasets, serving as a reference for researchers and practitioners when determining appropriate classification models for similar cases.

Article Details

Section
Articles

References

[1] A. Rachman Andhika, “Machine Learning Dalam Pengembangan Perangkat Lunak,” Integrative Perspectives of Social and Science Journal, vol. 2, no. 1, p. 1211, 2025.

[2] N. H. Alhumaidi, D. Dermawan, H. F. Kamaruzaman, and N. Alotaiq, “The Use of Machine Learning for Analyzing Real-World Data in Disease Prediction and Management: Systematic Review,” JMIR Med Inform, vol. 13, 2025, doi: 10.2196/68898.

[3] P. Nabila, F. Wajidi, and W. Firgiawan, “Analisis Algoritma K-Nearest Neighbor dan Naive Bayes pada Kebijakan Perkuliahan Online dengan Multi Bahasa,” Techno.Com, vol. 24, no. 2, pp. 524–542, May 2025, doi: 10.62411/tc.v24i2.12656.

[4] S. Arti and E. Suherlan, “Evaluasi Kinerja Machine Learning dalam Memprediksi Kemampuan Adaptasi Mahasiswa pada Lingkungan Pembelajaran Daring,” Jurnal Pustaka AI (Pusat Akses Kajian Teknologi Artificial Intelligence), vol. 5, no. 1, pp. 50–57, Apr. 2025, doi: 10.55382/jurnalpustakaai.v5i1.901.

[5] U. Khaira, R. Aryani, and R. W. Hardian, “Komparasi Algoritma Naïve Bayes Dan Support Vector Machine (SVM) Pada Analisis Sentimen Kebijakan Kemdikbudristek Mengenai Kuota Internet Selama Covid-19,” Jurnal PROCESSOR, vol. 18, no. 2, Nov. 2023, doi: 10.33998/processor.2023.18.2.897.

[6] R. N. Devita, H. W. Herwanto, and A. P. Wibawa, “Perbandingan Kinerja Metode Naive Bayes dan K-Nearest Neighbor untuk Klasifikasi Artikel Berbahasa indonesia,” Jurnal Teknologi Informasi dan Ilmu Komputer, vol. 5, no. 4, pp. 427–434, Oct. 2018, doi: 10.25126/jtiik.201854773.

[7] Triandes Sinaga, Kevin Bastian Sirait, J. J. Pangaribuan, O. P. Barus, and R. Romindo, “Analisis Kualitas Wine Menggunakan Machine Learning dengan Pendekatan SMOTE dan Seleksi Fitur,” INSOLOGI: Jurnal Sains dan Teknologi, vol. 4, no. 3, pp. 656–668, Jun. 2025, doi: 10.55123/insologi.v4i3.5436.

[8] E. N. R. Khakim, A. Hermawan, and D. Avianto, “Implementasi Correlation Matrix Pada Klasifikasi Dataset Wine,” JIKO (Jurnal Informatika dan Komputer), vol. 7, no. 1, p. 158, Feb. 2023, doi: 10.26798/jiko.v7i1.771.

[9] “Wine Dataset in Sklearn,” GeekssforGeeks.

[10] D. Azzahra Nasution, H. H. Khotimah, and N. Chamidah, “Perbandingan Normalisasi Data Untuk Klasifikasi Wine Menggunakan Algoritma K-Nn,” CESS (Journal of Computer Engineering System and Science), vol. 4, no. 1, pp. 2502–7131, Jan. 2019, Accessed: Nov. 26, 2025. [Online]. Available: https://www.researchgate.net/

[11] V. Wulandari, W. J. Sari, Z. Alfian, L. Legito, and T. Arifianto, “Implementasi Algoritma Naïve Bayes Classifier dan K-Nearest Neighbor untuk Klasifikasi Penyakit Ginjal Kronik,” MALCOM: Indonesian Journal of Machine Learning and Computer Science, vol. 4, no. 2, pp. 710–718, Apr. 2024, doi: 10.57152/malcom.v4i2.1229.

[12] D. Fabiyanto and Y. Rianto, “Performance Evaluation of Multiple Machine Learning Models for Wine Quality Prediction Evaluasi Kinerja Multiple Model Machine Learning untuk Prediksi Kualitas Wine,” Jurnal Informatika dan Teknologi Informasi, vol. 21, no. 2, pp. 209–223, 2024, doi: 10.31515/telematika.v21i2.

[13] A. Suarisman, A. Nazir, F. Syafria, and L. Afriyanti, “Perbandingan Jarak Metrik pada Klasifikasi Jamur Beracun Menggunakan Algoritma K-Nearest Neighbor (K-NN),” Journal of Computer System and Informatics (JoSYC), vol. 5, no. 1, pp. 10–19, Nov. 2023, doi: 10.47065/josyc.v5i1.4511.

[14] D. Pratmanto, A. Widayanto, Y. Meisella Kristania, and R. Wijianto, “Analisis Perbandingan Algoritma Naive Bayes Dan KNN Untuk Analisis Sentimen Ulasan Pengguna Aplikasi Vidio Di Google Play Store,” CONTEN : Computer and Network Technology, vol. 4, no. 2, pp. 119–124, 2024, [Online]. Available: http://jurnal.bsi.ac.id/index.php/conten

[15] R. Eko Putri and R. Rahmawati, “Perbandingan Metode Klasifikasi Naïve Bayes Dan K-Nearest Neighbor Pada Analisis Data Status Kerja Di Kabupaten Demak Tahun 2012,” vol. 3, no. 4, pp. 831–838, 2014, [Online]. Available: http://ejournal-s1.undip.ac.id/index.php/gaussian

[16] M. R. Elfansyah, Rudiman, and F. Yulianto, “Perbandingan Metode K-Nearest Neighbor (KKN) dan Naive Bayes Terhadap Analisis Sentimen pada pengguna E-Wallet Aplikasi Dana Menggunakan Fitur Ekstraksi TF-IDF,” Jurnal Keilmuan dan Aplikasi Bidang Teknik Informasi, vol. 18, no. Vol. 18 No. 2 (2024): Jurnal Teknologi Informasi : Jurnal Keilmuan dan Aplikasi Bidang Teknik Informatika, Aug. 2024, doi: https://doi.org/10.47111/jti.v18i2.15009.