Skip to content

Instantly share code, notes, and snippets.

@ranpelta
Last active July 18, 2020 08:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ranpelta/723d50f783067c7cf904100878056e7f to your computer and use it in GitHub Desktop.
Save ranpelta/723d50f783067c7cf904100878056e7f to your computer and use it in GitHub Desktop.
X_test = test.drop(y_col,axis=1).copy()
scaled_X_test = Xscaler.transform(X_test)
test_generator = TimeseriesGenerator(scaled_X_test, np.zeros(len(X_test)), length=n_input, batch_size=b_size)
print(test_generator[0][0].shape)
>>> (32, 25, 3)
y_pred_scaled = model.predict(test_generator)
y_pred = Yscaler.inverse_transform(y_pred_scaled)
results = pd.DataFrame({'y_true':test[y_col].values[n_input:],'y_pred':y_pred.ravel()})
print(results)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment