Finding the pattern of food
mining ingredients with association rules
To continue from previous article on food and nutrients, today I want to find common ingredients associated with different seasons, festivals and themes.
In order to do that, I applied association rule on Epicurious recipe data to find related item sets based on 3 measures: they appear relatively frequently (support), one item often appears with another appears (confidence), and they appear more often than by chance (lift).
In the matrix view, subset of associations are grouped. We see seasonal produce such as asparagus in spring, sweet potato in fall as well as seasonal beverage such as hot drink in winter.
In terms of food by holiday, at a concise view it shows food ranging from champagne on new yearโs eve, backyard bbq on fourth of jul to edible gifts on Christmas.
A use case for this is that recipe sites can compare their seasonal recipes with google search trend of food items to understand emerging need from their users.
When zoom into a festival, one can observe greater details.
Then we can also look into ingredients and diet related with certain kind of food, such as quick&easy meals:
appetizer:
dessert:
Also because of the double-tagging nature (a recipe is tagged both an item and its parent item if any), we can actually use it to group labels, to similar effect of clustering:
This is #day55 of my #100dayprojects on data science and visual storytelling. Full code on my github. Thanks for reading. Suggestions of new topics and feedbacks are always welcomed.
Share This Article
Towards Data Science is a community publication. Submit your insights to reach our global audience and earn through the TDS Author Payment Program.
Write for TDS