Skip to content

Instantly share code, notes, and snippets.

@Sanlap1997
Created October 3, 2020 06:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Sanlap1997/4d00646ee612fa3ad4c3f7118a73a665 to your computer and use it in GitHub Desktop.
Save Sanlap1997/4d00646ee612fa3ad4c3f7118a73a665 to your computer and use it in GitHub Desktop.
# pick the feature columns
sensor_cols = ['s' + str(i) for i in range(1,22)]
sequence_cols = ['setting1', 'setting2', 'setting3', 'cycle_norm']
sequence_cols.extend(sensor_cols)
# generator for the sequences
seq_gen = (list(gen_sequence(train_df[train_df['id']==id], sequence_length, sequence_cols))
for id in train_df['id'].unique())
# generate sequences and convert to numpy array
seq_array = np.concatenate(list(seq_gen)).astype(np.float32)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment