Last active
December 31, 2018 05:19
-
-
Save lettergram/a37be951dd02a7627da6512b218fbc1f 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
# Generate split training and testing data (80% training, 20% testing) | |
x_train, x_test, y_train, y_test = load_encoded_data(data_split=0.8) | |
# Determine the number of categories (i.e. sentence types) | |
num_classes = np.max(y_train) + 1 | |
# Set the classifcation to a Keras readable format (categorical) | |
y_train = keras.utils.to_categorical(y_train, num_classes) | |
y_test = keras.utils.to_categorical(y_test, num_classes) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment