Created
March 15, 2020 07:27
-
-
Save lylayang/c592aafd18175751e13a0f09766b362f 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
train_size = 900 | |
train,test = df1.values[0:train_size,:], df1.values[train_size:len(df1.values),:] | |
look_back = 30 #create window size as look_back=30 | |
test = np.append(test,np.repeat(test[-1,], look_back)) | |
train = np.append(train,np.repeat(train[-1,],look_back)) | |
trainX,trainY =convert2matrix(train,look_back) | |
testX,testY =convert2matrix(test, look_back) | |
# reshape input to be [samples, window size, 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