The “Makan Bergizi Gratis” (MBG) Program is a public policy aimed at improving the nutritional quality of the community, particularly vulnerable groups. However, the success of this program is heavily influenced by public sentiment and perception. This research analyzes public sentiment toward the MBG program thru the social media platform X using an ensemble-based machine learning approach. The proposed framework integrates the Random Forest algorithm and compares it with four other ensemble models: AdaBoost, XGBoost, Bagging, and Stacking. A total of 3,417 tweets were analyzed using the TF-IDF method, both with and without stemming. The Random Forest model showed the best performance with an accuracy of 91.15% and an ROC-AUC of 95.46% on the data without stemming, consistently outperforming the other models. Additionally, a visual analysis of word frequency provides a strong indication of public opinion. These findings demonstrate the effectiveness of Random Forest in managing unstructured sentiment data and provide valuable insights for policymakers to monitor public responses and improve program implementation with greater precision.