Skip to content

Instantly share code, notes, and snippets.

@vecchp
Created July 14, 2018 19:46
Show Gist options
  • Save vecchp/1cfb99f704456dd7d1319aa8613b43e5 to your computer and use it in GitHub Desktop.
Save vecchp/1cfb99f704456dd7d1319aa8613b43e5 to your computer and use it in GitHub Desktop.
Looking at Train and Test samples for train_test_split
from sklearn.cross_validation import train_test_split
test_data = range(0,100)
for i in range(0,1):
Xtrain,Xtest,ytrain,ytest = train_test_split(test_data, test_data, random_state=0)
print("XTrain")
print(Xtrain)
print("XTest")
print(Xtest)
"""
XTrain
[48, 6, 99, 82, 76, 60, 80, 90, 68, 51, 27, 18, 56, 63, 74, 1, 61, 42, 41, 4, 15, 17, 40, 38, 5, 91, 59, 0, 34, 28, 50, 11, 35, 23, 52, 10, 31, 66, 57, 79, 85, 32, 84, 14, 89, 19, 29, 49, 97, 98, 69, 20, 94, 72, 77, 25, 37, 81, 46, 39, 65, 58, 12, 88, 70, 87, 36, 21, 83, 9, 96, 67, 64, 47, 44]
XTest
[26, 86, 2, 55, 75, 93, 16, 73, 54, 95, 53, 92, 78, 13, 7, 30, 22, 24, 33, 8, 43, 62, 3, 71, 45]
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment