Comparison of K-Nearest Neighbor and Naïve Bayes Classification Methods for Coconut Maturity Data
Main Article Content
Abstract
Classification of coconut maturity level is an important aspect in the coconut industry to ensure product quality and optimal selling value. This study aims to compare the performance of two data mining classification methods, namely K-Nearest Neighbors (KNN) and Naïve Bayes, in classifying coconut maturity levels in Tembilahan, Indragiri Hilir Regency. The dataset used consists of 300 data with parameters such as skin color, fruit weight, diameter, and fruit texture condition. Evaluation was conducted using accuracy, precision, recall, F1-score, and Cohen's Kappa metrics with 80:20 data division for training and testing. The results showed that the Naïve Bayes method provided superior performance with an accuracy of 86.67% and a Cohen's Kappa value of 0.795 compared to KNN which only achieved an accuracy of 43.33% and a Cohen's Kappa value of 0.144. Naïve Bayes also showed better consistency in classifying the three categories of coconut maturity (young, semi-old, and old) with an average F1-score of 0.8455 versus 0.4119 for KNN. This study provides a recommendation that the Naïve Bayes method is more effective for coconut maturity classification, especially in data conditions that are not fully optimized in terms of preprocessing.
Article Details

This work is licensed under a Creative Commons Attribution 4.0 International License.
References
[1] A. Muni et al., “Deteksi dan Klasifikasi Hama dan Penyuakit Tanaman Kelapa Menggunakan Nearest Mean Classifier Di Kabupaten Indragiri Hilir,” J. Perangkat Lunak, vol. 6, pp. 414–427, 2024.doi: https://doi.org/10.32520/jupel.v6i3.3655
[2] U. Masparudin, Abdullah, “Sistem Prediksi Kualitas Santan Kelapa Menggunakan Nearest Mean Classifier (NMC),” Sist. J. Sist. Inf., vol. 9, no. 3, pp. 645–655, 2020. doi: 10.32520/stmsi.v9i3.1015
[3] A. Muni and M. Jibril, “Penerapan Metode Naive Bayes Classifier Dalam Pemilihan Kualitas Bibit Kelapa Untuk Masyarakat Petani Kelapa Di Indragiri Hilir,” J. Perangkat Lunak, vol. 5, no. 3, pp. 313–322, 2023, doi: 10.32520/jupel.v5i3.2780.
[4] R. R. Marlis, Abdullah, and F. Yunita, “Sistem Prediksi Kualitas Kopra Putih Menggunakan k-Nearest Neighbor (k-NN),” Sist. J. Sist. Inf., vol. 10, no. 2, pp. 290–299, 2021, [Online]. Available: http://sistemasi.ftik.unisi.ac.id
[5] O. D. Kurnia, E. T. A. Fena, D. Yuliana, A. Ningrum, E. Daniati, and A. Ristyawan, “Analisis Perbandingan Algoritma Naïve Bayes dengan K-Nearest Neighbor ( KNN ) Pada Dataset Mobile Price Classification,” vol. 8, pp. 1174–1183, 2024.
[6] S. Sahar, “Analisis Perbandingan Metode K-Nearest Neighbor dan Naïve Bayes Clasiffier Pada Dataset Penyakit Jantung,” Indones. J. Data Sci., vol. 1, no. 3, pp. 79–86, 2020, doi: 10.33096/ijodas.v1i3.20.
[7] I. Yuswandi, D. Y. Prasetyo, “Sistem Pakar Diagnosa Penyakit Refraksi Menggunakan Metode Forward Chaining Berbasis Web,” J. Perangkat Lunak, vol. 14, no. 1, pp. 1–10, 2022, doi: 10.56708/progres.v14i1.300.
[8] H. Mardesci, M. Maryam, and K. Ihwan, “Forecasting Coconut Production in Indragiri Hilir with Autoregressive Integrated Moving Average Model,” Sistemasi, vol. 12, no. 1, p. 219, 2023, doi: 10.32520/stmsi.v12i1.2531.
[9] Samsudin, Z. Ilyas, and F. Tanjung, “Sistem Pakar Diagnosa Penyakit Sindrom Metabolik pada Rumah Sakit Umum Daerah Tembilahan.,” Sist. J. Sist. Inf., vol. 12, no. September, pp. 1007–1018, 2023. doi: 10.32520/stmsi.v12i3.3516
[10] A. Ikhlas, A. Abdullah, and D. Y. Prasetyo, “Mesin Pembelajaran Ensemble Untuk Identifikasi Varietas Padi,” Inform. Pertan., vol. 29, no. 2, p. 123, 2020, doi: 10.21082/ip.v29n2.2020.p123-130.
[11] F. M. Delta Maharani, A. Lia Hananto, S. Shofia Hilabi, F. Nur Apriani, A. Hananto, and B. Huda, “Perbandingan Metode Klasifikasi Sentimen Analisis Penggunaan E-Wallet Menggunakan Algoritma Naïve Bayes dan K-Nearest Neighbor,” Metik J., vol. 6, no. 2, pp. 97–103, 2022, doi: 10.47002/metik.v6i2.372.
[12] C. Kurniawan and H. Irsyad, “Perbandingan Metode K-Nearest Neighbor Dan Naïve Bayes Untuk Klasifikasi Gender Berdasarkan Mata,” J. Algoritm., vol. 2, no. 2, pp. 82–91, 2022, doi: 10.35957/algoritme.v2i2.2358.
[13] V. Nadya, “Perbandingan Metode Klasifikasi Naïve Bayes dan K-Nearest Neighbor pada Data Status Pembayaran Pajak Pertambahan Nilai di Kantor Pelayanan Pajak Pratama Surakarta,” pp. 231–236, 2024., doi: 10.31284/p.snestik.2024.5880
[14] S. I. Guslianto and S. ‘Uyun, “Klasifikasi Kematangan Buah Sawit Berdasarkan Fitur Warna, Bentuk dan Tekstur Menggunakan Algoritma K-NN,” J. Edukasi dan Penelit. Inform., vol. 9, no. 3, p. 407, 2023, doi: 10.26418/jp.v9i3.64877.
[15] W. D. Prasetya and B. Sujatmiko, “Rancang Bangun Aplikasi dengan Perbandingan Metode K-Nearest Neighbor (KNN) dan Naive Bayes dalam Klasifikasi Penderita Penyakit Diabetes,” J. Informatics Comput. Sci., vol. 3, no. 04, pp. 515–525, 2022, doi: 10.26740/jinacs.v3n04.p515-525.
[16] Z. Endesah, “Sistem Informasi Agronomi tanaman kelapa pada industri hulu dan hilir di Kabupaten Indragiri Hilir,” 2021.
[17] S. N. sari Muslim, “Perbandingan Algoritma Naive Bayes dan KNN dalam Analisis Sentimen Ulasan Pengguna Aplikasi Capcut,” J. Inform. dan Teknol., vol. 2, no. 3, pp. 61–69, 2019. doi: 10.23960/jitet.v12i3S1.5156
[18] M. Amin and A. Bindas, “Pengklasifikasi Bibit Kelapa Menggunakan Algoritma Deep Learning Convolutional Neural Network,” J. Perangkat Lunak, vol. 6, pp. 405–413, 2024. doi: 10.32520/jupel.v6i3.3654
[19] M. R. Ridha and F. Yunita, “Pemilihan Bibit Kelapa Menggunakan Metode Nearest Mean Classifier Untuk Masyarakat Petani Kelapa Di Kabupaten Indragiri Hilir,” J. Perangkat Lunak, vol. 2, no. 3, pp. 101–114, 2020, doi: 10.32520/jupel.v2i3.1306.