Skip to content

Long Short-Term Memory (LSTM) based model to predict Open, High, Low, Close, and Average Price of Fortune 500 companies.

License

Notifications You must be signed in to change notification settings

isha-git/Stock-Data-Prediction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Problem Statement

To predict various stock market parameters (Open Price, High Price, Low Price, Last Price, Close Price, Average Price) using the LSTM/GRU model and predict Day1-Day2-Day3 forecast of 5 more companies and evaluate its performance.

LSTM vs GRU

While Gated Recurrent Units (GRU) use lesser training paramaters (therefore, lesser memory), and are faster than Long Short-Term Memory Networks (LSTM), LSTM networks have a higher accuracy. As for this project, accuracy is more important than run-time, LSTM networks have been used for forecasting.

Libraries

  1. Numpy
  2. Matplotlib
  3. Pandas
  4. Sklearn
  5. Keras
  6. Tensorflow

Environment- Python 3.7.3, Windows 10
The code was developed on Google Colab.

Dataset

National Stock Exchange India was referred to obtain company-wise data of 12 Fortune 500 India companies.
The companies used for training are-

  1. Bombay Dyeing and Manufacturing
  2. Bosch
  3. Britannia
  4. Coal India
  5. Hindustan Construction Company
  6. Hindustan Unilever
  7. Mahindra and Mahindra Financial Services
  8. Nestle
  9. Oracle Financial Services Software
  10. Reliance Industries
  11. State Bank of India
  12. Whirlpool of India

Data of past three years (27 March 2017 - 24 March 2020) was used for training, which is approxmately 700 data samples for each company.

Architecture

The network contains 5 LSTM layers, and a dense layer in the end containing 6 units (to predict 6 parameters). Adam optimizer Mean Squared Error have been used for training for 100 epochs.

Results

The model was tested on 5 Fortune 500 India companies-

  1. Raymond
  2. Indian Oil Corporation
  3. Bharat Electronics
  4. Steel Authority of India Limited (SAIL)
  5. Spice Jet

Mean Absolute Error (L1 error) has been used for quantitative evaluation of the results.

Discussions

It can be observed that the model gives moderately high error. This could be because of the different variations in the stock prices of the companies with respect to time. Accordingly, the model can be improved for better performance.

About

Long Short-Term Memory (LSTM) based model to predict Open, High, Low, Close, and Average Price of Fortune 500 companies.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages