Average chocolate chip cookies

March 23, 2018

I recently wrote a program to determine consensus recipes. It scrapes the web for a thousand recipes for a given recipe (e.g. cookies), then clusters the recipes and finally computes an average ingredient list for each cluster. This idea was prompted by making brownies, because I wasn’t sure whether to use cocoa, chocolate, or both. Turns out there is a recipe for each variation of brownie.

I decided to try out my software in the real world. What would one of these average recipes taste like? To see, I computed the average recipes for “chocolate chip cookies” and took the second largest cluster because it had both baking powder and baking soda.

The computed average chocolate chip cookie recipe:

IngredientAmountVariationRel. Freq.
baking powder1 tsp± 1 3895
baking soda34 tsp± 3875
brown sugar78 cup± 3899
butter58 cup± 1297
chocolate1 cup± 58109
eggs2 whole± 34105
flour1 14 cup± 78116
salt58 tsp± 1286
sugar38 cup± 14100
vanilla1 58 tsp± 3 18100

I used my standard techniques for baking to mix up the ingredients - first mixing wet and then adding dry ingredients and then baking for 10-15 minutes at 350F. They turned out to be much more like cake than cookies. Apparently there was too much baking powder and the ratio of liquid to dry ingredients was too high. They also tasted too sugary. They weren’t bad, but they weren’t great, so I think they would qualify as average cookies.

Average cookies I made from my code results

I think part of the problem was that I had trouble converting ingredients to volumes for normalization. Some recipes dictate their recipes in “grams” or “ounces” which need to be converted to volume using the density. In this version I used a constant density for everything (0.9 g / ml) which was somewhat between the density for flour and water. However the density for flour (0.6 g / ml) is much lower than the density for water (1 g / ml) and butter (0.9 g / ml).

When I modified the densities, it indeed changed the flour to 1 34 cup instead of 1 14 cup, and reduced the variation from 78 cup to 12 cup. Next time I think I’d like to make the biggest cluster - i.e. the most popular recipe, which doesn’t use baking powder. Here’s that recipe:

IngredientAmountVariationRel. Freq.
baking soda78 tsp± 3897
brown sugar34 cup± 1491
butter34 cup± 3899
chocolate1 38 cup± 58105
eggs2 whole± 12103
flour2 cup± 1296
salt58 tsp± 3889
sugar12 cup± 1494
vanilla1 14 tsp± 2 1898

In this case the flour seems a lot more reasonable too (2 cups). I’d be interested in trying this recipe, instead.

If you’d like to generate your own average recipes, check out the source on Github.


Show comments
Written on 23 March 2018. Categories: food, coding.

«Consensus cookery 
Analyzing 15 marathons over 4,000 days»