Skip to content

Instantly share code, notes, and snippets.

@oscar-defelice
Created March 15, 2021 17:52
Show Gist options
  • Save oscar-defelice/7788d6267f220a2b6414f87bf55534cc to your computer and use it in GitHub Desktop.
Save oscar-defelice/7788d6267f220a2b6414f87bf55534cc to your computer and use it in GitHub Desktop.
from sklearn.model_selection import train_test_split
X = pd.DataFrame(np.c_[df[df.columns[:-1]]], columns = df.columns[:-1])
Y = df.target
X_train, X_test, Y_train, Y_test = train_test_split(X, Y, test_size = 0.2, random_state=42)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment