Orange Classification using Naïve Bayes and K-Nearest Neighbor Algorithms based on Its Physical Properties - Hafizulhaq, Fadli; Andasuryani, Andasuryani (EKSAKTA: Journal of Sciences and Data Analysis, 2026)
Oranges are among the most widely consumed fruits globally. While many farmers possess extensive knowledge of orange cultivation, they often lack expertise in post-harvest handling and processing. Classification or grading is a crucial step after harvest to ensure quality. Machine learning offers an efficient solution for automating this process and decreasing the time consumed. This study implements two machine learning algorithms, Naïve Bayes and K-Nearest Neighbor, to classify Gerga oranges based on different training-to-test data ratios (75:25, 50:50, and 25:75). The results indicate that as the training data decreases, the accuracy of Naïve Bayes improves, but its precision declines, whereas K-Nearest Neighbor exhibits the opposite trend. The best accuracy (90% accuracy) was produced by NB-25 and KNN-75. Meanwhile, precision and recall value were more important in order to reduce economic losses and buyer dissatisfaction, so that users can profit more. In this case, the KNN-75 model is the best to classify Gerga oranges into theright groups (85% precision, 91% recall). Despite the differences in class importance, KNN offers a steadier and more balanced outcome for both sides of the dataset. KNN is also more reliable to handle many number of samples in real practice when the model is used to design sorting or grading machines for oranges.