Skip to content

Instantly share code, notes, and snippets.

@VictorSaenger
Last active October 9, 2019 08:17
Show Gist options
  • Select an option

  • Save VictorSaenger/46475d6ba5edf20a0dcf293e0e6c7b9d to your computer and use it in GitHub Desktop.

Select an option

Save VictorSaenger/46475d6ba5edf20a0dcf293e0e6c7b9d to your computer and use it in GitHub Desktop.
# split into shuffled folds:
#Note that you should edit the class array accordingly: Bias (classes_Bias) or Outlet (classes_All)
sss = StratifiedShuffleSplit(n_splits=1, test_size=0.33) # chose one split to make analysis faster. change it if required
for t, te in sss.split(eAll,classes_All):
# Scale the data with StandardScaler before splitting:
X_train, X_test = scaler.fit_transform(eAll)[t], \
scaler.fit_transform(eAll)[te]
y_train, y_test = classes_All[t]-1,classes_All[te]-1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment