Skip to content

Instantly share code, notes, and snippets.

@kipronokoech
Created August 2, 2020 14:47
Show Gist options
  • Save kipronokoech/c675881c221ba7c903fe65d579af0d80 to your computer and use it in GitHub Desktop.
Save kipronokoech/c675881c221ba7c903fe65d579af0d80 to your computer and use it in GitHub Desktop.
# 70% for training and 30% testing
training, test = train_test_split(reviews, test_size=0.30, random_state=42)
# define the independent (X) and target (y)
train_x,train_y = [x.text for x in training],[x.sentiment for x in training]
test_x,test_y = [x.text for x in test],[x.sentiment for x in test]
print("Size of train set: ",len(training))
print("Size of train set: ",len(test))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment