Skip to content

Instantly share code, notes, and snippets.

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 andrewm4894/fdb8ac2b8e8624e2a13e84b399f0faa1 to your computer and use it in GitHub Desktop.
Save andrewm4894/fdb8ac2b8e8624e2a13e84b399f0faa1 to your computer and use it in GitHub Desktop.
# now train on new data
print(f'... reshaping data for new data training ...')
data_train_new = data_reshape_for_model(data_new,N_TIMESTEPS,N_FEATURES)
print("... begin training on new data ...")
model = train(model,data_train_new,n_epochs=1)
yhat_new = predict(model,data_train_new)
df_out_new = yhat_to_df_out(data_train_new,yhat_new,N_TIMESTEPS,N_FEATURES)
plot_cols = [col for col in df_out_new.columns if 'error_avg' in col]
print(plot_cols)
# plot the new data
fig, ax = plt.subplots(num=None, figsize=(14, 6), dpi=80, facecolor='w', edgecolor='k')
size = len(df_out_new)
for col in plot_cols:
ax.plot(range(0,size), df_out_new[col], '-', linewidth=0.5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment