Giter Site home page Giter Site logo

ermalsh / stock_projections Goto Github PK

View Code? Open in Web Editor NEW

This project forked from edpolanco/stock_projections

0.0 2.0 0.0 3.74 MB

Building a stock prediction system using Recurrent Neural Networks.

License: MIT License

Python 14.39% Jupyter Notebook 85.61%

stock_projections's Introduction

Stock Prediction System

Facebook Prediction

Project Goal

The goal for this project is to demonstrate one approach to building a stock prediction system using Recurrent Neural Networks (RNN) that 1) make accurate predictions and 2) can serve as a basis for creating a more robust stock prediction system.

The project is divided in four sections (the project’s pipeline):

  1. Prepare data – we download closing prices (from yahoo finance) for a list of stocks and prepare it for Neural Network (NN) input.
  2. Model selection – Test out a few different RNN models with various different hyper-parameters to determine which model performs better.
  3. Model training – Based on the model selection process we train a model for each stock in our population.
  4. Making predictions – make predictions for new stocks using the trained models.

Each section is described in a jupyter notebook.

What is predicted?

The projection system demonstrated here predicts the following day's closing for a specific stock. By using an RNN model and providing the previous day’s closing prices as input, we can predict the following day’s closing price for a given stock.

Stock prediction premise.

The premise of the stock prediction system is that we want to model paths for a sample of stocks, and then train an RNN model for each path. We can then make predictions for a new stock by passing the historical closing prices of this stock to each trained model (trained path) and select the model (path) with the lowest median squared error (MSE) to make predictions.

Conclusion

As evident in the prediction.ipynb jupyter notebook, our stock projections made very accurate predictions when introduced with a new stock. For example, when we tried to predict the closing price for Facebook we obtained the following results:

Facebook Prediction

Although, our system produced accurate results, it only produces a prediction one day in the future.

These are two ways to improve this projection system:

  1. Predict more days in the future such as up to 10 or 15 days. This can be accomplished by converting our RNN training model to a sequence-to-sequence model from the current sequence-to-prediction model.
  2. Add more features to the input sequence. In the model_selection.ipyjnb notebook it became evident that using three features produced better results than one feature. There are many more features than can be explored as possible inputs.

stock_projections's People

Watchers

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