Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
How to create a 0.7/0.2/0.1 Train/Test/Dev split of a dataset
from sklearn.model_selection import train_test_split
X_train, X_test_dev, y_train, y_test_dev = train_test_split(
df['_Body'],
df['_Index'],
test_size=0.3,
random_state=1337,
)
X_dev, X_test, y_dev, y_test = train_test_split(
X_test_dev,
y_test_dev,
test_size=0.66667,
random_state=1337,
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.