Hybrid Food Recommendation System using Term Frequency–Inverse Document Frequency (TF-IDF), K-Nearest Neighbors (KNN), and Tag-Based Similarity

Juventania Sheva Mellany, Kusnawi Kusnawi

Submitted : 2025-12-04, Published : 2026-02-10.

Abstract

The rapid growth of the digital culinary industry increases the need for intelligent menu recommendation systems that can assist customers in making accurate and personalized choices. This study develops a hybrid food recommendation system that integrates three complementary approaches: popularity-based ranking, Term Frequency–Inverse Document Frequency (TF-IDF) with K-Nearest Neighbors (KNN) item similarity, and tag-based cosine matching. The system also incorporates a Content-Based Filtering component that leverages cosine similarity to strengthen similarity modeling across textual and tag-based representations. A total of 77,157 real transaction records from SR Cipali Restaurant, collected between April and December 2024, were used as the primary data source for system development and evaluation. Data preprocessing includes cleaning, category filtering, TF-IDF transformation for product names, One-Hot Encoding for tags, and price normalization to generate structured and comparable feature representations. Experimental results show that the TF-IDF KNN model achieves the best performance with an accuracy of 0.94, recall of 1.00, and F1-score of 0.89. The popularity-based model reaches an accuracy of 0.89 with balanced precision and recall of 0.80, while the tag-based model obtains a precision of 1.00 but lower recall due to tag inconsistency and ranking selectivity. The novelty of this study lies in the use of a hybrid lightweight framework evaluated on real-world restaurant transactions, which is rarely explored in previous research dominated by benchmark datasets. The proposed system demonstrates strong practicality for small and medium-sized restaurants that lack rating data and can be further improved by enhancing tag quality and incorporating more product attributes.

Keywords

Hybrid recommendation system; Content-Based Filtering; Term Frequency–Inverse Document Frequency (TF-IDF); K-Nearest Neighbors (KNN).

Full Text:

Untitled PDF

References

E. Febrywinata, R. Rahmatika Az-Zahra, and K. Nurfitri, “Sistem rekomendasi masakan berdasarkan ketersediaan bahan menggunakan metode content-based filtering dengan algoritma K-Nearest Neighbors [Food recipe recommendation system based on ingredient availability using content-based filtering and the K-Nearest Neighbors algorithm] (in Indonesian),” Jurnal Teknologi Informasi dan Terapan (JUTITI), vol. 5, no. 2, pp. 131–140, 2023. https://doi.org/10.55606/jutiti.v5i2.5690

R. Singh and P. Dwivedi, “Food recommendation systems based on content-based and collaborative filtering techniques,” in Proc. 14th Int. Conf. on Computing Communication and Networking Technologies (ICCCNT), 2023, pp. 1–6. https://doi.org/10.1109/ICCCNT56998.2023.10307080

J. N. Bondevik, K. E. Bennin, Ö. Babur, and C. Ersch, “A systematic review on food recommender systems,” Expert Systems with Applications, vol. 236, Art. no. 122166, Mar. 2024. https://doi.org/10.1016/j.eswa.2023.122166

F. A. Prayoga and K. Kusnawi, “Smartphone recommendation system using model-based collaborative filtering method,” Jurnal Teknik Informatika (JUTIF), vol. 3, no. 6, pp. 1613–1622, Dec. 2022. https://doi.org/10.20884/1.jutif.2022.3.6.413

L. Xia, C. Huang, Y. Xu, J. Zhao, D. Yin, and J. Huang, “Hypergraph contrastive collaborative filtering,” in Proc. 45th Int. ACM SIGIR Conf. on Research and Development in Information Retrieval, 2022, pp. 70–79. https://doi.org/10.1145/3477495.3532058

H. H. Wang, M. Zhao, X. Xie, W. Li, and M. Guo, “Knowledge graph convolutional networks for recommender systems,” in Proc. The Web Conference (WWW), 2019, pp. 3307–3313. https://doi.org/10.1145/3308558.3313417

C. N. Sánchez, J. Domínguez-Soberanes, A. Arreola, and M. Graff, “Recommendation system for a delivery food application based on number of orders,” Applied Sciences, vol. 13, no. 4, Art. no. 2299, 2023. https://doi.org/10.3390/app13042299

V. P. Verma, “Recipes recommendation system using machine learning,” International Journal of Research in Applied Science and Engineering Technology, vol. 13, no. 5, pp. 3583–3587, May 2025. https://doi.org/10.22214/ijraset.2025.71001

S. Zhang, “Restaurant recommendation system based on TF-IDF vectorization: Integrating content-based and collaborative filtering approaches,” in Proc. Int. Conf. on Data Science, Advanced Algorithm and Intelligent Computing (DAI), 2024, pp. 610–618. https://doi.org/10.2991/978-94-6463-370-2_62

P. V. Snigdha, M. Naveen, S. Rahul, C. N. Sujatha, and P. Pradeep, “Movie recommendation system using TF-IDF vectorization and cosine similarity,” International Journal of Research in Applied Science and Engineering Technology, vol. 10, no. 8, pp. 1128–1134, Aug. 2022. https://doi.org/10.22214/ijraset.2022.46367

Y. Nuri and E. Senyurek, “Research abstracts similarity implementation using the TF-IDF algorithm,” IOSR Journal of Computer Engineering, vol. 27, no. 1, pp. 4–10, 2025. https://doi.org/10.9790/0661-2701040410

Z. T. Yap, S. C. Haw, and N. E. Binti Ruslan, “Hybrid-based food recommender system utilizing KNN and SVD approaches,” Cogent Engineering, vol. 11, no. 1, Art. no. 2436125, 2024. https://doi.org/10.1080/23311916.2024.2436125

R. S. Rao, “Personalized book recommendation system using a TF-IDF and KNN hybrid,” International Journal of Research in Applied Science and Engineering Technology, vol. 10, no. 7, pp. 3872–3874, Jul. 2022. https://doi.org/10.22214/ijraset.2022.45736

R. Yera, A. A. Alzahrani, L. Martínez, and R. M. Rodríguez, “A systematic review on food recommender systems for diabetic patients,” International Journal of Environmental Research and Public Health, vol. 20, no. 5, Art. no. 4248, 2023. https://doi.org/10.3390/ijerph20054248

Y. Y. Chow, S. C. Haw, P. Naveen, E. A. Anaam, and H. Bin Mahdin, “Food recommender system: A review on techniques, datasets and evaluation metrics,” Journal of System and Management Sciences, vol. 13, no. 5, pp. 153–168, 2023. https://doi.org/10.33168/JSMS.2023.0510

Z. Patel and H. J. Chokshi, “Food recommender system: Methods, challenges, and future research directions,” International Journal of Engineering Trends and Technology, vol. 73, no. 5, pp. 123–130, 2025. https://doi.org/10.14445/22315381/IJETT-V73I5P123

R. N. Bin Rais, M. Noman, O. Khalid, and I. A. Khan, “A hybrid group-based food recommender framework for handling overlapping memberships,” Applied Sciences, vol. 14, no. 13, Art. no. 5843, 2024. https://doi.org/10.3390/app14135843

M. Li, “Recommendation system building based on CNN and TF-IDF approaches,” in Proc. Int. Conf. on Artificial Intelligence and Data Engineering, 2024, pp. 215–220.

L. N. Luyen, M. H. Abel, and P. Gouspillou, “Enhancing context-aware recommender systems through deep feature interaction learning,” Journal of Multi-Criteria Decision Analysis, vol. 32, no. 1, pp. 45–58, 2025. https://doi.org/10.1002/mcda.70012

R. Alabduljabbar, “Matrix factorization collaborative-based recommender system for Riyadh restaurants: Leveraging machine learning to enhance consumer choice,” Applied Sciences, vol. 13, no. 17, Art. no. 9574, 2023. https://doi.org/10.3390/app13179574

N. Thongsri, P. Warintarawej, S. Chotkaew, and W. Saetang, “Implementation of a personalized food recommendation system based on collaborative filtering and the knapsack method,” International Journal of Electrical and Computer Engineering, vol. 12, no. 1, pp. 630–638, 2022. https://doi.org/10.11591/ijece.v12i1.pp630-638

M. J. Awan et al., “A recommendation engine for predicting movie ratings using a big data approach,” Electronics (Switzerland), vol. 10, no. 10, Art. no. 1215, May 2021. https://doi.org/10.3390/electronics10101215

Article Metrics

Abstract view: 41 times
Download     : 0   times Download     : 0   times

Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.

Refbacks

  • There are currently no refbacks.