From 68e9b9ddd0add8a37ca9f8adb7a127e893085fa1 Mon Sep 17 00:00:00 2001 From: reedts Date: Mon, 13 Aug 2018 14:42:31 +0200 Subject: [PATCH] Cap all prediction values to zero --- pywatts/routines.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pywatts/routines.py b/pywatts/routines.py index 0cdba19..cf4d80e 100644 --- a/pywatts/routines.py +++ b/pywatts/routines.py @@ -64,7 +64,8 @@ def plot_training(evaluation): def predict(nn, X_pred): pred = nn.predict1h(X_pred) - predictions = np.array([p['predictions'] for p in pred]) + # Cap results to 0 + predictions = np.array([max(p['predictions'], 0) for p in pred]) return predictions @@ -80,7 +81,7 @@ def predict24h(nn, X_pred): # Remove first value and append predicted value del input['dc'][0] input['dc'].append(predictions[-1]) - print(input) + print("Prediction for hour %d/%d" % (i+1, 24)) return predictions