Running Apriori on real-world data
In this example, we collected real-world shopping lists from an apartment and composed a small, but nevertheless realistic, dataset. Let's see if we'll be able to extract any meaningful rules from it using our algorithm. Please note that this dataset is extremely small. For any production application of Apriori, you will need much larger datasets:
let transactions = [["Grapes", "Cheese"], ["Cheese", "Milk"], ["Apples", "Oranges", "Cheese", "Gingerbread", "Marshmallows", "Eggs", "Canned vegetables"], ["Tea", "Apples", "Bagels", "Marshmallows", "Icecream", "Canned vegetables"], ["Cheese", "Buckwheat", "Cookies", "Oatmeal", "Banana", "Butter", "Bread", "Apples", "Baby puree"], ["Baby puree", "Cookies"], ["Cookies"], ["Chicken", "Grapes", "Pizza", "Cheese", "Marshmallows", "Cream"], ["Potatoes"], ["Chicken"], ["Сornflakes", "Cookies", "Oatmeal"], ["Tea"], ["Chicken"], ["Chicken", "Eggs", "Cheese", "Oatmeal", "Bell pepper", "Bread", "Chocolate...