Question: Required python program code for the below data with a different number of customers and items purchased as an input file.for example The file Groceries.csv
Required python program code for the below data with a different number of customers and items purchased as an input file.for example

The file Groceries.csv contains market basket data. The variables are:
- Customer: Customer Identifier
- Item: Name of Product Purchased
The data is already sorted in ascending order by Customer and then by Item. Also, all the items bought by each customer are all distinct.
After you have imported the CSV file, please discover association rules using this dataset.
- How many customers in this market basket data?
- How many unique items in the market basket across all customers?
- Create a dataset which contains the number of distinct items in each customers market basket. Draw a histogram of the number of unique items. What are the median, the 25th percentile and the 75th percentile in this histogram?
- Find out the k-itemsets which appeared in the market baskets of at least seventy five (75) customers. How many itemsets have you found? Also, what is the highest k value in your itemsets?
- Find out the association rules whose Confidence metrics are at least 1%. How many association rules have you found? Please be reminded that a rule must have a non-empty antecedent and a non-empty consequent.
- Graph the Support metrics on the vertical axis against the Confidence metrics on the horizontal axis for the rules you found in (e). Please use the Lift metrics to indicate the size of the marker.
- List the rules whose Confidence metrics are at least 60%. Please include their Support and Lift metrics.
- What similarities do you find among the consequents that appeared in (g)?
Customer Item 1 citrus fruit 1 margarine 1 ready soups 1 semi-finished bread 2 coffee 2 tropical fruit 2 yogurt 3 whole milk 4 cream cheese 4 meat spreads 4 pip fruit 4 yogurt 5 condensed milk 5 long life bakery product 5 other vegetables 5 whole milk 6 abrasive cleaner 6 butter 6 rice 6 whole milk 6 yogurt 7 rolls/buns 8 bottled beer 8 liquor (appetizer) 8 rolls/buns 8 UHT-milk 9 pot plants 10 cereal:s 10 whole milk 11 bottled water 11 chocolate 11 other vegetables 11 tropical fruit 11 white bread 12 bottled water 12 butter
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
