Skip to content

Instantly share code, notes, and snippets.

@Karts27

Karts27/train.py Secret

Last active November 24, 2021 20:36
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 Karts27/edcbb7f68e7124aaeee92cc5d4d0ce5c to your computer and use it in GitHub Desktop.
Save Karts27/edcbb7f68e7124aaeee92cc5d4d0ce5c to your computer and use it in GitHub Desktop.
# Splitting our dataset into train-test split
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = 0.25, random_state = 100)
print('Train Shape: ', X_train.shape)
print('Test Shape: ', X_test.shape)
#Feature Scaling
sc = StandardScaler()
X_train = sc.fit_transform(X_train)
X_test = sc.transform(X_test)
from tensorflow.keras.utils import to_categorical
y_train = to_categorical(y_train, num_classes=None)
y_test = to_categorical(y_test, num_classes=None)
print ("Y = ",y_train.shape)
print ("X = ",X_train.shape)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment