A Hybrid Machine Learning Framework for Multi-Class Twitter Sentiment Analysis Using Logistic Regression and Random Forest

Authors

  • Sami Ullah Department of Computer Science, City University of Science and IT Peshawar 25000, Pakistan
  • Amer Taj Department of Computer Science, University of Engineering & Technology Peshawar 25000, Pakistan
  • Rida Zarkash Department of Computer Science, University of Engineering & Technology Peshawar 25000, Pakistan
  • Mudassir Ahmad Khan Department of Computer Science, University of Engineering & Technology Peshawar 25000, Pakistan

Keywords:

Machine Learning, Sentiment Analysis, Twitter, Random Forest, Logistic Regression, Support Vector Machines, Naive Bayes

Abstract

Sentiment analysis is vital for understanding public opinion, especially on platforms like Twitter, where users express sentiments in real time. It provides insights into trends, behaviors, and opinions, supporting applications in market analysis, social studies, and policymaking. This research focuses on Twitter sentiment analysis to classify tweets into four sentiment categories: Irrelevant, Negative, Neutral, and Positive. It evaluates traditional machine learning Frameworks such as Logistic Regression, Naive Bayes, Random Forest, and Support Vector Machines. The research work highlights the advantages of hybrid approaches in sentiment analysis. It contributes to natural language processing by offering practical applications for extracting actionable insights from social media. Hybrid models are proposed to enhance performance: Logistic Regression-Random Forest (LR-RF). These models leverage feature extraction, contextual embeddings, and ensemble techniques to address challenges like class imbalance and short-text data. The dataset consists of preprocessed tweets, with model evaluation based on accuracy, precision, recall, and F1 score. LR-RF achieved the highest accuracy

Downloads

Published

2026-02-27

How to Cite

Sami Ullah, Amer Taj, Rida Zarkash, & Mudassir Ahmad Khan. (2026). A Hybrid Machine Learning Framework for Multi-Class Twitter Sentiment Analysis Using Logistic Regression and Random Forest. Spectrum of Engineering Sciences, 4(2), 1803–1815. Retrieved from https://thesesjournal.com.medicalsciencereview.com/index.php/1/article/view/3736