Skip to content

Instantly share code, notes, and snippets.

@rdisipio
Created November 6, 2022 13: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 rdisipio/95ae255b2ef0f186c68c5dbd525f036d to your computer and use it in GitHub Desktop.
Save rdisipio/95ae255b2ef0f186c68c5dbd525f036d to your computer and use it in GitHub Desktop.
import numpy as np
import tensorflow as tf
from sklearn import preprocessing
X_scaled = preprocessing.StandardScaler().fit_transform(X)
y_onehot = preprocessing.OneHotEncoder(sparse=False).fit_transform(y.reshape(-1, 1))
(
X_train,
X_test,
y_train,
y_test
) = train_test_split(X_scaled, y_onehot, test_size=0.3, random_state=1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment