The 2024 Indonesian presidential election represents the realization of people’s sovereignty in selecting leaders who are aspirational, qualified, and responsible for public welfare. Public opinion plays a crucial role in shaping the popularity of each candidate, especially through social media platforms such as Twitter. The large volume of opinions shared online provides valuable data for analyzing public sentiment toward the top three presidential candidates in 2024. This study aims to analyze public sentiment regarding Anies Baswedan, Ganjar Pranowo, and Prabowo Subianto using the Naïve Bayes method combined with Feature Selection Particle Swarm Optimization (PSO) to improve classification performance. The evaluation metrics used in this research are Accuracy, Precision, and Recall to measure the effectiveness of the sentiment classification model. The results show varying performance across the three datasets. For Anies Baswedan, the model achieved an accuracy of 63.02%, recall of 65.13%, and precision of 64.61%. For Ganjar Pranowo, the highest performance was obtained with an accuracy of 87.14%, recall of 87.46%, and precision of 85.43%. Meanwhile, Prabowo Subianto’s dataset resulted in an accuracy of 83.17%, recall of 83.17%, and precision of 84.17%. Overall, the method demonstrated the best performance on Ganjar Pranowo’s dataset.
Copyrights © 2025