Comparison of Support Vector Machine and K-Nearest Neighbor Algorithms on the Effectiveness of a Free Lunch Program - Frenda Farahdinna; Pipit Prabawati (SISTEMASI, 2026)
The Free Lunch Program is a government initiative aimed at ensuring adequate nutrition for the public. This study aims to examine public perceptions of the program through sentiment analysis and to compare the effectiveness of Support Vector Machine (SVM) and K-Nearest Neighbor (K-NN) models. A total of 6,532 public comments were collected from Twitter, YouTube, and TikTok. After preprocessing, including normalization, stopword removal, and stemming, features were extracted using Term Frequency–Inverse Document Frequency (TF-IDF), resulting in 5,992 clean data points. The dataset was split into 80% training and 20% testing sets. Model training was conducted with hyperparameter tuning using 3-fold GridSearchCV. The results indicate that negative sentiment dominated at 42.7%. In the model comparison, SVM with a linear kernel significantly outperformed K-NN, achieving an accuracy of 72%, while K-NN (k=3) reached only 48%. These findings suggest that the SVM algorithm is more effective in classifying public opinion sentiment on high-dimensional data compared to K-NN.