Association rule mining typically requires transaction data, which is a dataset where each row represents a unique transaction and each column represents an item that was purchased or observed in that transaction. The items can be anything that is of interest, such as products in a grocery store, items in an online shopping cart, or symptoms in a medical record. Each item can have one or more categories or attributes, such as price, color, or brand, which can be used to group or categorize the data. The transaction data is typically stored in a sparse format, where the presence or absence of an item in a transaction is indicated by a binary (0/1) value or a count. This data format is often used in conjunction with algorithms such as Apriori, FP-Growth, or Eclat to extract frequent itemsets and generate association rules.
From this data, only a few columns are selected. They are:
trip_distance
fare_amount
passenger_count
payment_type
This is visualized below.
The above-mentioned columns are then converted to categorical and then created as a transaction since ARM requires transaction data.
Image: Converted data to categorical.
Once data is converted to categorical, data is converted to transaction data in R as shown below.
Final data which is a transaction data can be accessed here.