The Free Nutritional Meal Program (MBG) is a government policy that has generated various public responses on social media X. The large volume of opinions generated makes sentiment analysis an effective approach to automatically identify public perception. This study aims to analyze public sentiment towards the Free Nutritional Meal Program and compare the performance of the Naive Bayes, Logistic Regression, and Support Vector Machine (SVM) algorithms in classifying sentiment. The study uses a quantitative approach based on Natural Language Processing (NLP) with stages of data collection, preprocessing, sentiment labeling using a lexicon approach, feature extraction using Term Frequency–Inverse Document Frequency (TF-IDF), data division using Stratified Train-Test Split, validation using Stratified K-Fold Cross Validation, parameter optimization through GridSearchCV, and model evaluation using Accuracy, Precision, Recall, F1-Score, Confusion Matrix, and ROC Curve. The results show that the crawling process produced 2,798 tweets, then after preprocessing obtained 2,703 tweets used in the classification process. The sentiment distribution shows a predominance of positive sentiment towards the Free Nutritional Meal Program. All algorithms performed well in classification after parameter optimization. Based on the evaluation results, Logistic Regression performed best, followed by Support Vector Machine, while Naive Bayes yielded competitive results as a comparison model. This study demonstrates that the combination of preprocessing, lexicon-based labeling, TF-IDF feature extraction, and model optimization produces effective sentiment classification and can be utilized to support data-driven public policy evaluation.
Copyrights © 2026