Skip to content

Instantly share code, notes, and snippets.

@lylayang
Last active March 15, 2020 07:20
Show Gist options
  • Save lylayang/e5755e0e2b012af90ccd878864e6e55d to your computer and use it in GitHub Desktop.
Save lylayang/e5755e0e2b012af90ccd878864e6e55d to your computer and use it in GitHub Desktop.
train_size = 900
test_size = len(df_arr) - train_size
train, test = df_arr[0:train_size,:], df_arr[train_size:len(df_arr),:]
look_back = 30
trainX, trainY = convert2matrix(train, look_back)
testX, testY = convert2matrix(test, look_back)
# reshape input to be [samples, time steps, features]
trainX = np.reshape(trainX, (trainX.shape[0], 1, trainX.shape[1]))
testX = np.reshape(testX, (testX.shape[0], 1, testX.shape[1]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment