Skip to content

Instantly share code, notes, and snippets.

@AyishaR
Created March 15, 2021 05:39
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 AyishaR/0abb4d60d977bc8ef432ea9d0af444e1 to your computer and use it in GitHub Desktop.
Save AyishaR/0abb4d60d977bc8ef432ea9d0af444e1 to your computer and use it in GitHub Desktop.
total_len = input_labels.shape[0]
#Shuffling inputs and labels
shuffle_permutation = np.arange(total_len)
np.random.shuffle(shuffle_permutation)
input_spectrogram = input_spectrogram[shuffle_permutation]
input_labels = input_labels[shuffle_permutation]
#Splitting into train and test dataset - 90-10 ratio
train_split = 0.9
cutoff = int(train_split*total_len)
inputs_train = input_spectrogram[:cutoff]
inputs_test = input_spectrogram[cutoff:]
labels_train = input_labels[:cutoff]
labels_test = input_labels[cutoff:]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment