All Projects → schollz → Meanrecipe

schollz / Meanrecipe

Licence: mit
Get a consensus recipe for your next meal. 🍪 🍰

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Meanrecipe

arisgarden
Electronic Cookbook
Stars: ✭ 52 (-62.86%)
Mutual labels:  food, recipes
bagels
open source bagel recipe; let's raise the quality of bagels worldwide 🥯 🚀
Stars: ✭ 21 (-85%)
Mutual labels:  food, recipes
Recipes App React Native
Recipes App in React Native
Stars: ✭ 386 (+175.71%)
Mutual labels:  food, recipes
recipes
Application for managing recipes, planning meals, building shopping lists and much much more!
Stars: ✭ 3,570 (+2450%)
Mutual labels:  food, recipes
recipes
I like food ¯\_(ツ)_/¯
Stars: ✭ 23 (-83.57%)
Mutual labels:  food, recipes
ramys-tedbira
A website (webapp) to get food recipes by recipes names & ingredients.
Stars: ✭ 15 (-89.29%)
Mutual labels:  food, recipes
Food Recipe Cnn
food image to recipe with deep convolutional neural networks.
Stars: ✭ 448 (+220%)
Mutual labels:  food, recipes
Pwa Barcode Scanner
Information about food from the barcode, on your phone 🛒
Stars: ✭ 122 (-12.86%)
Mutual labels:  food
Awesome Community Detection
A curated list of community detection research papers with implementations.
Stars: ✭ 1,874 (+1238.57%)
Mutual labels:  clustering
Msmbuilder
🏗 Statistical models for biomolecular dynamics 🏗
Stars: ✭ 118 (-15.71%)
Mutual labels:  clustering
Dat8
General Assembly's 2015 Data Science course in Washington, DC
Stars: ✭ 1,516 (+982.86%)
Mutual labels:  clustering
Imagecluster
Cluster images based on image content using a pre-trained deep neural network, optional time distance scaling and hierarchical clustering.
Stars: ✭ 122 (-12.86%)
Mutual labels:  clustering
Gourmet map
微信小程序「美食地图」——“发现最地道的美食”
Stars: ✭ 129 (-7.86%)
Mutual labels:  food
Ml Dl Scripts
The repository provides usefull python scripts for ML and data analysis
Stars: ✭ 119 (-15%)
Mutual labels:  clustering
Awesome Single Cell
Community-curated list of software packages and data resources for single-cell, including RNA-seq, ATAC-seq, etc.
Stars: ✭ 1,937 (+1283.57%)
Mutual labels:  clustering
Ml Email Clustering
Email clustering with machine learning
Stars: ✭ 116 (-17.14%)
Mutual labels:  clustering
Machine Learning Projects
This repository consists of all my Machine Learning Projects.
Stars: ✭ 135 (-3.57%)
Mutual labels:  clustering
Pt Dec
PyTorch implementation of DEC (Deep Embedding Clustering)
Stars: ✭ 132 (-5.71%)
Mutual labels:  clustering
Grocy Desktop
A (Windows) desktop application wrapper for https://github.com/grocy/grocy
Stars: ✭ 127 (-9.29%)
Mutual labels:  food
Fooddelivery
Design OO food delivery app with C# & Design Patterns
Stars: ✭ 126 (-10%)
Mutual labels:  food

meanrecipe

Sometimes when I want a recipe to cook something new I will find several recipes for the same thing and try to use them as a guide to generate an average or "consensus" recipe. This code should make it easy to generate consensus recipes (useful!) and also show variation between recipes (interesting!).

Finding a consensus recipe requires first clustering many recipes. This is because a single recipe (e.g. a recipe for brownies) might have many significant variations (e.g. brownies can have just cocoa, just chocolate, or both). This code will first cluster recipes and then use the clusters to deliver the consensus recipe.

How does it work

The quick-and-dirty implementation goes like this:

  1. Choose a recipe (e.g. brownies, crepes, pancakes).
  2. Search to find thousands of corresponding recipes.
  3. Download all the recipes convert to gzipped text for processing.
  4. Use a really simple (read: bad) context-extractor to grab ingredients.
  5. Cluster the recipes based on the presence of ingredients.
  6. Take the mean values (after removing outliers) for ingredients in a given cluster to create an average recipe.

The context-extractor works by finding the most likely "ingredient" section in the web page and then trying to parse those ingredients using a greedy search from a list of likely ingredients (top_5k.txt). Its not a great implementation. However, the errors in it are pretty random, which means you can get okay results as long as you have ~hundreds of recipes.

Here's some examples of running the code.

Chocolate chip cookies

$ meanrecipe -recipe 'chocolate chip cookies'

The output will container multiple recipes for 'chocolate chip cookies', clustered according to ingredients. For example, here is the first cluster, the most popular recipe:

Cluster 1 (35% of 1041)

Ingredients:
- 1 teaspoon baking soda (± 42%)
- ⅞ cup brown sugar (± 40%)
- ⅞ cup butter (± 29%)
- 1 ⅝ cup chocolate (± 62%)
- 2 eggs (± 62%)
- 2 ¼ cup flour (± 40%)
- ¾ teaspoon salt (± 67%)
- ¾ cup sugar (± 51%)
- 1 ⅝ teaspoon vanilla (± 75%)

Directions:
1. Preheat oven to 300 degrees F (150 degrees C).

2. Sift together the flour, baking powder and salt, set aside. In a
medium bowl, cream the butter and sugar together until fluffy.
Gradually stir in the dry ingredients, then stir in the walnuts and
chocolate chips.

3. Roll or scoop dough into walnut sized balls. Place them on unprepared
cookie sheets 1 1/2 inches apart. Flatten cookies slightly. Bake for
15 to 20 minutes, until light golden brown. Remove from sheets to cool
on racks.

The second cluster (the second most popular 'chocolate chip cookie' recipe) has pinpointed a variation - the inclusion of baking powder.

Cluster 2 (16% of 1041)
Variation:
 +baking powder

Ingredients:
- 1 ⅛ teaspoon baking powder (± 80%)
- ⅞ teaspoon baking soda (± 49%)
- 1 ⅛ cup brown sugar (± 80%)
- ⅞ cup butter (± 40%)
- 1 ⅝ cup chocolate (± 85%)
- 2 eggs (± 55%)
- 2 ⅛ cup flour (± 51%)
- ¾ teaspoon salt (± 71%)
- ¾ cup sugar (± 80%)
- 2 teaspoon vanilla (± 78%)

Directions:
1. Preheat oven to 300 degrees F (150 degrees C).

2. Sift together the flour, baking powder and salt, set aside. In a
medium bowl, cream the butter and sugar together until fluffy.
Gradually stir in the dry ingredients, then stir in the walnuts and
chocolate chips.

3. Roll or scoop dough into walnut sized balls. Place them on unprepared
cookie sheets 1 1/2 inches apart. Flatten cookies slightly. Bake for
15 to 20 minutes, until light golden brown. Remove from sheets to cool
on racks.

Reading further down you can find even more variations, for example this recipe which uses cocoa:

Cluster 5 (4% of 1041)
Variation:
 +cocoa

Ingredients:
- ¾ teaspoon baking soda (± 57%)
- ¾ cup brown sugar (± 57%)
- ¾ cup butter (± 52%)
- 1 ⅛ cup chocolate (± 72%)
- ⅜ cup cocoa (± 80%)
- 1 eggs (± 44%)
- 1 ½ cup flour (± 67%)
- ⅝ teaspoon salt (± 88%)
- ¾ cup sugar (± 88%)
- 1 ½ teaspoon vanilla (± 67%)

Directions:
1. Preheat oven to 350 degrees F (175 degrees C). Grease cookie sheets.
Stir together the flour, cocoa, baking powder, baking soda, salt and
cinnamon; set aside.

2. In a large bowl, cream together the margarine, brown sugar and white
sugar. Beat in the egg and vanilla. Stir in the dry ingredients using
a wooden spoon. Mix in the oats and chocolate chips. Drop by
tablespoonfuls onto cookie sheets, leaving 2 inches between cookies.

3. Bake for 8 to 10 minutes in the preheated oven, or until lightly
browned.  Allow cookies to cool on baking sheet for 5 minutes before
removing to a wire rack to cool completely.

Try it

Web

You can try it on the web at https://meanrecipe.schollz.com/

Install

Download from the latest releases, or download with Go:

$ go get github.com/schollz/meanrecipe

Run

Just run from the command line and specify the food that you want.

$ meanrecipe -recipe 'chocolate chip cookies'

Be patient as it will take 3-5 minutes to download and pre-process the data. Data is only downloaded once, if you run it a second time it will use the previous data.

You can also generate different number of clusters using -clusters X where X is the number of clusters.

To make sure certain ingredients are included just use -include 'chocolate, oats' (for example).

Roadmap

This is a quick-and-dirty project. I don't plan to do much more on it, it was just a fun thing.

However, here are some things I realize this project does not do and would be great to implement:

  • [ ] Making food volumes more accurate. The code specifies a constant density for ingredients that are specified in weight so that they can be converted to volumes (volumes are necessary for normalization before taking means). In reality different foods have different densities, of course.
  • [ ] Making proportions more accurate. This will be easier if the previous item is finished.
  • [x] Adding in a specifier for the variation in the amount (show the mean and the standard deviation of the mean?).
  • [x] Adding in recipe directions. Is there a way towards consensus directions? This might be really really hard.
  • [ ] In general, making the parsing (from websites) and the food tagging better. There are more sophisticated taggers (see NYT food tagger).

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].