Last active
January 12, 2019 18:32
-
-
Save saivarunk/37a002d9b3c1881abccf1e4ae65cd53b 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 split_sequence(sequence, n_steps): | |
| X, y = list(), list() | |
| for i in range(len(sequence)): | |
| end_ix = i + n_steps | |
| if end_ix > len(sequence)-1: | |
| break | |
| seq_x, seq_y = sequence[i:end_ix], sequence[end_ix] | |
| X.append(seq_x) | |
| y.append(seq_y) | |
| return array(X), array(y) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment