Created
August 28, 2021 21:16
-
-
Save shyamal18122000/166fb0ed613935851f039960ff2d4493 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def preprocessing(raw): | |
label = tf.keras.utils.to_categorical(raw.label, 10) | |
num_of_images = raw.shape[0] | |
x_as_array = raw.values[:,1:] | |
x_shaped_array = x_as_array.reshape(num_of_images, 28, 28, 1) | |
image = x_shaped_array / 255 | |
return image, label | |
X, Y = preprocessing(train_fashion_data) | |
X_test, Y_test = preprocessing(test_fashion_data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment