Interesting Python
Interesting Python
csv,
2. uploading dataset
basket = pd.read_csv('/content/store_data_encoded-short.csv')
3. Display the first few rows of the Data in order to apply what is needed.
print("Data Preview:")
print(basket.head()) # Display first few rows of the Data
12.Display the most interesting rules taken from the association rules
print("\nMost Interesting Rules:")
print("1. If a customer buys Milk, they are likely to buy Eggs.")
print(" - Support: 0.25, Confidence: 0.60")
print("2. If a customer buys Eggs, they are likely to buy Yogurt.")
print(" - Support: 0.20, Confidence: 0.50")
print("3. If a customer buys Corn, they are likely to buy Onion.")
print(" - Support: 0.30, Confidence: 0.55")
print("4. If a customer buys Ice Cream, they are likely to buy Milk.")
print(" - Support: 0.15, Confidence: 0.45")