Skip to content

andrewlidong/stock_predictor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stock Price Prediction

A machine learning project for predicting stock prices using LSTM neural networks. The project includes data collection, feature engineering, model training, and real-time predictions.

Features

  • Historical stock data collection using yfinance
  • Technical indicator calculation (RSI, MACD, Bollinger Bands, etc.)
  • LSTM model for time series prediction
  • Feature normalization and preprocessing
  • Model training with validation
  • Real-time predictions

Project Structure

stock_prediction/
├── src/
│   ├── data/
│   │   ├── __init__.py
│   │   └── collect_data.py
│   ├── models/
│   │   ├── __init__.py
│   │   ├── base_model.py
│   │   └── lstm_model.py
│   ├── utils/
│   │   ├── __init__.py
│   │   └── features.py
│   └── api/
│       ├── __init__.py
│       ├── main.py
│       └── dashboard.py
├── data/
├── models/
├── results/
├── requirements.txt
└── README.md

Setup

  1. Clone the repository:
git clone https://github.com/yourusername/stock_prediction.git
cd stock_prediction
  1. Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt

Usage

  1. Collect historical stock data:
python src/data/collect_data.py --symbol AAPL --start 2020-01-01
  1. Train the model:
python src/models/train.py --model lstm --symbol AAPL --start 2020-01-01
  1. Make predictions:
python test_model.py
  1. Start the API server:
uvicorn src.api.main:app --reload
  1. Launch the dashboard:
streamlit run src.api.dashboard

Contributing

Feel free to submit issues, fork the repository, and create pull requests for any improvements.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

predicting stock prices using LSTM neural networks

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages