Skip to content

Instantly share code, notes, and snippets.

@jfkirk
Last active January 18, 2019 01:45
Show Gist options
  • Save jfkirk/91c80fec2fa66cd8f920971ff4dde4e6 to your computer and use it in GitHub Desktop.
Save jfkirk/91c80fec2fa66cd8f920971ff4dde4e6 to your computer and use it in GitHub Desktop.
# Shuffle the ratings and split them in to train/test sets 80%/20%
random.shuffle(raw_ratings) # Shuffles the list in-place
cutoff = int(.8 * len(raw_ratings))
train_ratings = raw_ratings[:cutoff]
test_ratings = raw_ratings[cutoff:]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment