JURNAL TEKNOLOGI DAN OPEN SOURCE
Vol. 9 No. 1 (2026): Jurnal Teknologi dan Open Source, June 2026

Comparison of KNN and Logistic Regression Algorithms in Classifying Food Product Healthiness Based on Nutritional Information

Iidris Fikri (Information Technology Study Program, Faculty of Science and Technology, Ibrahimy Sukorejo University)
Ahmad Homaidi (Information Technology Study Program, Faculty of Science and Technology, Ibrahimy Sukorejo University)
Syarif Aminul Khoiri (Information Technology Study Program, Faculty of Science and Technology, Ibrahimy Sukorejo University)



Article Info

Publish Date
11 Jun 2026

Abstract

This research was conducted to analyze and compare the effectiveness of the K-Nearest Neighbor (KNN) and Logistic Regression algorithms in identifying the health category of food products using nutritional information. The dataset employed in this study was collected from Kaggle in CSV format and consisted of several nutritional attributes, including energy, fat, protein, sugar, and sodium content. The research methodology followed a data mining process that included preprocessing, data normalization, model training, and performance evaluation through a confusion matrix. Furthermore, a web-based classification application was created using the PHP programming language to assist in testing and simulating the product classification process. The experimental results indicated that the K-Nearest Neighbor algorithm achieved an accuracy value of 84.25%, with a precision of 0.82 and a recall of 0.78. Meanwhile, Logistic Regression produced an accuracy of 82.88%, a precision of 0.81, and a recall of 0.83. Based on these findings, the K-Nearest Neighbor method demonstrated slightly better performance in classifying the healthiness of food products.

Copyrights © 2026






Journal Info

Abbrev

JTOS

Publisher

Subject

Computer Science & IT

Description

Jurnal Teknologi dan Open Source menerbitkan naskah ilmiah. yang berkaitan dengan sistem informasi, teknologi informasi dan aplikasi open source secara berkala (2 kali setahun). Jurnal ini dikelola dan diterbitkan oleh Program Studi Teknik Informatika Fakultas Teknik, Universitas Islam Kuantan ...