Created
December 7, 2017 10:30
-
-
Save rajeshmr/852a746b7a76d16068a5bb613085cdce 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
VALIDATION_SPLIT = 0.4 | |
indices = np.arange(data.shape[0]) # get sequence of row index | |
np.random.shuffle(indices) # shuffle the row indexes | |
data = data[indices] # shuffle data/product-titles/x-axis | |
category = category[indices] # shuffle labels/category/y-axis | |
nb_validation_samples = int(VALIDATION_SPLIT * data.shape[0]) | |
x_train = data[:-nb_validation_samples] | |
y_train = category[:-nb_validation_samples] | |
x_val = data[-nb_validation_samples:] | |
y_val = category[-nb_validation_samples:] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment