All Projects → lilianweng → Stock Rnn

lilianweng / Stock Rnn

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

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Stock Rnn

Datastories Semeval2017 Task4
Deep-learning model presented in "DataStories at SemEval-2017 Task 4: Deep LSTM with Attention for Message-level and Topic-based Sentiment Analysis".
Stars: ✭ 184 (-84.83%)
Mutual labels:  lstm, embeddings
Aialpha
Use unsupervised and supervised learning to predict stocks
Stars: ✭ 1,191 (-1.81%)
Mutual labels:  lstm, stock-price-prediction
Kprn
Reasoning Over Knowledge Graph Paths for Recommendation
Stars: ✭ 220 (-81.86%)
Mutual labels:  lstm, embeddings
Stock Market Prediction Web App Using Machine Learning And Sentiment Analysis
Stock Market Prediction Web App based on Machine Learning and Sentiment Analysis of Tweets (API keys included in code). The front end of the Web App is based on Flask and Wordpress. The App forecasts stock prices of the next seven days for any given stock under NASDAQ or NSE as input by the user. Predictions are made using three algorithms: ARIMA, LSTM, Linear Regression. The Web App combines the predicted prices of the next seven days with the sentiment analysis of tweets to give recommendation whether the price is going to rise or fall
Stars: ✭ 101 (-91.67%)
Mutual labels:  lstm, stock-price-prediction
Persian-Sentiment-Analyzer
Persian sentiment analysis ( آناکاوی سهش های فارسی | تحلیل احساسات فارسی )
Stars: ✭ 30 (-97.53%)
Mutual labels:  embeddings, lstm
Stockprediction
Plain Stock Close-Price Prediction via Graves LSTM RNNs
Stars: ✭ 134 (-88.95%)
Mutual labels:  lstm, stock-price-prediction
datastories-semeval2017-task6
Deep-learning model presented in "DataStories at SemEval-2017 Task 6: Siamese LSTM with Attention for Humorous Text Comparison".
Stars: ✭ 20 (-98.35%)
Mutual labels:  embeddings, lstm
Ml Ai Experiments
All my experiments with AI and ML
Stars: ✭ 107 (-91.18%)
Mutual labels:  lstm, embeddings
SentimentAnalysis
Sentiment Analysis: Deep Bi-LSTM+attention model
Stars: ✭ 32 (-97.36%)
Mutual labels:  embeddings, lstm
SentimentAnalysis
(BOW, TF-IDF, Word2Vec, BERT) Word Embeddings + (SVM, Naive Bayes, Decision Tree, Random Forest) Base Classifiers + Pre-trained BERT on Tensorflow Hub + 1-D CNN and Bi-Directional LSTM on IMDB Movie Reviews Dataset
Stars: ✭ 40 (-96.7%)
Mutual labels:  embeddings, lstm
Paper-Implementation-DSTP-RNN-For-Stock-Prediction-Based-On-DA-RNN
基於DA-RNN之DSTP-RNN論文試做(Ver1.0)
Stars: ✭ 62 (-94.89%)
Mutual labels:  lstm, stock-price-prediction
Ner Lstm
Named Entity Recognition using multilayered bidirectional LSTM
Stars: ✭ 532 (-56.14%)
Mutual labels:  lstm, embeddings
deep-char-cnn-lstm
Deep Character CNN LSTM Encoder with Classification and Similarity Models
Stars: ✭ 20 (-98.35%)
Mutual labels:  embeddings, lstm
Stock Prediction Models
Gathers machine learning and deep learning models for Stock forecasting including trading bots and simulations
Stars: ✭ 4,660 (+284.17%)
Mutual labels:  lstm, stock-price-prediction
Multi Class Text Classification Cnn Rnn
Classify Kaggle San Francisco Crime Description into 39 classes. Build the model with CNN, RNN (GRU and LSTM) and Word Embeddings on Tensorflow.
Stars: ✭ 570 (-53.01%)
Mutual labels:  lstm, embeddings
Keras bert classification
Bert-classification and bert-dssm implementation with keras.
Stars: ✭ 67 (-94.48%)
Mutual labels:  lstm
Lstm Ctc Ocr
using rnn (lstm or gru) and ctc to convert line image into text, based on torch7 and warp-ctc
Stars: ✭ 70 (-94.23%)
Mutual labels:  lstm
Timecop
Time series based anomaly detector
Stars: ✭ 65 (-94.64%)
Mutual labels:  lstm
Irm Based Speech Enhancement Using Lstm
Ideal Ratio Mask (IRM) Estimation based Speech Enhancement using LSTM
Stars: ✭ 66 (-94.56%)
Mutual labels:  lstm
Chinese Word Vectors
100+ Chinese Word Vectors 上百种预训练中文词向量
Stars: ✭ 9,548 (+687.14%)
Mutual labels:  embeddings

Predict stock market prices using RNN

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

One thing I would like to emphasize that because my motivation is more on demonstrating how to build and train an RNN model in Tensorflow and less on solve the stock prediction problem, I didn't try too hard on improving the prediction outcomes. You are more than welcome to take this repo as a reference point and add more stock prediction related ideas to improve it. Enjoy.

  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.
  3. Run python data_fetcher.py to download the prices of individual stocks in S & P 500, each saved to data/{{stock_abbreviation}}.csv. (NOTE: Google Finance API returns the prices for 4000 days maximum. If you are curious about the data in even early times, try modify data_fetcher.py code to send multiple queries for one stock. Here is the data archive (stock-data-lilianweng.tar.gz) of stock prices I crawled up to Jul, 2017. Please untar this file to replace the "data" folder in the repo for test runs.)
  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
  • Start your Tensorboard
cd stock-rnn
mkdir logs
tensorboard --logdir ./logs --port 1234 --debug

My python environment: Python version == 2.7

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
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].