Integrating Social Media Sentiments with Extreme Gradient Boosting for Stock Price Prediction: A Case Study on Safaricom PLC
In an increasingly data-driven financial ecosystem, the fusion of sentiment analysis with machine learning offers new frontiers for stock market prediction. This study explores the predictive power of social media sentiments, extracted from X (formerly Twitter), in modeling stock price movements with an application to Safaricom PLC. Leveraging the VADER lexicon for sentiment scoring and the Extreme Gradient Boosting (XGBoost) algorithm for regression, the analysis examined whether public sentiment could meaningfully enhance forecasting performance. Three cases were evaluated, each varying the input features: from hybrid models combining sentiment and financial data, to pure sentiment-driven predictions. Despite robust modeling and high cross-validation accuracy, the results revealed that sentiment features offered minimal advantage over traditional indicators. The dominance of neutral sentiments and company-specific market dynamics may explain this muted effect. These findings provide a grounded perspective on the practical limitations of sentiment integration and emphasize the need for broader, multi-firm analysis to validate the approach across diverse market contexts.
Institutions
- Technical University of Kenya (KE)
- Multimedia University of Kenya (KE)
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2025-07-23
- DOI
- https://doi.org/10.5281/zenodo.16410816
- Primary Topic
- Stock Market Forecasting Methods
- Type
- article
- Field-Weighted Citation Impact
- 0.00