1.3. Spliting data into train and test

Spliting our dataset into train and test example

In [7]:
# Train -> 80%, Test -> 20%
# This returns our dataset split into training and test examples
def split_data(X, y):
    X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, shuffle=True)
    return X_train, X_test, y_train, y_test