Created
October 17, 2019 22:33
-
-
Save rjurney/a789d6f07ff2df9b49f912f6f697b9b9 to your computer and use it in GitHub Desktop.
How to create a 0.7/0.2/0.1 Train/Test/Dev split of a dataset
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
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
why ramdom state is 1337?