Comparison of Naïve Bayes and Logistic Regression for MBG Sentiment Analysis on X - Fibry Widianti; Nurdin; Fajriana (Universitas Medan Area, 2026)
The Free Nutritious Meal Program (MBG) is a strategic step by the Indonesian government to improve the quality of human resources through nutritional improvement. However, this policy has triggered polarization of opinion on social media X, ranging from support to criticism regarding distribution and transparency. This study aims to analyze public perception of the MBG program by comparing the performance of the Naïve Bayes and Logistic Regression algorithms. A total of 1,500 tweets were collected through scraping techniques using Tweetharvest. The research stages included text preprocessing and feature extraction using TF-IDF, with a 70:30 split between training and testing data. The evaluation results showed that Logistic Regression had superior performance with an accuracy of 72%, a precision of 72.17%, a recall of 69.32%, and an f1-score of 69.60%. Meanwhile, Naïve Bayes achieved an accuracy of 70.22%, a precision of 80.52%, a recall of 65.36%, and an f1-score of 63.70%. Research findings indicate that Logistic Regression is more dominant in predicting negative and neutral sentiment, while Naïve Bayes tends to dominate predictions of positive sentiment. Overall, Logistic Regression has proven more consistent and effective in mapping the dynamics of public perception of government policies on digital platforms than Naïve Bayes.