Analysis of Public Sentiment Towards the Free Nutritious Meals Program on TikTok Social Media Using the K-Nearest Neighbor Algorithm - Nugroho, Ivan; Mujiyono, Sri (Politeknik Negeri Batam, 2026)
The Free Nutritious Meals Program is currently one of the most talked about public policies, generating a wide range of responses from the public. One of the most active discussion forums is the social media platform TikTok, given that it has a large number of users and a relaxed and informal style of language. This study aims to examine public sentiment toward the MBG program through TikTok user comments, while also testing the performance of the K-Nearest Neighbor (KNN) algorithm in classifying sentiment as positive or negative. Research data was collected by crawling comments on several TikTok videos discussing Free Nutritious Meals during the period from September to November 2025. A total of 1,000 comments were obtained and then processed through data cleaning stages, such as data cleaning, case folding, normalization, tokenization, stopword removal, and stemming. To convert the text into numerical form, the Term Frequency–Inverse Document Frequency (TF-IDF) method was used. Meanwhile, sentiment labeling was done manually to maintain the quality of the training data. Model performance was evaluated using a confusion matrix with accuracy, precision, recall, and F1-score indicators. The test results showed that the best accuracy rate, which was 70.50%, was obtained at a K value of 4. From the sentiment analysis conducted, negative comments were found to outnumber positive sentiments. The criticism that emerged generally related to food quality and safety, inequality in program distribution, and a lack of transparency in information provided to the public. This study shows that the KNN algorithm is quite capable of being used for sentiment analysis on TikTok comment data, although it still has limitations in understanding the variety of informal language often used by users. Therefore, the results of this study are expected to provide public opinion-based input for policymakers, as well as a foundation for the development of sentiment analysis methods that are more suited to the characteristics of social media in future studies.