The Influence of User Sentiment Analysis X on the Free Nutritious Food Program Using the K-Nearest Neighbors Method and Logistic Regression

The free nutritious meal program aims to reduce stunting, but its success relies on public support. This study analyzes public sentiment toward the program on social media X using K-Nearest Neighbors (KNN) and Logistic Regression (LR) algorithms with TF-IDF, a method to weigh important words. A total of 2,000 tweets were collected and preprocessed through cleaning, normalization, tokenization, stop word removal, and stemming. Exploratory Data Analysis (EDA) revealed predominantly positive sentiment, with class imbalance addressed using SMOTE, a data balancing technique. The KNN model achieved 78%–81% accuracy, with strong positive class performance, but weak negative class detection, due to data imbalance. Similarly, the LR model achieved 80%–81% accuracy, with positive recall ranging from 0.96 to 0.98 and negative recall ranging from 0.22 to 0.27, resulting in an F1-score below 0.38. Neutral sentiments had minimal impact. These results highlight model bias toward positive sentiments, underscoring the need for adaptive approaches to improve minority sentiment detection. The findings offer policymakers insights to address concerns about budget and implementation, enhancing trust in social programs.

Authors

Institutions

Publication Details

Journal
Research Horizon
Published
2025-09-09
DOI
https://doi.org/10.54518/rh.5.4.2025.779
Primary Topic
Nutrition, Health and Food Behavior
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

The Influence of User Sentiment Analysis X on the Free Nutritious Food Program Using the K-Nearest Neighbors Method and Logistic Regression

Zaenal Abidin, A Mardiana
Research Horizon
Nutrition, Health and Food Behavior
article

The Influence of User Sentiment Analysis X on the Free Nutritious Food Program Using the K-Nearest Neighbors Method and Logistic Regression

Zaenal Abidin, A Mardiana
article en

Abstract

The free nutritious meal program aims to reduce stunting, but its success relies on public support. This study analyzes public sentiment toward the program on social media X using K-Nearest Neighbors (KNN) and Logistic Regression (LR) algorithms with TF-IDF, a method to weigh important words. A total of 2,000 tweets were collected and preprocessed through cleaning, normalization, tokenization, stop word removal, and stemming. Exploratory Data Analysis (EDA) revealed predominantly positive sentiment, with class imbalance addressed using SMOTE, a data balancing technique. The KNN model achieved 78%–81% accuracy, with strong positive class performance, but weak negative class detection, due to data imbalance. Similarly, the LR model achieved 80%–81% accuracy, with positive recall ranging from 0.96 to 0.98 and negative recall ranging from 0.22 to 0.27, resulting in an F1-score below 0.38. Neutral sentiments had minimal impact. These results highlight model bias toward positive sentiments, underscoring the need for adaptive approaches to improve minority sentiment detection. The findings offer policymakers insights to address concerns about budget and implementation, enhancing trust in social programs.

Research HorizonVol. 5(4)
State University of Semarang (ID)
Openalex Percentile: Top 67%
Nutrition, Health and Food Behavior
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.