Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- X = df.drop(target_class_name, axis=1)
- y = df[target_class_name]
- # split into train and test set
- from sklearn.model_selection import train_test_split
- X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
- # Note optionally convert the pandas dataframe into a numpy array using to_numpy if you have a big data
- # and want to model faster. Otherwise it doesnt matter which data structure you use
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement