pywatts/pywatts/photovoltaic_gruppe4.py

30 lines
682 B
Python
Raw Normal View History

2018-09-09 17:25:43 +02:00
import os
import sys
import tensorflow as tf
import pywatts.db
from pywatts.routines import *
# get rid of TF debug message
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
2018-09-11 14:41:52 +02:00
if len(sys.argv) != 2:
2018-09-12 17:52:05 +02:00
print("Usage: python photovoltaic_gruppe4.py <file.json>")
2018-09-09 17:25:43 +02:00
exit(1)
2018-09-11 14:41:52 +02:00
json_file = sys.argv[1] # json file
2018-09-09 17:25:43 +02:00
2018-09-11 14:41:52 +02:00
oneH, queries = input_queries(json_file)
2018-09-09 17:25:43 +02:00
feature_col = [tf.feature_column.numeric_column(str(idx)) for idx in range(336)]
n = pywatts.neural.Net(feature_cols=feature_col)
predictions = []
for query in queries:
2018-09-11 14:41:52 +02:00
if oneH:
2018-09-09 17:25:43 +02:00
predictions.extend(predict(n, query).astype('Float64').tolist())
else:
predictions.append(predict24h(n, query))
print(predictions)