Enrollments Closing Soon for Online Instructor-Led DevOps Certification Training by CloudxLab | No Cost EMI Available

  Enroll Now

Splitting the Data

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)

No hints are availble for this assesment

Answer is not availble for this assesment

Note - Having trouble with the assessment engine? Follow the steps listed here

Loading comments...