[Paper Review] Using Twitter Attribute Information to Predict Stock Prices
This study develops an LSTM-based deep learning model that integrates historical stock prices, technical indicators, and Twitter attributes—such as sentiment score, retweets, favorites, followers, and verification status—to predict stock prices. The model reduces mean squared error (MSE) by 11% when combining technical analysis with Twitter data, and by 3% when adding Twitter attributes alone, demonstrating their incremental predictive value for stock price movements.
Being able to predict stock prices might be the unspoken wish of stock investors. Although stock prices are complicated to predict, there are many theories about what affects their movements, including interest rates, news and social media. With the help of Machine Learning, complex patterns in data can be identified beyond the human intellect. In this thesis, a Machine Learning model for time series forecasting is created and tested to predict stock prices. The model is based on a neural network with several layers of LSTM and fully connected layers. It is trained with historical stock values, technical indicators and Twitter attribute information retrieved, extracted and calculated from posts on the social media platform Twitter. These attributes are sentiment score, favourites, followers, retweets and if an account is verified. To collect data from Twitter, Twitter's API is used. Sentiment analysis is conducted with VADER. The results show that by adding more Twitter attributes, the MSE between the predicted prices and the actual prices improved by 3%. With technical analysis taken into account, MSE decreases from 0.1617 to 0.1437, which is an improvement of around 11%. The restrictions of this study include that the selected stock has to be publicly listed on the stock market and popular on Twitter and among individual investors. Besides, the stock markets' opening hours differ from Twitter, which constantly available. It may therefore introduce noises in the model.
Motivation & Objective
- To investigate whether Twitter attribute information can improve stock price prediction accuracy beyond traditional technical indicators.
- To develop and evaluate a deep learning model that integrates financial time series data with social media sentiment and engagement metrics.
- To assess the incremental value of Twitter attributes—such as sentiment, retweets, and follower count—on stock price forecasting performance.
- To examine the impact of data collection constraints, including API rate limits and market vs. social media timing mismatches, on model robustness.
- To explore the feasibility of using publicly available Twitter data and historical stock data for algorithmic trading applications.
Proposed method
- A deep neural network architecture is implemented using multiple layers of Long Short-Term Memory (LSTM) units followed by fully connected layers for time series forecasting.
- The model is trained on a combination of historical stock prices, technical indicators (e.g., SMA5, Bollinger Bands), and engineered Twitter attributes extracted via the Twitter API.
- Twitter sentiment is analyzed using VADER (Valence Aware Dictionary and sEntiment Reasoner), while engagement metrics such as retweets, favorites, follower count, and verification status are extracted from tweet metadata.
- Data preprocessing includes normalization and handling of imbalanced or missing data, with a focus on preserving temporal order to avoid data leakage in time-series forecasting.
- Model evaluation is performed using Mean Squared Error (MSE) on a test set split chronologically to maintain temporal validity.
- The study compares prediction performance across models: baseline (only stock prices), with technical indicators, and with added Twitter attributes.
Experimental results
Research questions
- RQ1To what extent do Twitter attributes such as sentiment, retweets, and follower count improve stock price prediction accuracy when combined with technical indicators?
- RQ2How does the inclusion of social media data affect the model's generalization and robustness in volatile market conditions?
- RQ3What is the relative contribution of Twitter attributes versus technical indicators in reducing prediction error for stock prices?
- RQ4How do data collection limitations—such as API rate limits and timing mismatches between market and social media activity—affect model performance?
- RQ5Can a deep learning model effectively learn non-linear patterns in stock price movements when trained on a hybrid dataset of financial and social media data?
Key findings
- The inclusion of technical indicators reduced the Mean Squared Error (MSE) from 0.1617 to 0.1437, representing an 11% improvement in prediction accuracy.
- Adding Twitter attributes alone improved prediction accuracy by 3%, as measured by a reduction in MSE, indicating their incremental value in volatile periods.
- The model achieved the best performance when combining technical indicators and Twitter attributes, suggesting complementary information sources.
- Despite the model's success, the contribution of Twitter attributes was less pronounced than that of technical indicators, indicating that fundamental and technical factors remain dominant predictors.
- The study encountered data collection challenges, including API rate limits, temporary bans, and missing data due to computational constraints, which affected data completeness.
- The preprocessing method, particularly normalization using scikit-learn, may have inadvertently minimized the impact of Twitter sentiment scores by scaling them disproportionately, potentially masking their true predictive power.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.