In [13]:
from sklearn.model_selection import train_test_split
In [14]:
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)
In [15]:
print(y_train)
[0 2 1 1 1 2 2 0 1 0 1 1 2 2 1 1 2 0 1 2 2 0 1 1 1 2 1 1 1 2 1 1 2 0 1 1 0
 2 2 1 0 2 2 2 2 2 0 0 2 2 0 1 0 2 0 2 2 0 0 0 0 0 1 0 1 1 2 0 2 0 0 2 1 1
 0 2 0 2 0 1 0 1 2 1 1 2 1 0 2 0 0 0 1 2 2 1 0 2 1 2 1 0 1 2 0 0 1 1 2 1 0
 0 1 2 0 1 0 1 1 0]
In [16]:
print(y_test)
[0 0 2 2 2 0 1 0 0 1 1 2 0 2 0 1 2 1 0 0 0 2 2 1 2 2 2 0 1 2]