-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathmain.py
23 lines (19 loc) · 797 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from config import TRAIN_NETWORK, VISUALIZE, STOCKS
from datahandler.stock import StockDataHandler
from network.LSTMNetwork import LSTMNetwork
from utils import get_datasets
def get_predictions():
datasets = get_datasets()
ret_data = []
if datasets is not None:
for i, data in enumerate(datasets):
data_handler = StockDataHandler()
data_handler.add(data, STOCKS[i])
lstm_network = LSTMNetwork(data_handler)
predictions = lstm_network.run_model(
weight_filename='stock_{0}_weights.h5'.format(STOCKS[i].split('/')[-1]), train=TRAIN_NETWORK,
evaluate=False, visualize=VISUALIZE)
ret_data.append(predictions)
return ret_data
if __name__ == "__main__":
print(get_predictions())