Keywords:-
Article Content:-
Abstract
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.
References:-
References
De Carosia, A. E. O., Coelho, G. P., & da Silva, A. E. A. (2021). Investment strategies applied to the Brazilian stock market: A methodology based on sentiment analysis with deep learning. Expert Systems with Applications, 184, 115470.
Alqahtani, A. F., et al. (2021). Stock market prediction using social media sentiment analysis. Journal of Financial Data Science, 6(1), 45-67.
Smith, J. D. (2019). Financial news, market behavior, and stock price movements. Journal of Economic Behavior, 102, 77-94.
Gilbert, E., et al. (2010). Emotion and sentiment in social media: A survey of sentiment analysis techniques. Journal of Computational Linguistics, 42(2), 101-130.
Antweiler,W., & Frank, M. Z. (2004). Is all that talk just noise? The information content of Internet stock message boards. The Journal of Finance, 59(3), 1259-1294.
Gilbert, E., & Karaholios, K. (2010). Predicting the mood of the crowd on social media. Journal of Social Computing, 12(4), 50-65.
Zhang, W., & Kim, Y. (2019). News events and stock returns: A new methodology for market prediction. Journal of Financial Markets, 22(3), 221-245.
Hutto,C., et al. (2014).VADER:Aparsimonious rule-based model for sentiment analysis of social media text. Proceedings of the Eighth International Conference on Weblogs and Social Media, 216-225.
Hutto, C. J., & Gilbert, E. E. (2014). Vader: A parsimonious and effective sentiment analysis tool. Proceedings of the Eighth International Conference on Weblogs and Social Media, 216-225.
Tetlock, P. C., et al. (2007). All the news that’s fit to reprint: Do investors react to stale information? Review of Financial Studies, 20(3), 929-957.
Xing, Z., et al. (2017). Financial market prediction with sentiment analysis. International Journal of Financial Engineering, 4(2), 125-139.
Kimani, J., Karanjah, A., & Kihara, P. (2024). Sentiment classification of Safaricom PLC social media sentiments on X (formerly Twitter). Asian Journal of Probability and Statistics, 26(6), 31–40. https://doi.org/10.9734/ajpas/2024/v26i6622
Ding, X., Zhang, Y., Liu, T., & Duan, J. (2015). Deep learning for event-driven stock prediction. In Twenty-Fourth International Joint Conference on Artificial Intelligence; AAAI Publications: Menlo Park, CA, USA.
Di Persio, L., & Honchar, O. Artificial neural networks architectures for stock price prediction: Comparisons and applications. International Journal of Circuits, Systems and Signal Processing, 10, 403–413.
Sousa, M. G., Sakiyama, K., Rodrigues, L. D. S., Moraes, P. H., Fernandes, E. R., &Matsubara, E. T. (2019). BERT for stock market sentiment analysis. In Proceedings of the 2019 IEEE 31st International Conference on Tools with Artificial Intelligence (ICTAI), Portland, OR, USA, 4–6 November, pp. 1597-1601.
Chen, J., Song, Y., Weng, Y., Zhang, Y., & Hsu, C. (2020). Stock price prediction with a hybrid model. Expert Systems with Applications.
Zhang, Y., & Wu, L. (2020). Attention-based deep learning model for stock price prediction. Expert Systems with Applications.
Gitonga, J., et al. (2019). Long short-term memory (LSTM) recurrent neural networks for stock price prediction: A case study of Nairobi Securities Exchange. International Journal of Scientific and Technology Research, 8(9), 1839–1845.
Ngugi, M., Mwangi, W., & Kamau, E. (2019). Recurrent neural networks for stock price prediction: A case study of the Kenyan financial market. International Journal of Computer Applications.
Mwangi, K., et al. (2021). Stock price prediction using recurrent neural networks: A case study of the Nairobi Securities Exchange. Journal of Business and Finance Research, 9(1), 33-41.
Al-Shayea, Q., & AbdelHameed, A. (2019). Stock prices prediction using machine learning algorithms. In 2019 International Conference on Intelligent Computing and Its Applications (pp. 12-17). IEEE.
Mwangi, E. M.,&Wafula, R.N. (2018).Amachine learning-based stock price prediction model for the Nairobi Securities Exchange. Journal of Business and Management, 20(7), 30-38.
Njoroge, A., Mwangi, W., & Kamau, E. (2020). Enhancing the interpretability of support vector machines in predicting stock prices: A case study of the Nairobi Securities Exchange. In 2020 International Conference on Information and Communication Technology and Systems (ICTS).
Yu, L., & Yuan, Y. (2021). A logistic regression-based model for stock price prediction integrating financial ratios and technical indicators. Economic Research-Ekonomska Istraživanja, 34(1), 1819-1837.
Wanjohi, R., Mwangi, W., & Kamau, E. (2019). Forecasting stock prices using logistic regression: A case of the Nairobi Securities Exchange. In 2019 International Conference on Information and Communication Technology and Systems (ICTS).
Wongkaew, S., Chantaruk, T., & Khongprasert, N. (2018). Stock price prediction using dynamic k-nearest neighbors. Applied Artificial Intelligence, 32(8), 958-984.
Mwangi, J., Gichuki, J.,&Maina, D. (2021). Application of K-nearest neighbor algorithm in predicting stock prices of companies listed in the Nairobi Securities Exchange. Journal of Data Analysis and Information Processing, 9(1), 1-10. doi: 10.4236/jdaip.2021.91001
Tsai, C. F., Lu, L. C., & Chou,W. C. (2012). A hybrid model of support vector regression and fuzzy time series for stock price prediction. Expert Systems with Applications, 39(1), 139-147.
Akbas, S., Ozturk, I., & Arik, S. (2018). Stock price prediction using machine learning techniques: A comparative study on linear regression, support vector machines, and random forest algorithms. Expert Systems with Applications, 109, 84-91.
Kiptoo, R., Ndirangu, L., & Kavoi, M. (2021). Predicting volatility in the Nairobi Securities Exchange using random forest. Journal of Finance and Investment Analysis, 10(3), 20-36.
XGBoost Developers. (2022). XGBoost parameters. XGBoost Documentation. Retrieved from https://xgboost.readthedocs.io/en/latest/parameter.html