This study highlights the importance of emotion classification in English text, particularly in human interaction on social media, which often involves unstructured data. Emotions play a crucial role in communication; a better understanding of these emotions can aid in analyzing user behavior. The main objective of this research is to enhance accuracy, recall, precision, and F1-score in emotion classification by applying an ensemble bagging approach, combining the naïve Bayes, logistic regression, and k-nearest neighbor (KNN) algorithms. The methodology used included data collection from various sources, followed by data cleaning and analysis using text mining and machine learning techniques. The collected data were then analyzed to detect emotions such as anger, happiness, sadness, surprise, shame, disgust, and fear. Performance evaluation was conducted by comparing the results of the ensemble bagging method with individual algorithms to measure its effectiveness. The findings reveal that the logistic regression method achieved the highest accuracy at 98.76%, followed by naïve Bayes and KNN. This ensemble method overcame the limitations of each individual algorithm, enhancing overall classification stability and reliability. These findings provide valuable insights into text-based emotion analysis techniques and demonstrate the potential of ensemble methods to improve classification accuracy. Future research directions can explore additional ensemble techniques and optimize model complexity for improved performance in emotion analysis across broader datasets. |