Advertisement
Guest User

Untitled

a guest
May 28th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. from sklearn.cross_validation import train_test_split
  2.  
  3. num_train = 300
  4.  
  5. # Set the number of testing points
  6. num_test = X_all.shape[0] - num_train
  7. X_train, X_test, y_train, y_test = train_test_split(X_all, y_all, test_size=num_test, random_state=42)
  8.  
  9. # Show the results of the split
  10. print("Training set has {} samples.".format(X_train.shape[0]))
  11. print("Testing set has {} samples.".format(X_test.shape[0]))
  12. print(X_train.head())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement