Answers for "Splitting training and test data using sklearn"

0

Splitting training and test data using sklearn

#Let us now split the dataset into train & test
from sklearn.model_selection import train_test_split
x_train,x_test, y_train, y_test = train_test_split(X, y, test_size = 0.30, random_state=0)
print("x_train ",x_train.shape)
print("x_test ",x_test.shape)
print("y_train ",y_train.shape)
print("y_test ",y_test.shape)
Posted by: Guest on March-17-2022

Code answers related to "Splitting training and test data using sklearn"

Python Answers by Framework

Browse Popular Code Answers by Language