This project builds a Long Short-Term Memory (LSTM) model to predict future stock prices based on historical stock data. The model uses features like:
- Open Price
- High Price
- Low Price
- Close Price
- Trading Volume
It is trained on historical stock data of Apple Inc. (AAPL) and predicts both past and future closing prices. The project includes visualization of actual vs predicted prices and a 30-day forecast.
- Fetches historical stock data from Yahoo Finance using
yfinance. - Preprocesses data using MinMaxScaler.
- Creates a time-series dataset for LSTM.
- Builds and trains a 3-layer LSTM model.
- Evaluates the model using RMSE.
- Predicts next 30 days of stock prices.
- Plots actual prices, training/testing predictions, and future predictions.
numpy
pandas
matplotlib
sklearn
tensorflow
yfinance