Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from sklearn.cross_validation import train_test_split
- num_train = 300
- # Set the number of testing points
- num_test = X_all.shape[0] - num_train
- X_train, X_test, y_train, y_test = train_test_split(X_all, y_all, test_size=num_test, random_state=42)
- # Show the results of the split
- print("Training set has {} samples.".format(X_train.shape[0]))
- print("Testing set has {} samples.".format(X_test.shape[0]))
- print(X_train.head())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement