VOOZH about

URL: https://towardsdatascience.com/finding-the-pattern-of-food-a462b3ce5910/

โ‡ฑ Finding the pattern of food | Towards Data Science


Finding the pattern of food

mining ingredients with association rules

1 min read
๐Ÿ‘ all the sweet things
all the sweet things

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).

๐Ÿ‘ food associated with different seasons
food associated with different seasons

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.

๐Ÿ‘ food associated with major festivals
food associated with major festivals

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.

๐Ÿ‘ Image

Then we can also look into ingredients and diet related with certain kind of food, such as quick&easy meals:

๐Ÿ‘ A salad/couscous kinda mood
A salad/couscous kinda mood

appetizer:

๐Ÿ‘ some cheese, some tomato, some seafood
some cheese, some tomato, some seafood

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:

๐Ÿ‘ Image

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.


Written By

Hannah Yan Han

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

Related Articles