Comparison of Content-Based Filtering and K-Nearest Neighbor in Genre-Based Movie Recommendations
DOI:
https://doi.org/10.70716/reswara.v4i3.670Keywords:
content-based filtering, k-nearest neighbor, movie recommendation, machine learningAbstract
The rapid growth of digital movie platforms has increased the number of available movies, making it difficult for users to find films that match their preferences. This study aims to implement and compare Content-Based Filtering and K-Nearest Neighbor methods in a genre-based movie recommendation system. The data used in this study were obtained from the Full TMDB Movies Dataset from Kaggle, consisting of 1,422,047 initial records. The dataset was processed through several stages, including attribute selection, missing value handling, genre transformation, duplicate data removal, and feature weighting using TF-IDF, resulting in 796,425 movie records ready for modeling. Content-Based Filtering was implemented using cosine similarity to calculate the similarity between user genre preferences and movie features, while K-Nearest Neighbor was applied by identifying movies with the closest distance to the user preference vector. The results show that both methods were able to generate relevant movie recommendations based on the selected genres, namely Action, Adventure, and Science Fiction. Based on the evaluation results, both methods achieved the same accuracy of 99.92%. However, K-Nearest Neighbor showed slightly better performance, with a precision of 86.56%, recall of 80.32%, and F1-score of 83.32%, compared to Content-Based Filtering, which achieved a precision of 86.45%, recall of 79.58%, and F1-score of 82.87%. These findings indicate that K-Nearest Neighbor is slightly more effective in identifying relevant movie recommendations based on user genre preferences.
References
Aditi, A., Dubey, G. P., Shakya, H. K., & Sharma, A. (2024). SOM and Hybrid Filtering: Pioneering Next-Gen Movie Recommendations in the Entertainment Industry. Fusion: Practice and Applications, 16(2), 43–62. https://doi.org/10.54216/FPA.160204
Andayani, D. D., Nurfitri, A. A., Adiba, F., & Yahya, M. (2024). Early detection system for melanoma skin cancer using reinforcement learning method. 030005. https://doi.org/10.1063/5.0221127
Apmi Salma Kinanthi, Alivia Putrian Wijaya, Dwi Yanawati, Siti Syamsidar, & Edy Widodo. (2025). Pengelompokkan Kabupaten/Kota di Pulau Jawa Berdasarkan Faktor Kemiskinan Menggunakan Metode Hierarchical Clustering. Evolusi : Jurnal Sains Dan Manajemen, 13(1), 40–51. https://doi.org/10.31294/evolusi.v13i1.8209
Ardiansyah, R., Ari Bianto, M., & Saputra, B. D. (2023). Sistem Rekomendasi Buku Perpustakaan Sekolah menggunakan Metode Content-Based Filtering. Jurnal CoSciTech (Computer Science and Information Technology), 4(2), 510–518. https://doi.org/10.37859/coscitech.v4i2.5131
Asa Dilla Safitri, Vihi Atina, & Anisatul Farida. (2024). Sistem rekomendasi buku menggunakan metode content-based filtering. INFOTECH : Jurnal Informatika & Teknologi, 5(2), 218–227. https://doi.org/10.37373/infotech.v5i2.1302
Azizah, N., & Rozi, A. F. (2024). Sistem Rekomendasi Produk Somethinc Menggunakan Metode Content-based Filtering. Jurnal Teknologi Dan Sistem Informasi Bisnis, 6(3), 461–468. https://doi.org/10.47233/jteksis.v6i3.1411
Bsoul, Q., Zawaideh, F., Alqadi, B. S., Almusfar, L. A., Khalaf, O. I., Alattas, A. S., Alali, M., & AbdElminaam, D. S. (2025). From User Preferences to Accurate Predictions: Enhancing Movie Recommendation Systems with Neural Collaborative Filtering and Sentiment Analysis. SN Computer Science, 6(3), 257. https://doi.org/10.1007/s42979-025-03742-7
Cholik, C. A. (2021). Perkembangan Teknologi Informasi Komunikasi / ICT dalam Berbagai Bidang. Jurnal Fakultas Teknik UNISA Kuningan, 2(2), 39–46.
Huda, A. A., Fajarudin, R., & Hadinegoro, A. (2022). Sistem Rekomendasi Content-based Filtering Menggunakan TF-IDF Vector Similarity Untuk Rekomendasi Artikel Berita. Building of Informatics, Technology and Science (BITS), 4(3). https://doi.org/10.47065/bits.v4i3.2511
Kusuma, I. H., & Cahyono, N. (2023). Analisis Sentimen Masyarakat Terhadap Penggunaan E-Commerce Menggunakan Algoritma K-Nearest Neighbor. Jurnal Informatika: Jurnal Pengembangan IT, 8(3), 302–307. https://doi.org/10.30591/jpit.v8i3.5734
Lonang, S., & Normawati, D. (2022). Klasifikasi Status Stunting Pada Balita Menggunakan K-Nearest Neighbor Dengan Feature Selection Backward Elimination. JURNAL MEDIA INFORMATIKA BUDIDARMA, 6(1), 49. https://doi.org/10.30865/mib.v6i1.3312
Muliawan, A., Badriyah, T., & Syarif, I. (2022). Membangun Sistem Rekomendasi Hotel dengan Content Based Filtering Menggunakan K-Nearest Neighbor dan Haversine Formula. Technomedia Journal, 7(2), 231–247. https://doi.org/10.33050/tmj.v7i2.1893
Nguyen, L. V., Nguyen, T.-H., & Jung, J. J. (2020). Content-Based Collaborative Filtering using Word Embedding. Proceedings of the International Conference on Research in Adaptive and Convergent Systems, 96–100. https://doi.org/10.1145/3400286.3418253
Nguyen, L. V., Vo, Q.-T., & Nguyen, T.-H. (2023). Adaptive KNN-Based Extended Collaborative Filtering Recommendation Services. Big Data and Cognitive Computing, 7(2), 106. https://doi.org/10.3390/bdcc7020106
Retnoningsih, E., & Pramudita, R. (2020). Mengenal Machine Learning Dengan Teknik Supervised Dan Unsupervised Learning Menggunakan Python. BINA INSANI ICT JOURNAL, 7(2), 156. https://doi.org/10.51211/biict.v7i2.1422
Ridwansyah, T., Subartini, B., & Sylviani, S. (2024). Penerapan Metode Content-Based Filtering pada Sistem Rekomendasi. Mathematical Sciences and Applications Journal, 4(2), 70–77. https://doi.org/10.22437/msa.v4i2.32136
Riyadi, S., Audita, N., & Abidin, F. A. (2024). Movie Recommendation Using Collaborative Filtering Method and K-Nearest Neighbours: A Case Study on Netflix (pp. 428–436). https://doi.org/10.1007/978-3-031-70518-2_38
Rochmad Wahono, A., Aji Saputra, B., & Fadlu Rahman, F. (2024). Sistem Rekomendasi Film Menggunakan Metode Content-Based Filtering dan Algoritma K-Nearest Neighbors (KNN). Prosiding Seminar Nasional Teknologi Informasi Dan Bisnis, 1–6. https://doi.org/10.47701/senatib.v4i1.3994
Sari, N. noor kamala, Licantik, L., & Zahra, M. (2024). Pemanfaatan Sistem Rekomendasi Menggunakan Content-Based Filtering pada Hotel di Palangka Raya. Technologia : Jurnal Ilmiah, 15(4), 754. https://doi.org/10.31602/tji.v15i4.16282
Savitri, N. L. P. C., Rahman, R. A., Venyutzky, R., & Rakhmawati, N. A. (2021). Analisis Klasifikasi Sentimen Terhadap Sekolah Daring pada Twitter Menggunakan Supervised Machine Learning. Jurnal Teknik Informatika Dan Sistem Informasi, 7(1). https://doi.org/10.28932/jutisi.v7i1.3216
Sitti Aliyah Azzahra, Syafran Nurrahman, & Aep Saefullah. (2024). Integrasi Kecerdasan Buatan Dalam Sistem Rekomendasi Produk Untuk E-Commerce. Jurnal Sains Dan Teknologi, 3(1), 21–28. https://doi.org/10.58169/saintek.v3i1.394
Downloads
Published
Issue
Section
License
Copyright (c) 2026 Irfan Nur Sofiyanto, Nurmalitasari, Rudi Susanto (Author)

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




