- Final update: 2018 Oct
- All right reserved @ Chanhee Jeong and Jaewook Kang 2018
This repository is to provide a toy stock price prediction in tf.keras
.
For the dataset, we have used the 5 years (1255 days
) S&P500 data,
where
1004
days data is used for the model training, and- the remaining
251
data is for the model testing.
We consider single layer RNN-like model for the problem.
Various options are available to compose the layer from tf.keras
:
- Simple RNN model:
tf.keras.layers.SimpleRNN
- LSTM model:
tf.keras.layers.LSTM
- GRU model:
tf.keras.layers.GRU
where the model shape in the training
as
Input X:
- A sequence of the `close value` in past 3-days
- X: [X_0:X_1003] has its shape as [1004 x 3 ] where the input of each cell is X_t = [1 x 3]
Output Y:
- A prediction of the `close value` of the next day
- Y has its shape as [1004 x 1] where the output of each cell is Y_t = [1]
Hidden state of each cell H:
- H_t denote the hidden state of each RNN cell which has its shape [64 x 1]
Training
python ./tfmodule/trainer.py
Inference
python ./tfmodule/eval.py
./tfmodule/
├── data
│ └── all_stocks_5yr.csv
├── data_loader.py
├── eval.py
├── model_builder.py
├── model_config.py
├── train_config.py
└── trainer.py
- Tensorflow >=1.9
- Python2 <= 2.7.12
- Python3 <= 3.6.0
- pandas >= 0.23.0
- numpy >= 1.14.5
- matplotlib >= 3.0.0
- Issues: report issues, bugs, and request new features
- Pull request
- Email: [email protected]; [email protected]
- Apach License 2.0