Implementation of Random Forest Algorithm in Classifying Public Sentiment Towards Free Nutritious Meal Program
Ingka Amaliya Nur Sabrina, Triastuti Wuryandari, Rahmila Dapa · Current Science Research Bulletin · 2025
The free nutritious meal program in Indonesia has garnered public attention and reactions on social media, especially on X. This study aims to analyze public sentiment towards the program using the Random Forest algorithm. The data were collected from X and labeled with positive (2371 tweets) and negative (432 tweets) using the InSet Lexicon. The optimal Random Forest model was determined through hyperparameter tuning using the GridSearchCV technique. The results of the study showed that Random Forest with parameters max_features = , n_estimators = 100, max_depth = 40, min_sample_split = 2, and min_sample_leaf = 2 gave the best performance with accuracy of 87.54% and AUC score 0.8723. Based on the results, the Random Forest method proved to be effective in classifying public opinion on X regarding this program. The wordcloud visualization shows that the word “jepang” appears most frequently in positively labeled tweets, while the word “program” is more dominant in negatively labeled tweets. The results can inform government policy evaluations.