Skip to content

omsurve31/stock-prediction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

5 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ“ˆ Stock Price Prediction using LSTM (Soft Computing)

Python TensorFlow License

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

  1. Clone the repository:
git clone https://github.com/yourusername/stock-price-detection.git
cd stock-price-detection
  1. 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.png comparing actual vs predicted prices

๐Ÿ“Š Sample Output Prediction Visualization

๐Ÿ› ๏ธ Customization

  • Change stock ticker in both files
  • Modify look_back period (default: 60 days)
  • Adjust LSTM layers in training.py

๐Ÿค Contributing

  1. Fork the project
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit changes (git commit -m 'Add some feature')
  4. Push to branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

๐Ÿ“œ License Distributed under MIT License. See LICENSE for more information.

๐Ÿ“ง Contact

Om Surve- LinkedIn - omsurve310704@outlook.com

Project Link: https://github.com/omsurve31/stock-price-detection

About

Stock Price Prediction using LSTM (Soft Computing)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages