Giter Club home page Giter Club logo

stock-price-predictor's Introduction

stock-price-predictor

Predicting the stock price has been researched for long. Now many people try to predict stock price with the machine learning algorithms, but there is not a single answer for this and it is still challenging problem.

It is also known that every country's stock market influences each other. In this project, I am going to predict the stock price in Japan with the data of US stock price and USD/JPY exchange rates.

Methodology

LSTM Model

LSTM is a one kind of the RNN (Recurrent neural network), capable of learning long-term dependencies. Both RNN and LSTM has the repeating module of neural network. RNN repeats it very simple structure, but LSTM repeats it with special way. So that LSTM can remember with longer context, and it is the reason to use LSTM for this problem.

Benchmark

Benchmark model is made by the DummyClassifier. The MSE (Mean Squared Error) of the prediction should be less than the benchmark score.

The data I am going to use is Nikkei 225, NASDAQ and USD/JPY currency data.

Datasets

1. Nikkei 225

The data starts from January 1950 to current date. This data can be obtained at Quandl.

The input feature data is the change rate from the previous day of Nikkei 225.

2. NASDAQ Index

The data starts from January 2003 to current date. This data can be obtained at Quandl.

The input feature data is the change rate from the previous day of the NASDAQ index.

3. Currency Exchange - JPY/USD

The data starts from March 1991 to current date. This data can be obtained at Quandl.

The input feature data is the change rate from the previous day of the JPY/USD exchange rate.

Run

Prepare Datasets

Please download the csv data from Quandl.

Add /data directory and locate the downloaded files under /data directory.

Execute

$ docker build -t stock-price-predictor .
$ docker run -it stock-price-predictor python main.py

Prediction Result

  • Prediction result with Epochs: 100, hidden_neurons: 50 Epochs 100 (Blue: Predicted, Orange: Actual)

  • Prediction result with Epochs: 300, hidden_neurons: 50 Epochs 300 (Blue: Predicted, Orange: Actual)

This is the comparison between predicted change rate and actual change rate.

I noticed that the actual change rate has higher volatility and the predicted one has relatively lower volatility. But the remarkable result is that it predicts very well for the big drop and some of the rising. Of course it does not work well for some days, but as I see the graph I think the prediction results fit with the actual data.

Proposal

You can find the proposal here.

Report

You can find the frull report here.

Author

Takayoshi Nishida [email protected]

stock-price-predictor's People

Contributors

takp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

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.