2018-08-13 14:19:39 +02:00
|
|
|
import tensorflow as tf
|
|
|
|
import pywatts.db
|
2018-08-13 14:31:39 +02:00
|
|
|
from pywatts.routines import *
|
2018-08-13 14:19:39 +02:00
|
|
|
import matplotlib.pyplot as pp
|
|
|
|
|
|
|
|
|
|
|
|
PREDICT_QUERY = "query-sample_24hour.json"
|
|
|
|
PREDICT_RESULT = PREDICT_QUERY.replace("query", "result")
|
2018-08-13 16:35:03 +02:00
|
|
|
QUERY_ID = 4
|
2018-08-13 14:19:39 +02:00
|
|
|
|
|
|
|
|
|
|
|
pred_query = input_query("../sample_data/" + PREDICT_QUERY, QUERY_ID)
|
|
|
|
pred_result = input_result("../sample_data/" + PREDICT_RESULT, QUERY_ID)
|
|
|
|
|
|
|
|
|
|
|
|
# Define feature columns and initialize Regressor
|
|
|
|
feature_col = [tf.feature_column.numeric_column(str(idx)) for idx in range(336)]
|
|
|
|
n = pywatts.neural.Net(feature_cols=feature_col)
|
|
|
|
|
|
|
|
prediction = predict24h(n, pred_query)
|
|
|
|
|
|
|
|
print(prediction)
|
|
|
|
print(pred_result)
|
|
|
|
|
|
|
|
pp.plot(pred_result, 'black')
|
|
|
|
pp.plot(prediction, 'red')
|
|
|
|
pp.show()
|