Stock price prediction with LSTM (Long Short Term Memory)

Stock Price Prediction with LSTM (Long Short Term Memory) is a machine learning project that uses LSTM, a type of recurrent neural network, to predict stock prices. The model takes historical stock price data as input and outputs the predicted future prices. This project demonstrates the application of deep learning techniques in financial markets for making informed trading decisions.

alt text

Installation

To run this project, you need to install yfinance and tensorflow libraries. You can install these libraries using pip:

  pip install yfinance tensorflow

Usage/Examples

The project fetches stock data from Yahoo Finance using the yfinance library. The data is then split into training and testing datasets. An LSTM model is trained on the stock data using TensorFlow. The trained model is then used to predict stock prices. The predicted and actual prices are plotted on a line chart for comparison. The Mean Absolute Error (MAE) and accuracy of the model are calculated.

Features

  • Data Fetching: Fetches stock data from Yahoo Finance.
  • Data Preprocessing: Splits the data into training and testing datasets.
  • Model Training: Trains an LSTM model on the stock data.
  • Prediction: Uses the trained model to predict future stock prices.
  • Evaluation: Compares the predicted and actual prices on a line chart. Calculates MAE and accuracy of the model.

Known Issues

As this project is relatively new, there may be potential bugs or issues that have not yet been discovered. If you encounter any issues, please feel free to report them.

Future Plans

Future enhancements may include improving the accuracy of the predictions, incorporating more features into the model, or expanding the project to include more types of stock data.

Support

For any queries or support, please contact the project owner.

  1. nikhilmaguwala
  2. parth-ghinaiya