Created
January 26, 2019 18:06
-
-
Save ashokc/0f3fb5b44bba51c110c00086e58acc9b to your computer and use it in GitHub Desktop.
Train Test Split
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
# Test/Train Split | |
from sklearn.model_selection import StratifiedShuffleSplit | |
sss = StratifiedShuffleSplit(n_splits=1, test_size=0.2, random_state=1).split(Xencoded, labels) | |
train_indices, test_indices = next(sss) | |
train_x, test_x = Xencoded[train_indices], Xencoded[test_indices] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment