Last active
April 2, 2020 12:31
-
-
Save FelixChop/3ffa60e0d9847d45ed7439e2a1c3c9e0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
target = 'Survived' | |
intermediate_sample, holdout = train_test_split(titanic, | |
test_size=.2, | |
random_state=2020, | |
stratify=titanic[target]) | |
train, validation = train_test_split(intermediate_sample, | |
test_size=.2, | |
random_state=2020, | |
stratify=intermediate_sample[target]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment