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 ranpelta/899bd812f0ac459e9e71eb1615c52889 to your computer and use it in GitHub Desktop.
Save ranpelta/899bd812f0ac459e9e71eb1615c52889 to your computer and use it in GitHub Desktop.
n_input = 25 #how many samples/rows/timesteps to look in the past in order to forecast the next sample
n_features= X_train.shape[1] # how many predictors/Xs/features we have to predict y
b_size = 32 # Number of timeseries samples in each batch
generator = TimeseriesGenerator(scaled_X_train, scaled_y_train, length=n_input, batch_size=b_size)
print(generator[0][0].shape)
>>> (32, 25, 3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment