GithubHelp home page GithubHelp logo

btc-prediction-lstm's Introduction

Bitcoin Price Prediction Using LSTM

Project Overview

This project uses a Long Short-Term Memory (LSTM) model to predict Bitcoin prices. It encompasses data preparation, feature engineering, model building, training, and predictions using historical price data.

Motivation

The aim is to apply machine learning techniques to financial data, developing a model that accurately predicts Bitcoin prices, potentially aiding in investment decisions.

Structure

  • data_preparation.py: Processes raw Bitcoin price data.
  • data_utils.py: Utilities for data processing.
  • technical_indicators.py: Adds technical indicators to the data.
  • feature_engineering.py: Enhances data with technical indicators and normalizes it.
  • logger.py: Sets up logging for the project.
  • objective.py: Defines the objective function for hyperparameter optimization.
  • model.py: Defines the LSTM neural network architecture.
  • train.py: Trains and evaluates the model with historical data.
  • train_model.py: Contains functions for model training.
  • train_utils.py: Utility functions for training.
  • predict.py: Uses the trained model for future price predictions.

Data

Data is downloaded from Yahoo Finance using yfinance. The raw data is stored in data/raw_data.csv.

Processed data files:

  • data/processed_data_{TICKER}.csv: Cleaned up data.
  • data/raw_data_{TICKER}.csv: Raw data.
  • data/scaled_data_{TICKER}.csv: Normalized data with technical indicators for model training.

Usage

Training

Run the training script to train the model:

sh train.sh

Run training scripts individually

# Prepare the data
python3 src/data_preparation.py

# Setup the feature engineering
python3 src/feature_engineering.py

# Train the model
python3 src/train.py

Predict

Run the prediction script to make predictions:

sh predict.sh
# Predict the test data
python3 src/predict.py

Logging

The project uses Python's logging module to output logs to both the terminal and log files, aiding in monitoring and debugging.

Requirements

pandas~=2.1.3
numpy~=1.26.2
tensorflow~=2.16.1
featuretools~=1.31.0
statsmodels~=0.14.2
matplotlib~=3.9.0
scikit-learn~=1.3.2
keras~=3.3.3
joblib~=1.3.2
yfinance~=0.2.32
PyQt5~=5.15.10
optuna~=3.6.1
optuna-integration~=3.6.0

Install Dependencies

pip install -r requirements.txt

Contributors

  • Gianluca Mazza
  • Matteo Garbelli

License

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

btc-prediction-lstm's People

Contributors

gianlucamazza avatar

Stargazers

 avatar  avatar Eric avatar

Watchers

Kostas Georgiou avatar  avatar

btc-prediction-lstm's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.