Last active
January 12, 2019 18:45
-
-
Save saivarunk/bd92cb575d8ec781d4760174383ecf88 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# choose a number of time steps | |
n_steps = 5 | |
# split into sequence | |
X, y = split_sequence(real_price.values, n_steps) | |
# reshape from [samples, timesteps] into [samples, timesteps, features] to fit in LSTM model | |
n_features = 1 | |
X = X.reshape((X.shape[0], X.shape[1], n_features)) | |
# split into train - test sets | |
X_train = X[0:-365] | |
y_train = y[0:-365] | |
X_test = X[-365:] | |
y_test = y[-365:] | |
# store the test dates | |
test_dates = real_price.index[-365:] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment