Advertisement
Guest User

Untitled

a guest
Oct 17th, 2019
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. X = df.drop(target_class_name, axis=1)
  2. y = df[target_class_name]
  3.  
  4. # split into train and test set
  5. from sklearn.model_selection import train_test_split
  6. X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
  7.  
  8. # Note optionally convert the pandas dataframe into a numpy array using to_numpy if you have a big data
  9. # and want to model faster. Otherwise it doesnt matter which data structure you use
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement