<commit_before>---
layout: post-light-feature
title: The Statistics of Recipes (RecipEntropy)
description: "Of all possible combinations of ingredients, only a small fraction are used as recipes. What's special about those combinations?"
category: articles
modified: 2014-01-16
category: [projects]
tags: [statistics, recipes, information theory, entropy, culturomics, projects]
image:
  feature: gatsby.jpg
  thumb: grethumb.jpg
---

<i>With: <NAME> & <NAME></i>

This project started with a riddle:

<i>Can you think of a set of three types of food, in which each pair of foods tastes good together, but the combination of all three does not taste good?</i>

This riddle is harder than you might expect, and, ultimately, I have yet to hear a satisfactory answer (but if you think you have a candidate, please email me!).

Subjectivity in what "tastes good" aside, this riddle begs the question: can you construct recipes simply by combining ingredients that taste good as pairs? Or are there situations in which these pairwise relationships are not enough to predict the quality of a recipe?

Perhaps surprisingly, these questions can be formalized in a rigorous, quantitative way. Using the framework of maximum entropy modeling, we can ask how much of the information contained in the distribution of recipes is accounted for by pairwise interactions alone, and how much depends on triplet, quadruplet, or even higher order interactions. Using a database containing over 50,000 recipes (and over 300 ingredients), we are attempting to answer these questions. 

Maximum entropy modeling allows us to construct a model of the distribution of recipes that contains the minimum amount of information (and therefore the maximum amount of entropy), while constraining the overall frequencies of ingredients and the correlations between ingredients. 

We hope to use this framework to figure out how much higher order interactions between ingredients matter, to search for answers to the riddle that inspired us, and hopefully to predict (and synthesize in the "lab") some novel recipes!<commit_msg>updated category of test project<commit_after>---
layout: post-light-feature
title: The Statistics of Recipes (RecipEntropy)
description: "Of all possible combinations of ingredients, only a small fraction are used as recipes. What's special about those combinations?"
category: projects
modified: 2014-01-16
tags: [statistics, recipes, information theory, entropy, culturomics, projects]
image:
  feature: gatsby.jpg
  thumb: grethumb.jpg
---

<i>With: <NAME> & <NAME></i>

This project started with a riddle:

<i>Can you think of a set of three types of food, in which each pair of foods tastes good together, but the combination of all three does not taste good?</i>

This riddle is harder than you might expect, and, ultimately, I have yet to hear a satisfactory answer (but if you think you have a candidate, please email me!).

Subjectivity in what "tastes good" aside, this riddle begs the question: can you construct recipes simply by combining ingredients that taste good as pairs? Or are there situations in which these pairwise relationships are not enough to predict the quality of a recipe?

Perhaps surprisingly, these questions can be formalized in a rigorous, quantitative way. Using the framework of maximum entropy modeling, we can ask how much of the information contained in the distribution of recipes is accounted for by pairwise interactions alone, and how much depends on triplet, quadruplet, or even higher order interactions. Using a database containing over 50,000 recipes (and over 300 ingredients), we are attempting to answer these questions. 

Maximum entropy modeling allows us to construct a model of the distribution of recipes that contains the minimum amount of information (and therefore the maximum amount of entropy), while constraining the overall frequencies of ingredients and the correlations between ingredients. 

We hope to use this framework to figure out how much higher order interactions between ingredients matter, to search for answers to the riddle that inspired us, and hopefully to predict (and synthesize in the "lab") some novel recipes!
{'fraction_non_alphanumeric': 0.047016706443914084, 'fraction_numerical': 0.0076372315035799524, 'mean_word_length': 5.082728592162554, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4647957', 'n_tokens_mistral': 981, 'n_tokens_neox': 918, 'n_words': 617}