๐ Stock Price Prediction using LSTM (Soft Computing)
A deep learning project that predicts stock prices using Long Short-Term Memory (LSTM) networks, a soft computing technique under artificial neural networks.
๐ Features
- Downloads real-time stock data from Yahoo Finance
- Implements 3-layer LSTM model with Dropout regularization
- Includes model checkpointing and early stopping
- Visualizes predictions vs actual prices
- Ready-to-use modular code structure
๐ Project Structure
stock-price-detection/
โโโ data/ # Sample stock datasets
โโโ models/ # Saved model weights (.h5)
โโโ data_loader.py # Data fetching and preprocessing
โโโ training.py # Model training script
โโโ predict.py # Prediction and visualization
โโโ requirements.txt # Dependency list
โโโ README.md # This file
โ๏ธ Installation
- Clone the repository:
git clone https://github.com/yourusername/stock-price-detection.git
cd stock-price-detection- Install dependencies:
pip install -r requirements.txt๐ง Training the Model
python training.py- Default ticker: AAPL (Apple Inc.)
- Time period: 2010-01-01 to 2020-12-31
- Model saved as
models/best_model.h5
๐ฎ Making Predictions
python predict.py- Tests on 2021 data by default
- Generates
stock_prediction.pngcomparing actual vs predicted prices
๐ ๏ธ Customization
- Change stock ticker in both files
- Modify
look_backperiod (default: 60 days) - Adjust LSTM layers in
training.py
๐ค Contributing
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit changes (
git commit -m 'Add some feature') - Push to branch (
git push origin feature/AmazingFeature) - Open a Pull Request
๐ License
Distributed under MIT License. See LICENSE for more information.
Om Surve- LinkedIn - omsurve310704@outlook.com
Project Link: https://github.com/omsurve31/stock-price-detection