Skip to content

GME Stock Prediction with historical data and sentiment analysis

Notifications You must be signed in to change notification settings

Santhoshkumar-p/stock-prediction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stock Price Prediction using LSTM Networks

GME Stock Prediction with historical data and sentiment analysis

Abstract:

This project developed LSTM models to predict stock prices using historical data. LSTM networks are well-suited for time-series forecasting tasks. Daily stock price data for GameStop (GME) for 2021 was used. LSTM models with 1 or 2 hidden layers were trained to predict next-day closing prices based on previous 10 days prices. The models achieved low error on test data, demonstrating the feasibility of using LSTM networks for stock prediction.

Introduction:

  • Stock price prediction is crucial for financial forecasting. Traditional models like ARIMA have limitations in capturing nonlinear patterns. LSTM networks are adept at learning complex temporal dependencies.
  • Daily price data for GME in 2021 was obtained using yfinance API.
  • The aim was to train LSTM models to predict the next day's closing price based on historical data.

Data:

  • Daily open, high, low, close, volume data for GME stock in 2021 was downloaded.
  • Close price was selected as the prediction target and normalized.
  • Input features comprised the normalized close price over the last 10 days.

Methodology:

  • LSTM models with 1 or 2 layers were constructed using PyTorch.
  • Models were trained to minimize MSE loss using Adam optimizer.
  • Models were trained for 500 epochs with a batch size of 10. AdamW

Results:

  • The 1-layer LSTM model achieved a validation RMSE of 0.024, while the 2-layer model achieved 0.021.
  • Models demonstrated the feasibility of using LSTMs for stock prediction.

Predictions with Sentiment Analysis

Inference - Stock Prediction with sentiment analysis

Negative Sentiment Analysis and Stock Price Correlation

Inference - Negative Sentiment Analysis

Positive Sentiment Analysis and Stock Price Correlation

Inference Sentiment Analysis Positive

Confusion Matrix(Ground Truth Vs Prediction)

Confusion Matrix FInal

Conclusion:

This project showcased the effectiveness of LSTM networks in modeling temporal patterns in stock prices. Future enhancements could include incorporating additional features like technical indicators and sentiment analysis to further improve predictions.

About

GME Stock Prediction with historical data and sentiment analysis

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published