pywatts/pywatts/test_predict.py

25 lines
649 B
Python
Raw Normal View History

2018-06-23 15:00:16 +02:00
import tensorflow as tf
import pywatts.db
2018-08-13 14:31:39 +02:00
from pywatts.routines import *
2018-06-23 15:00:16 +02:00
PREDICT_QUERY = "query-sample_1hour.json"
PREDICT_RESULT = PREDICT_QUERY.replace("query", "result")
2018-08-13 14:31:39 +02:00
QUERY_ID = 0
2018-06-23 15:00:16 +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 = predict(n, pred_query)
2018-06-23 15:40:45 +02:00
print(prediction)
2018-08-06 13:28:27 +02:00
print(pred_result)
2018-06-23 15:00:16 +02:00
2018-08-13 14:31:39 +02:00
pywatts.routines.eval_prediction(prediction, pred_result)