1
$\begingroup$

I have a dataset which has information about food recipes (in german), that looks like this: reciped_data

Here is a link to a small .csv file (first 1000 rows of my data) https://drive.google.com/file/d/1C7thFlOnDn-oTc6AaDWA3CXXcX8m9NRu

The idea is to cluster the recipe names into n-categories so that afterwards I can assign every recipe to a category. Of note, there are tags and ingredients for every recipe, maybe this information helps to refine the clusters? For example the algorithm (maybe a semantic analysis?) should output: categorised recipes into 200 biggest found categories: (hamburger, soup, pizza, ...)

Is there a way to do this?

Note: I have for every recipe min. 1 image. The idea is to label my images with n-categories, afterwards to train a convolutional neural network with my data. The input would be an food image, the output would be a category.

$\endgroup$
1
$\begingroup$

This sounds like a job for latent dirichlet alocation (i.e. topic modeling).

$\endgroup$
1
$\begingroup$

I would suggest looking into frequent itemset mining such as the APRIORI algorithm.

Frequent itemsets will then correspond to frequent combinations of ingredients. It is easy to imagine this to yield interesting results, such as particular genres of cuisine, but also obvious patterns such as milk, eggs, butter and flour.

$\endgroup$
  • $\begingroup$ How would you then apply that information to cluster recipes? The best I can think of would be to create an indicator variable corresponding to each itemset and cluster recipes in itemset space (maybe using a jaccard metric or something like that which is designed for binary data), but I'm not convinced this would give better results than just similarly clustering on the raw ingredients list. I think this approach would mainly have the effect of double-counting common ingredients, which would probably make it harder to discriminate recipes. Did you have something else in mind? $\endgroup$ – David Marx Jan 3 '18 at 20:00
  • $\begingroup$ All recipes that have the ingredients are part of the cluster. But every recipe can belong to multiple clusters. So a pizza recipe can be vegan, for example. There is no reason to assume a good disjoint and total clustering must exist, is there? $\endgroup$ – Has QUIT--Anony-Mousse Jan 3 '18 at 20:03
  • $\begingroup$ There are several different natural clusters that should arise out of a recipe dataset. I agree that these clusters don't need to be disjoint (and LDA, my earlier suggestion, would not treat them as such), but I think you are wildly underestimating the number of clusters that would be produced here. Some clusters might be interesting, but the vast majority of clusters will be associated with rules like "flower + water -> salt" which are not descriptive of a flavor, regional cuisine, or even kind of food. That rule will appear in sauce, soup, dough... $\endgroup$ – David Marx Jan 3 '18 at 20:15
  • $\begingroup$ Thank you guys for your answers! I went with topics extraction with Non-Negative Matrix Factorization and successfully clustered my recipes into 300 categories. If anyone is interested, here is the python code. $\endgroup$ – Muriz Serifovic Jan 4 '18 at 1:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.