Code Monkey home page Code Monkey logo

deeplearning-homework's Introduction

LSTM_Stock_Predictor

deep-learning.jpg

In this project, we will use deep learning recurrent neural networks to model bitcoin closing prices. One model will use the FNG indicators to predict the closing price while the second model will use a window of closing prices to predict the nth closing price.

Project Approach:

  1. Prepare the data for training and testing
  2. Build and train custom LSTM RNNs
  3. Evaluate the performance of each model

Prepare the data for training and testing

  1. We will slice the data using the window of time function for the n day window.
  2. For the Fear and Greed model, We will use the FNG values to try and predict the closing price.
  3. For the closing price model, We will use previous closing prices to try and predict the next closing price.
  4. We will use 70% of the data for training and 30% of the data for testing in each model
  5. using MinMaxScaler we will scale X and y values for the model.
  6. Finally, reshape the X_train and X_test values to fit the model's requirement of samples, time steps, and features. (example: X_train = X_train.reshape((X_train.shape[0], X_train.shape[1], 1)))

Build and train custom LSTM RNNs

In the Jupyter Notebooks, we created the same custom LSTM RNN architecture.

  • In one notebook, we fit the data using the FNG values. In the second notebook, only closing prices are used.
  • In order to compare the models, we will use the same parameters and training steps for each model.

Evaluate the performance of each model

Finally, using the testing data to evaluate each model and compare the performance, we will answer the following:

  • Which model has a lower loss?
  • The model based on past closing prices has a lower loss compared to the model which predicted using FNG
  • Which model tracks the actual values better over time?
  • The model based on past close prices bettter tracks the actual values than predicting using FNG.

Prediction using 2day window close prices

Prediction using 2day FNG window

  • Which window size works best for the model?
  • The 2-day window size gave a better closing price prediction.

Price Predictions using closing prices across different time windows

Prediction using 2day window close prices

Prediction using 5day window close prices

Prediction using 10day window close prices

Prediction using 20day window close prices

  • Price Prediction using FNG index over different time windows

Prediction using 10day FNG window

Prediction using 20day FNG window

Prediction using 5day FNG window

Prediction using 2day FNG window


deeplearning-homework's People

Contributors

laguilar359 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.