Apriori algorithm implementation in python code. X_train, X_test, y_train, y_test = train_test_split .