The financial world is influenced by numerous factors such as social media. Posts on platforms like X (formerly Twitter) may reflect investors’ sentiment and therefore impact the growth of the stock market. In January 2021, Reddit users heavily impacted the Gamestop stock as well as the overall stock market with only a few posts (New York Times, 2021). There exist many similar instances where online statements from individuals or groups changed the direction of a stock (CNBC, 2023). In this study, we analyzed social media data to determine whether different artificial intelligence models can predict the direction of future stock movements. We used Random Forest, K Nearest Neighbors, and Ridge models to analyze 367,666 tweets from X and predict the stocks’ direction of change over the course of 1 day or up to 1 week. The performance of these models was assessed by a common metric, F1 score, ranging from 0 to 1 where 0 indicates poor performance and 1 indicates perfect performance. The evaluated machine learning models predicted the direction with F1 Scores of around 0.8, peaking at 0.9, indicating that tweets and social media posts can be used as a tool to guide financial investment. Further studies can investigate the longevity of the impact of specific tweets, incorporating more tweet-related features such as the counts of retweets, followers, and likes.
Zhang et al. (Sat,) studied this question.