This repository contains Python code for predicting stock prices using Long Short-Term Memory (LSTM) neural networks. The code imports financial data, preprocesses it, builds an LSTM model, and makes predictions on the stock's closing prices.
-
Prerequisites
-
Concepts and Techniques
Before running the code, make sure you have the following prerequisites installed:
Python 3.x Libraries: yfinance pandas numpy matplotlib scikit-learn keras
This code demonstrates the following concepts and techniques:
Using the yfinance library to download historical stock price data for a specified company within a given date range.
Cleaning the data by resetting the index, handling missing values, and calculating daily returns.
Visualizing the stock price, moving averages, volume, and daily returns using Matplotlib.
Normalizing the stock price data using Min-Max scaling to make it suitable for training the LSTM model.
Building a Sequential Keras model with LSTM layers for time-series prediction. The architecture includes two LSTM layers with dropout and two dense layers.