Last active
August 1, 2022 09:45
-
-
Save andrea-dagostino/4b3e051983487287d6265eb76492237e to your computer and use it in GitHub Desktop.
ts_clustering
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, k): | |
| """ | |
| Split a sequence in two, where k is the size of the first sequence | |
| """ | |
| return np.array(sequence[:int(len(sequence) * k)]), np.array(sequence[int(len(sequence) * k):]) | |
| def split_sequences(sequences, k=0.80): | |
| """ | |
| Applies split_sequence on all elements of a list or array | |
| """ | |
| return [split_sequence(sequence, k) for sequence in sequences] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment