EKSAKTA: Journal of Sciences and Data Analysis
VOLUME 7, ISSUE 1, April 2026

Orange Classification using Naïve Bayes and K-Nearest Neighbor Algorithms based on Its Physical Properties

Hafizulhaq, Fadli (Unknown)
Andasuryani, Andasuryani (Unknown)



Article Info

Publish Date
30 Apr 2026

Abstract

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.

Copyrights © 2026






Journal Info

Abbrev

eksakta

Publisher

Subject

Chemical Engineering, Chemistry & Bioengineering Chemistry Earth & Planetary Sciences Materials Science & Nanotechnology

Description

Ekstakta is an interdisciplinary journal with the scope of mathematics and natural sciences that is published by Fakultas MIPA Universitas Islam Indonesia. All submitted papers should describe original, innovatory research, and modelling research indicating their basic idea for potential ...