Skip to content

Instantly share code, notes, and snippets.

@ashwinprasadme
Created December 15, 2020 04:05
Show Gist options
  • Save ashwinprasadme/f748060220ca6e3178ad61919732bbbd to your computer and use it in GitHub Desktop.
Save ashwinprasadme/f748060220ca6e3178ad61919732bbbd to your computer and use it in GitHub Desktop.
######Prediction###############
lstm.eval()
train_predict = lstm(dataX.to(device))
data_predict = train_predict.cpu().data.numpy()
dataY_plot = dataY.data.numpy()
## Inverse Normalize
data_predict = scaler.inverse_transform(data_predict)
dataY_plot = scaler.inverse_transform(dataY_plot)
## Add dates
df_predict = pd.DataFrame(data_predict)
df_predict = df_predict.set_index([dates_list[:-29]])
df_labels = pd.DataFrame(dataY_plot)
df_labels = df_labels.set_index([dates_list[:-29]])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment