Code Monkey home page Code Monkey logo

crypto_prediction's Introduction

LinkedIn Contributors Forks Stargazers Issues GNU v3 License


Logo

Crypto Price Prediction Pipeline - Python Package

Python Package to create a pipeline for price prediction using a keras neural network model.

View Test · Report Bug · Request Feature

About The Package

This is a small package to produce pipelines to predict the btc price using keras neural networks.

(back to top)

Built With

This project was builded with the next technologies.

(back to top)

Getting Started

Building

Follow the next steps:

  1. Setup the project:
    python setup.py sdist
  2. Build the package:
    python setup.py build
  3. Install the package
    python setup.py install
  4. Install the package using pip.
    pip install crypto_prediction

(back to top)

Intalling

Just need to use pip with git command:

pip install git+https://github.com/estebanvz/crypto_prediction.git

Usage

Get the keys from API Binance:

GET BINANCE API KEYS

You can use the package using the api_key and api_secret from binance API. Also you could download the package crypo_price to download data from Binance API. Crypto Price Package

import os
import keras
from crypto_prediction import CryptoPredictor

c_predictor = CryptoPredictor(time_interval="1d")
c_predictor.download_crypto_dataset()
c_predictor.calculate_metrics()
c_predictor.load_dataset(path="datasets/1d/BTCUSDT.csv")
c_predictor.lag_variables(n_lags=60)
c_predictor.calculate_labels(n_times_future=5)
## To train a new model you can use split and normalize dataset function
# x_train_n, x_test_n, y_train, y_test = c_predictor.normalize_split_dataset(split_data=100)
regressor = keras.models.load_model("btcusdt1d0.039mae.h5")
c_predictor.set_keras_model(keras_model=regressor)
c_predictor.draw_prediction(x_test_n=x_test_n,n_future_steps=2)

Predicción

Prediction

The black line is the real price and the green dotted lines are the prediction made by the algorithm.

Real price

Prediction2

The real price on tradingview show us that the prediction of the algorithm was accurate.

Results

We can observe how the algorithm developed to test this pipeline produce a prediction of one day in the future that predict a range. The real price movement the next day was too close to the prediction of the algorithm.

It is needed more research in this algorithm to produce better results. The algorithm evaluated in this model produces a MAE of 0.021 in 100 days test dataset.

License

Distributed under the MIT License. See LICENSE for more information.

(back to top)

Contact

Esteban Vilca - @ds_estebanvz - [email protected]

Project Link: https://github.com/estebanvz/crypto_prediction

(back to top)

crypto_prediction's People

Contributors

estebanvz avatar

Stargazers

 avatar  avatar  avatar dongkai.liang avatar  avatar  avatar

Watchers

 avatar

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.