CFP last date
21 April 2025
Reseach 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ć
International Journal of Computer Applications
Foundation of Computer Science (FCS), NY, USA
Volume 186 - Number 77
Year of Publication: 2025
Authors: Adnan Krndžija, Amina Kodžaga, Amila Čaušević, Dželila Mehanović, Mirza Krupić
10.5120/ijca2025924658

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 ( Apr 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 },
issue_date = { Apr 2025 },
volume = { 186 },
number = { 77 },
month = { Apr },
year = { 2025 },
issn = { 0975-8887 },
pages = { 27-31 },
numpages = {9},
url = { https://ijcaonline.org/archives/volume186/number77/sentiment-analysis-of-2020-us-presidential-election-tweets-using-naive-bayes-and-decision-trees/ },
doi = { 10.5120/ijca2025924658 },
publisher = {Foundation of Computer Science (FCS), NY, USA},
address = {New York, USA}
}
%0 Journal Article
%1 2025-04-05T01:33:44.433235+05:30
%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
%J International Journal of Computer Applications
%@ 0975-8887
%V 186
%N 77
%P 27-31
%D 2025
%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
  1. 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.
  2. 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.
  3. 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.
  4. 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).
  5. 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
  6. 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
  7. 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
  8. 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
  9. 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.
  10. 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
  11. 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
  12. 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
  13. 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
  14. 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
  15. 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