Research Article

Sentiment Analysis of 2020 US Presidential Election Tweets Using Naive Bayes and Decision Trees

by  Adnan Krndžija, Amina Kodžaga, Amila Čaušević, Dželila Mehanović, Mirza Krupić
journal cover
International Journal of Computer Applications
Foundation of Computer Science (FCS), NY, USA
Volume 186 - Issue 77
Published: April 2025
Authors: Adnan Krndžija, Amina Kodžaga, Amila Čaušević, Dželila Mehanović, Mirza Krupić
10.5120/ijca2025924658
PDF

Adnan Krndžija, Amina Kodžaga, Amila Čaušević, Dželila Mehanović, Mirza Krupić . Sentiment Analysis of 2020 US Presidential Election Tweets Using Naive Bayes and Decision Trees. International Journal of Computer Applications. 186, 77 (April 2025), 27-31. DOI=10.5120/ijca2025924658

                        @article{ 10.5120/ijca2025924658,
                        author  = { Adnan Krndžija,Amina Kodžaga,Amila Čaušević,Dželila Mehanović,Mirza Krupić },
                        title   = { Sentiment Analysis of 2020 US Presidential Election Tweets Using Naive Bayes and Decision Trees },
                        journal = { International Journal of Computer Applications },
                        year    = { 2025 },
                        volume  = { 186 },
                        number  = { 77 },
                        pages   = { 27-31 },
                        doi     = { 10.5120/ijca2025924658 },
                        publisher = { Foundation of Computer Science (FCS), NY, USA }
                        }
                        %0 Journal Article
                        %D 2025
                        %A Adnan Krndžija
                        %A Amina Kodžaga
                        %A Amila Čaušević
                        %A Dželila Mehanović
                        %A Mirza Krupić
                        %T Sentiment Analysis of 2020 US Presidential Election Tweets Using Naive Bayes and Decision Trees%T 
                        %J International Journal of Computer Applications
                        %V 186
                        %N 77
                        %P 27-31
                        %R 10.5120/ijca2025924658
                        %I Foundation of Computer Science (FCS), NY, USA
Abstract

This paper performs sentiment analysis of the political tweets in the US presidential elections 2020 centered around Biden and Trump, using the implementation of machine learning algorithms such as Decision Trees, Naive Bayes, Dummy Classifier, and Extreme Gradient Boosting. The present study shows how Naive Bayes can trace minute variations of sentiment about political discourses on social media. It follows that the best model among those analyzed is the Naive Bayes classifier (62% for Biden and 74% for Trump) on sentiment analysis in political tweets from the 2020 election, since it is a very instructive case of what public opinion was in the digital era.

References
  • Rao, H. A., Pinto, G., Lawrie, E., & Linstead, E. J. (2022). A large-scale sentiment analysis of tweets pertaining to the 2020 US presidential election. Research, 9, Article 79.
  • Nugroho, D. K. (2021). US presidential election 2020 prediction based on Twitter data using lexicon-based sentiment analysis. In 2021 11th International Conference on Cloud Computing, Data Science & Engineering (978-1-6654-1451-7/21). IEEE.
  • Yavari, A., Hassanpour, H., Rahimpour Cami, B., & Mahdavi, M. (2022). Election prediction based on sentiment analysis using Twitter data. International Journal of Engineering, Transactions B: Applications, 35(2), 372-379.
  • Bernábe-Loranca, M. B., González-Velázquez, R., Carrillo-Canán, A., & Granillo-Martínez, E. (2022). Sentiment analysis and multiple means comparison for the 2020 United States elections. Computación y Sistemas, 26(1).
  • Sabuncu, I., Balci, M. A., & Akgüller, Ö. (2020). Prediction of USA November 2020 election results using multifactor Twitter data analysis method. arXiv. https://arxiv.org/pdf/2010.15938
  • Singh, A., Kumar, A., Dua, N., Mishra, V. K., Singh, D., & Agrawal, A. (2021). Predicting elections results using social media activity: A case study: USA presidential election 2020. In 2021 7th International Conference on Advanced Computing and Communication Systems (ICACCS) (pp. 1-5). IEEE. https://doi.org/10.1109/ICACCS51430.2021.9441835
  • Belcastro, L., Branda, F., Cantini, R., Marozzo, F., Talia, D., & Trunfio, P. (2022). Analyzing voter behavior on social media during the 2020 US presidential election campaign. Social Network Analysis and Mining, 12(83). https://doi.org/10.1007/s13278-022-00815-7
  • Chaudhry, H. N., Javed, Y., Kulsoom, F., Mehmood, Z., Khan, Z. I., Shoaib, U., & Janjua, S. H. (2021). Sentiment analysis of before and after elections: Twitter data of U.S. Election 2020. Electronics, 10(17), 2082. https://doi.org/10.3390/electronics10172082
  • Endsuy, R. D. (2021). Sentiment analysis between VADER and EDA for the US Presidential Election 2020 on Twitter datasets. Journal of Applied Data Sciences, 2(1), 8-18.
  • Xia, E., Yue, H., & Liu, H. (2021). Tweet sentiment analysis of the 2020 U.S. Presidential Election. In WWW '21: Companion Proceedings of the Web Conference 2021 (pp. 367-371). https://doi.org/10.1145/3442442.3452322
  • Singh, S., & Sikka, G. (2021). YouTube sentiment analysis on US elections 2020. In 2021 2nd International Conference on Secure Cyber Computing and Communications (ICSCCC) (pp. 21-23). IEEE. https://doi.org/10.1109/ICSCCC51823.2021.9478128
  • Caballero, M. (2021). Predicting the 2020 US presidential election with Twitter. In D. C. Wyld (Ed.), Proceedings of the 2021 International Conference on Computer Science & Information Technology (CS & IT) (pp. 53-65). https://doi.org/10.5121/csit.2021.111006
  • Baker Al Barghuthi, N., E. Said, H. (2020). Sentiment Analysis on Predicting Presidential Election: Twitter Used Case. In: Brito-Loeza, C., Espinosa-Romero, A., Martin-Gonzalez, A., Safi, A. (eds) Intelligent Computing Systems. ISICS 2020. Communications in Computer and Information Science, vol 1187. Springer, Cham. https://doi.org/10.1007/978-3-030-43364-2_10
  • Sahu, K., & Choi, Y. (2021). Sentiment analysis of the United States Senate Twitter feeds in election year 2020. In 2021 IEEE 11th Annual Computing and Communication Workshop and Conference (CCWC). IEEE.https://doi.org/10.1109/CCWC51732.2021.9376152
  • Raji, S. K. (2021). Sentiment analysis and emotion classification of the 2020 United States of America’s election on Twitter (Undergraduate project, Federal University Oye-Ekiti).
Index Terms
Computer Science
Information Sciences
Natural Language Processing
Decision Tree
EDA
Naïve Bayes
Dummy Classifier
Political Data
Keywords

Donald Trump Joe Biden US Sentiment Analysis Elections

Powered by PhDFocusTM