Skip to content

Instantly share code, notes, and snippets.

@smazzanti
Created April 8, 2020 21:47
Show Gist options
  • Save smazzanti/5ba50020f2d21022b9b0442f5c173190 to your computer and use it in GitHub Desktop.
Save smazzanti/5ba50020f2d21022b9b0442f5c173190 to your computer and use it in GitHub Desktop.
import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split
# make X and y
np.random.seed(0)
X = pd.DataFrame(np.random.normal(size = (20_000, len(feature_names))), columns = feature_names)
y = X2y(X, with_error = True)
# make X_trn, X_tst, y_trn, y_tst
X_trn, X_tst, y_trn, y_tst = train_test_split(X, y, test_size = .5, random_state = 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment