Created
July 28, 2020 01:17
-
-
Save alik604/69548f99a9dda2d45c42db59e226cff0 to your computer and use it in GitHub Desktop.
build_dataset LSTM.py
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
# make dataset to input | |
def build_dataset(time_series, seq_length): | |
dataX = [] | |
dataY = [] | |
for i in range(0, len(time_series) - seq_length): | |
_x = time_series[i:i + seq_length, :] | |
_y = time_series[i + seq_length, [-1]] # Next close price | |
print(_x, "->", _y) | |
dataX.append(_x) | |
dataY.append(_y) | |
return np.array(dataX), np.array(dataY) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
src