Skip to content

ChaitanyaKatti/lstm-stock-predictor

Repository files navigation

lstm-stock-predictor

This is PyTorch implementation of the LSTM(Long-short-term memory) model to predict prices of day-to-day stock data.

How to run

  • Use Python 3.10.9
  • Git clone using git clone https://github.com/ChaitanyaKatti/lstm-stock-predictor.git
  • Install requirements using pip install -r requirements.txt
  • Download stock data and place the .csv files in /data/stocks folder
  • Edit data, model, training, and simulation parameters in config.py.
  • Run main.py using python main.py
  • Look at the terminal for training progress and the /plots folder for results.

Model Architecture

This architecture allows for

  • Different input(x) and output(y) features
  • Different input and output lengths
  • The long-term memory state ('c') to be maintained across both LSTMs
LSTM Basic
Figure 1: Forward pass in a standard LSTM
LSTM Recurrent Diagram
Figure 2: Recurrency input in LSTM
LSTM Architecture Design
Figure 3: LSTM Architecture in this implementation (Note: Both x and y differ in size and so does input and output length)

Results

Loss Curve
Figure 4: Loss Curve over training
Predictions
Figure 5: Prediction
Simulation Results
Figure 6: Market simulation results

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published