Skip to content

Instantly share code, notes, and snippets.

@h3ik0th
Created May 15, 2022 14:54
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 h3ik0th/c764691bec4973c6a44e46e9da46ba9f to your computer and use it in GitHub Desktop.
Save h3ik0th/c764691bec4973c6a44e46e9da46ba9f to your computer and use it in GitHub Desktop.
# training: load a saved model or (re)train
if LOAD:
print("have loaded a previously saved model from disk:" + mpath)
model = TFTModel.load_model(mpath) # load previously model from disk
else:
model.fit( series=ts_ttrain,
future_covariates=cov_t,
val_series=ts_ttest,
val_future_covariates=cov_t,
verbose=True)
print("have saved the model after training:", mpath)
model.save_model(mpath)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment