Sentiment Analysis of News Headlines and Stock Price Prediction
Abstract
Investing methods and decision-making of the stock market are driven by lots of factors, among all these factors, the significant impact of news should not be overlooked. This article combines machine learning algorithms to analyze sentiment analysis based on daily top 25 news titles and the up and down condition of stock price, using CountVectorizer and Term Frequency-Inverse Document Frequency (TF-IDF) to extract textual feature, then implementing Random Forest (RF) and Logistic Regression (LR) to train, test, and carry out prediction. From the results of the classification report, the performance and efficiency of each combination are analyzed and compared to draw conclusions. The results show that using TF-IDF instead of CountVectorizer can bring higher accuracy in this large and high precision text categorization task. Even if LR can more accurately recall news of stock price declines in binary classification problems, RF has the best performance in the balance of accuracy and classification.
References
- Yu, XJ., Liu, GP., Liu, JL., & Xiao, WL. (2024). Stock index prediction based on LSTM network and text sentiment analysis. China Management Science, 32(8), 25-35.
- Wang, Y., & Guo, Y. K. (2019). Improved XGBoost model for stock prediction, 2019, 55 (20):202-207.
- Frank, M. Z., & Sanati, A. (2018). How does the stock market absorb shocks?. Journal of Financial Economics, 129(1), 136-153.
- Bansal, M., Goyal, A., & Choudhary, A. (2022). Stock market prediction with high accuracy using machine learning techniques. Procedia Computer Science, 215, 247-265.
- Sonkiya, P., Bajpai, V., & Bansal, A. (2021). Stock price prediction using BERT and GAN. arXiv preprint arXiv:2107.09055.
- Henrique, B. M., Sobreiro, V. A., & Kimura, H. (2018). Stock price prediction using support vector regression on daily and up to the minute prices. The Journal of finance and data science, 4(3), 183-201.
- Mehtab, S., & Sen, J. (2020). Stock price prediction using convolutional neural networks on a multivariate timeseries. arXiv preprint arXiv:2001.09769.
- Almasarweh, M., & Alwadi, S. (2018). ARIMA model in predicting banking stock market data. Modern Applied Science, 12(11), 309.
- Nguyen, T. H., Shirai, K., & Velcin, J. (2015). Sentiment analysis on social media for stock movement prediction. Expert Systems with Applications, 42(24), 9603-9611.
- Kumbure, M. M., Lohrmann, C., Luukka, P., & Porras, J. (2022). Machine learning techniques and data for stock market forecasting: A literature review. Expert Systems with Applications, 197, 116659.