Skip to content
LSTM model for predicting the price of Bitcoin.
Jupyter Notebook Python
Branch: master
Clone or download
Latest commit 41489e3 Mar 5, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.DS_Store a Dec 1, 2017
README.md
crawl-data.py Upload Files Dec 1, 2017
crypto_stock_new.csv Upload Files Dec 1, 2017
cryptocurrency-prediction.ipynb Upload Files Dec 1, 2017
model.png a Dec 1, 2017
processing.png Add images Dec 1, 2017

README.md

cryptocurrency-prediction

LSTM model for predicting the price of Bitcoin.

Deep Learning:

3 layer bidirectional RNN to predict the closing price of Bitcoin given a variety of data from previous days. Code for scraping cryptocurrency data is included, as well as the LSTM model. The RNN architecture is shown as follows:

Data Processing:

Scraping the data yields a 2D tensor of m samples by n features. We used a time-series transform to turn this into a set of windows data with window size w=50, yielding a 3D tensor of shape (m - w) samples by n features by w day window size. For instance, our first data point m=0 had a 2D tensor of m features for each of 0-49 days. Then, we normalized the data. Finally, we separated this into the input and output data by removing the last day and making it the output data. Refer to below for a visualization of this.

alt text

Results

Our model predicts slightly better than random on testing data over a 3-month period. Predicting cryptocurrency prices is challenging, even for humans...

Acknowledgements

I worked on this with William Wolfe-McGuire. This code provides several improvements to Siraj's stock prediction.

My brother made substantial improvements to this code. His repository is here.

You can’t perform that action at this time.