Guest User

Untitled

a guest
Apr 20th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. # read SPY.csv
  2. train = readTrain()
  3.  
  4. # Augment the features (year, month, date, day)
  5. train_Aug = augFeatures(train)
  6.  
  7. # Normalization
  8. train_norm = normalize(train_Aug)
  9.  
  10. # build Data, use last 30 days to predict next 5 days
  11. X_train, Y_train = buildTrain(train_norm, 30, 5)
  12.  
  13. # shuffle the data, and random seed is 10
  14. X_train, Y_train = shuffle(X_train, Y_train)
  15.  
  16. # split training data and validation data
  17. X_train, Y_train, X_val, Y_val = splitData(X_train, Y_train, 0.1)
  18. # X_trian: (5710, 30, 10)
  19. # Y_train: (5710, 5, 1)
  20. # X_val: (634, 30, 10)
  21. # Y_val: (634, 5, 1)
Add Comment
Please, Sign In to add comment