Klasifikasi Sentimen Program Makan Bergizi Gratis di Platform X dengan TF-IDF dan Class-Weighted LinearSVC
Abstract
This study investigates the optimization of public sentiment classification related to the Free Nutritious Meal Program on Platform X by focusing on social media data that are brief, informal, noisy, and class-imbalanced. The data were collected through scraping from January 5, 2025, to February 26, 2026, producing 7,659 initial posts. After selection, preprocessing, cleaning, and labeling, 5,307 texts were used as the modeling dataset, consisting of 2,183 positive, 2,391 neutral, and 733 negative sentiments. The texts were transformed into numerical features using Term Frequency-Inverse Document Frequency with 5,000 features and unigram-bigram settings. This study evaluated Multinomial Naive Bayes, Logistic Regression, LinearSVC, and Random Forest as comparison models. Optimization was performed using GridSearchCV, while class_weight balanced was applied to improve the model’s ability to identify the smaller negative class. The evaluation results show that LinearSVC with class_weight balanced produced the most balanced performance, with an accuracy of 0.9011, macro F1-score of 0.8989, weighted F1-score of 0.9011, negative recall of 0.8367, and negative F1-score of 0.8913. The contribution of this study lies in emphasizing minority-class evaluation through negative recall and F1-score, making the model a preliminary component for digital public opinion monitoring that is more sensitive to criticism and complaints.
Downloads
References
Ulfatul Karomah; Fani Cahya Wahyuni; Yunita Dewi Trisnasari, “Program Penyelenggaraan Makan Siang Sekolah: Studi Literatur tentang Dampak Kesehatan, Hambatan dan Tantangan,” Salus Cultura: Jurnal Pembangunan Manusia dan Kebudayaan, vol. 4, no. 1, pp. 91–103, Jun. 2024, doi: 10.55480/saluscultura.v4i1.188.
S. Nur, M. Irmanto, and M. S. Fatiah, “Status Gizi Siswa Sekolah Dasar Sebelum Program Makan Bergizi Gratis di SD Negeri Inpres Skouw Sae Kota Jayapura,” Jurnal SAGO Gizi dan Kesehatan, vol. 6, no. 3, pp. 616–623, 2025, doi: 10.30867/gikes.v6i3.2818.
M. Farhan Saleh and R. Imanda, “Public Sentiment Analysis of the Free Meal Program: A Comparison of Naive Bayes and Support Vector Machine Methods on the Twitter (X) Social Media Platform,” 2025. doi: 10.30871/jaic.v9i1.8895.
N. Nyoman Aprianti et al., “Public Sentiment Analysis of the Free Nutritious Meals Program (MBG) on Social Media X Using the Naive Bayes Method,” 2025. doi: 10.30871/jaic.v9i6.11420.
L. Najib, A. A. Mahfudh, and S. Bakhri, “Analisis Sentimen Persepsi Publik Terhadap Program MBG Pada Komentar YouTube Menggunakan Naïve Bayes dan Resampling,” Technology and Science (BITS), vol. 7, no. 4, pp. 2467–2478, 2026, doi: 10.47065/bits.v7i4.9400.
M. F. Kono, I. N. Fajri, and Y. Pristyanto, “Public Sentiment Analysis on Corruption Issues in Indonesia Using IndoBERT Fine-Tuning, Logistic Regression, and Linear SVM,” 2025. doi: 10.30871/jaic.v9i5.10537.
F. Rifaldy, Y. Sibaroni, and S. S. Prasetiyowati, “Effectiveness of Word2Vec and TF-IDF in Sentiment Classification on Online Investment Platforms Using Support Vector Machine,” JIPI (Jurnal Ilmiah Penelitian dan Pembelajaran Informatika), vol. 10, no. 2, pp. 863–874, Mar. 2025, doi: 10.29100/jipi.v10i2.6055.
F. Syarifuddin and D. Kusumaningsih, “Analisis Perbandingan Algoritma Naive Bayes dan Support Vector Machine dengan Pendekatan TF-IDF Sebagai Klasifikasi Perintah Suara,” Technology and Science (BITS), vol. 7, no. 1, pp. 44–53, 2025, doi: 10.47065/bits.v7i1.7160.
S. Khoerunnisa, D. F. Shiddieq, and D. Nurhayati, “Penerapan Algoritma Naive Bayes dengan Teknik TF-IDF dan Cross Validation untuk Analisis Sentimen Terhadap Starlink,” MALCOM: Indonesian Journal of Machine Learning and Computer Science, vol. 5, no. 2, pp. 566–577, Mar. 2025, doi: 10.57152/malcom.v5i2.1852.
H. Barus, I. N. Fajri, and Y. Pristyanto, “Sentiment Classification Analysis of Tokopedia Reviews Using TF-IDF, SMOTE, and Traditional Machine Learning Models,” 2025. doi: 10.30871/jaic.v9i5.10524.
I. G. B. A. Budaya and I. K. P. Suniantara, “Comparison of Sentiment Analysis Algorithms with SMOTE Oversampling and TF-IDF Implementation on Google Reviews for Public Health Centers,” MALCOM: Indonesian Journal of Machine Learning and Computer Science, vol. 4, no. 3, pp. 1077–1086, Jul. 2024, doi: 10.57152/malcom.v4i3.1459.
J. M. Johnson and T. M. Khoshgoftaar, “Survey on deep learning with class imbalance,” J. Big Data, vol. 6, no. 1, Dec. 2019, doi: 10.1186/s40537-019-0192-5.
D. Jurafsky and J. H. Martin, “Speech and Language Processing An Introduction to Natural Language Processing, Computational Linguistics, and Speech Recognition with Language Models,” 2026.
M. Peter, D. A. Aldo, F. Cheng, and S. Ong, “MATHEMATICS FOR MACHINE LEARNING,” 2020. doi: 10.1017/9781108679930.
D. Y. Saraswati, M. R. Handayani, K. Umam, and I. Mustofa, “Sentiment Classification of MyPertamina Reviews Using Naïve Bayes and Logistic Regression,” 2025. doi: 10.30871/jaic.v9i4.9723.
R. E. Nurfirdaus, M. Agung Barata, and I. W. Prastya, “Comparison of SVM and Random Forest for TikTok E10 Fuel Sentiment Analysis,” 2026. doi: 10.30871/jaic.v10i2.12395.
W. Wijiyanto, A. I. Pradana, S. Sopingi, and V. Atina, “Teknik K-Fold Cross Validation untuk Mengevaluasi Kinerja Mahasiswa,” Jurnal Algoritma, vol. 21, no. 1, May 2024, doi: 10.33364/algoritma/v.21-1.1618.
E. Elgeldawi, A. Sayed, A. R. Galal, and A. M. Zaki, “Hyperparameter tuning for machine learning algorithms used for arabic sentiment analysis,” Informatics, vol. 8, no. 4, Dec. 2021, doi: 10.3390/informatics8040079.
R. Mulyawan, H. Naparin, and W. M. Fatihia, “Comparison of Text Vectorization Methods for IMDB Movie Review Sentiment Analysis Using SVM,” 2025. doi: 10.30871/jaic.v9i5.10372.
D. Ismiyana Putri, A. Nurul Alfian, M. Yudhi Putra, and P. Dwi Mulyo, “IndoBERT Model Analysis: Twitter Sentiments on Indonesia’s 2024 Presidential Election,” 2024. doi: 10.30871/jaic.v8i1.7440.
J. R. Jim, M. A. R. Talukder, P. Malakar, M. M. Kabir, K. Nur, and M. F. Mridha, “Recent advancements and challenges of NLP-based sentiment analysis: A state-of-the-art review,” Mar. 01, 2024, Elsevier Ltd. doi: 10.1016/j.nlp.2024.100059.
A. Arasy, S. Agustian, L. Handayani, and I. Iskandar, “Klasifikasi Sentimen Menggunakan Metode Multilayer Perceptron dengan Fitur TF-IDF,” MALCOM: Indonesian Journal of Machine Learning and Computer Science, vol. 5, no. 3, pp. 908–919, Jun. 2025, doi: 10.57152/malcom.v5i3.2052.
F. Rafiandi Andhika, W. Witanti, and P. N. Sabrina, “Analisis Sentimen Menggunakan Metode IndoBERT pada Ulasan Aplikasi Zoom Menggunakan Fitur Ekstrasi GloVe,” vol. 9, no. 2, pp. 439–448, 2025, doi: 10.47002/metik.v9i2.1098.
F. Firmanda and R. R. Suryono, “Analisis Sentimen Publik Terhadap Danantara di Media Sosial X Menggunakan Naïve Bayes dan Support Vector Machine,” Technology and Science (BITS), vol. 7, no. 2, 2025, doi: 10.47065/bits.v7i2.7250.
Bila bermanfaat silahkan share artikel ini
Berikan Komentar Anda terhadap artikel Klasifikasi Sentimen Program Makan Bergizi Gratis di Platform X dengan TF-IDF dan Class-Weighted LinearSVC
Pages: 485-496
Copyright (c) 2026 Muhammad Syihabuddin Musyaffa, Novita Kurnia Ningrum

This work is licensed under a Creative Commons Attribution 4.0 International License.
Authors who publish with this journal agree to the following terms:
- Authors retain copyright and grant the journal right of first publication with the work simultaneously licensed under Creative Commons Attribution 4.0 International License that allows others to share the work with an acknowledgment of the work's authorship and initial publication in this journal.
- Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the journal's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgment of its initial publication in this journal.
- Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work (Refer to The Effect of Open Access).





















