Login using Social Account
     Continue with GoogleLogin using your credentials
We have to separate the original data frame into train and test sets.
Import the train_test_split
from from sklearn.model_selection
from sklearn.model_selection import << your code comes here >>
Split the X
, y
into train and test sets using train_test_split
.
X_train, X_test, y_train, y_test = << your code comes here >>(X, y, test_size=0.3, random_state=0)
Print the shape of the above split-sets.
print("Transactions in X_train dataset: ", X_train.shape)
print("Transaction classes in y_train dataset: ", y_train.shape)
print("Transactions in X_test dataset: ", X_test.shape)
print("Transaction classes in y_test dataset: ", y_test.shape)
Taking you to the next exercise in seconds...
Want to create exercises like this yourself? Click here.
Note - Having trouble with the assessment engine? Follow the steps listed here
Loading comments...