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 3⁄895
baking soda3⁄4 tsp± 3⁄875
brown sugar7⁄8 cup± 3⁄899
butter5⁄8 cup± 1⁄297
chocolate1 cup± 5⁄8109
eggs2 whole± 3⁄4105
flour1 1⁄4 cup± 7⁄8116
salt5⁄8 tsp± 1⁄286
sugar3⁄8 cup± 1⁄4100
vanilla1 5⁄8 tsp± 3 1⁄8100

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 3⁄4 cup instead of 1 1⁄4 cup, and reduced the variation from 7⁄8 cup to 1⁄2 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 soda7⁄8 tsp± 3⁄897
brown sugar3⁄4 cup± 1⁄491
butter3⁄4 cup± 3⁄899
chocolate1 3⁄8 cup± 5⁄8105
eggs2 whole± 1⁄2103
flour2 cup± 1⁄296
salt5⁄8 tsp± 3⁄889
sugar1⁄2 cup± 1⁄494
vanilla1 1⁄4 tsp± 2 1⁄898

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»