Skip to content

Instantly share code, notes, and snippets.

@grohith327
Created October 30, 2019 17:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save grohith327/3d3ab1759f6a7a41654cbedbcd5dd7e8 to your computer and use it in GitHub Desktop.
Save grohith327/3d3ab1759f6a7a41654cbedbcd5dd7e8 to your computer and use it in GitHub Desktop.
from sklearn.utils import shuffle
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import OneHotEncoder
enc = OneHotEncoder()
y_data = enc.fit_transform(y_data).toarray()
x_data, y_data = shuffle(x_data, y_data)
X_train, X_test, y_train, y_test = train_test_split(x_data, y_data, test_size=0.2,stratify=y_data,random_state=42)
X_train = X_train.reshape((-1,1025,87,1))
X_test = X_test.reshape((-1,1025,87,1))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment