If you find this project useful, don't forget to give it a star ⭐!
This Python project focuses on predicting Indian stock prices using a Stacked Long Short-Term Memory (LSTM) neural network model. It provides valuable insights into stock data for four prominent Indian companies: Reliance Industries, Tata Steel, HDFC Bank, and Infosys. Here's what you need to know:
The LSTM unit has four input weights (from the data to the input and three gates) and four recurrent weights (from the output to the input and the three gates). Peepholes are extra connections between the memory cell and the gates, but they do not increase the performance by much and are often omitted for simplicity. Image by Klaus Greff and colleagues as published in LSTM: A Search Space Odyssey.
- Sequential Model: Utilizes Keras' Sequential model for building the LSTM architecture.
- Stacked LSTM Layers: Employs three LSTM layers stacked to capture intricate temporal patterns in stock prices.
- Activation Functions: Explores Swish activation for smoothness and improved performance.
- Output Layer: Features a dense output layer for continuous stock price prediction.
- Optimization Functions: Compares various functions like Adam, Nadam, Adagrad, and Adadelta for model training.
- Epochs and Batch Size: Experiment with different values to optimize training.
- Dropout Layers: Utilizes dropout layers to prevent overfitting and enhance generalization.
- Uses Root Mean Square Error (RMSE) to assess model performance, with an RMSE of approximately 25.99 as the benchmark.
- Visualizes the closing prices of all four companies on a single plot.
- Offers insights into stock price trends over time.
- Displays adjusted close prices for each stock via subplots.
- Provides historical performance snapshots.
- Depicts trading volume for each company over time.
- Reflects stock liquidity and investor interest.
- Calculates and plots moving averages (10, 30, and 50 days) for each stock.
- Identifies trends and smoothes price fluctuations.
- Computes and visualizes daily returns through line plots and histograms.
- Offers insights into daily price fluctuations and return distributions.
- Explores correlations between closing prices of the four companies.
- Uses scatter plots and correlation matrices to uncover relationships.
This project provides an in-depth analysis of Indian stock data, from data collection to visualization and model development. It showcases the potential of LSTM neural networks in stock price prediction, with an RMSE benchmark of 25.99. Contributors are encouraged to fine-tune hyperparameters and apply diverse techniques to enhance model performance.
- Fork this repository.
- Clone your forked repository to your local machine.
- Create a new branch:
git checkout -b feature/your-feature-name
. - Make your contributions and commit changes:
git commit -m "Description of your changes"
. - Push your changes to your forked repository:
git push origin feature/your-feature-name
. - Open a Pull Request (PR) to this repository's main branch.
- Describe your changes and their significance.
Feel free to contribute, explore, and improve this project! Let's predict Indian stock prices together.
Note: This project is under the Apache License 2.0.