Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
# 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
You can’t perform that action at this time.