Optimizing Binary Sentiment Analysis for Imbalanced Data: Synergizing Resampling Techniques, Model Tuning, and Explainable AI
摘要
Class imbalance poses a persistent challenge in sentiment analysis, particularly in highly skewed datasets where one sentiment category significantly outweighs the others. This imbalance often results in biased models favoring the majority class, leading to suboptimal performance, especially in detecting the minority class. In this paper, we address class imbalance by integrating the Synthetic Minority Over-sampling Technique (SMOTE) with hyperparameter optimization and explainable AI (XAI) techniques. We evaluate the effectiveness of various machine learning models, including Logistic Regression, Random Forest, XGBoost, and Support Vector Machines (SVM), in combination with SMOTE to balance the dataset. Through rigorous experimentation, we demonstrate that applying SMOTE, followed by model-specific hyperparameter tuning, significantly enhances overall model performance. Notably, recall improves substantially across models, with Logistic Regression and SVM achieving increases from 0.12 to 0.62 and 0.20 to 0.63, respectively, ensuring better detection of the minority class. Additionally, we incorporate SHAP (SHapley Additive exPlanations) to interpret model predictions, providing insights into feature importance and decision-making processes. The results indicate that models like XGBoost and SVM show notable gains in cross-validated F1-scores and precision-recall metrics, making them more robust in handling imbalanced datasets. Our findings highlight the efficacy of combining SMOTE, hyperparameter tuning, and SHAP-based interpretability to develop more balanced, accurate, and explainable sentiment analysis models.