Building a Stock Price Prediction Model using Random Forest Regression and Sentimental Analysis
Yashmita A1, Dr. Kavitha D2,
PG Student1, Associate Professor-Finance2,
PSG Institute of Management, Coimbatore,
ABSTRACT
Stock market performance can be influenced by stock prices in either a positive or negative way because it is a very unpredictable area. The public's opinions and feelings may be affected differently by various occurrences, which could impact the direction in which stock price fluctuates. To increase predictability of stock market indicators, this study examines the potential usage of sentiment data from Twitter users. In this study, relationship between public perceptions about a company stated in tweets and changes in stock prices are investigated. The results of the study demonstrates strong association between changes in stock prices and the opinions shared by the general public in tweets. In this study, a system is created that collects tweets, analyses and assesses if tweets has positive or negative sentiment using a model called Random Forest Classifier. The output for the algorithm is then checked with the actual change in stock price the next day to ascertain the prediction's error. The goal of this research is to forecast future market behavior by performing sentiment analysis on a sample of tweets from the past few days. The results suggest that Random Forest model is suitable for stock price prediction along with sentimental analysis it generates the accuracy of 84.86% which is accessed by with three widely used measures for the regressor— Mean Squared Error , Root Mean Square Error , Mean Absolute Error and along with sentimental analysis by generating classification report.
Keywords: Stock price prediction, Volatility , Time series, Random Forest Classifier, Sentimental Analysis, Natural Language Tool Kit, VADER, Bootstrap method, Back testing, hyper parameter tuning, snscrape, Lemmatization and tokenization.