Created
March 9, 2023 04:22
-
-
Save Axect/a0a7433f4ff229a4367a16c19f8614c1 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
def sliding_window(data, seq_length, pred_length): | |
x = [] | |
y = [] | |
for i in range(len(data) - seq_length - pred_length): | |
_x = data[i:(i+seq_length)] | |
_y = data[i+seq_length:i+seq_length+pred_length] | |
x.append(_x) | |
y.append(_y) | |
return np.array(x), np.array(y) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment