Giter Site home page Giter Site logo

shubhampachori12110095 / stock-rnn Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lilianweng/stock-rnn

0.0 1.0 0.0 36 KB

Predict stock market prices using RNN model with multilayer LSTM cells + optional multi-stock embeddings.

Home Page: https://lilianweng.github.io/lil-log

Python 100.00%

stock-rnn's Introduction

Predict stock market prices using RNN

Check my blog post "Predict Stock Prices Using RNN: Part 1" for the tutorial associated.

  1. Make sure tensorflow has been installed.
  2. First download the full S&P 500 data from Yahoo! Finance ^GSPC (click the "Historical Data" tab and select the max time period). And save the .csv file to data/SP500.csv. (NOTE: Unfortunately, the startdate in the Google finance historical prices url does not seem to work any more. Each stock only gets one year's data, which is too short for training. I will update data_fetcher once I find other better alternative.)
  3. Run python data_fetcher.py to download the prices of individual stocks in S & P 500, each saved to data/{{stock_abbreviation}}.csv.
  4. Run python main.py --help to check the available command line args.
  5. Run python main.py to train the model.

For examples,

  • Train a model only on SP500.csv; no embedding
python main.py --stock_symbol=SP500 --train --input_size=1 --lstm_size=128 --max_epoch=50
  • Train a model on 100 stocks; with embedding of size 8
python main.py --stock_count=100 --train --input_size=1 --lstm_size=128 --max_epoch=50 --embed_size=8

My python environment:

BeautifulSoup==3.2.1
numpy==1.13.1
pandas==0.16.2
scikit-learn==0.16.1
scipy==0.19.1
tensorflow==1.2.1
urllib3==1.8

stock-rnn's People

Contributors

lilianweng avatar

Watchers

Shubham Pachori 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.