Answers for "shuffle x_train and y_train toghether"

0

shuffle x_train and y_train toghether

from sklearn.utils import shuffle
import numpy as np

X = np.array([[0, 0, 0], [1, 1, 1], [2, 2, 2], [3, 3, 3], [4, 4, 4]])
y = np.array([0, 1, 2, 3, 4])
X, y = shuffle(X, y)
print(X)
print(y)



[[1 1 1]
 [3 3 3]
 [0 0 0]
 [2 2 2]
 [4 4 4]] 

[1 3 0 2 4]
Posted by: Guest on April-22-2021

Code answers related to "shuffle x_train and y_train toghether"

Browse Popular Code Answers by Language