Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# split train dataset into train, validation and test sets
train_text, temp_text, train_labels, temp_labels = train_test_split(df['text'], df['label'],
random_state=2018,
test_size=0.3,
stratify=df['label'])
val_text, test_text, val_labels, test_labels = train_test_split(temp_text, temp_labels,
random_state=2018,
test_size=0.5,
stratify=temp_labels)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment