Created
July 29, 2019 09:42
-
-
Save prateekjoshi565/2ca82b918c2003423a834f7640632404 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
# shuffle customer ID's | |
random.shuffle(customers) | |
# extract 90% of customer ID's | |
customers_train = [customers[i] for i in range(round(0.9*len(customers)))] | |
# split data into train and validation set | |
train_df = df[df['CustomerID'].isin(customers_train)] | |
validation_df = df[~df['CustomerID'].isin(customers_train)] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment