Machine Learning Mixology

MACHINE MIXOLOGY was an interactive art installation involving a computer bartender. Visitors could generate cocktail recipes based on a Gaussian mixology model, which they were then served in real-time. The installation was run at ACUD MACHT NEU in Berlin, Germany as part of a machine learning art showcase.

The aim was to add alternative dimensions to the data visualization of artificial intelligence by translating it to consumable drinks as well as “bar” charts as shown below. Visitors were able to select the degree to the machine learning bartender had been trained (they could pick a poorly trained model for the crazier drinks or a more advanced model for the more standard drinks).

I compiled a dataset of cocktail recipes by scraping three different online resources, totaling 8,356 cocktails using total 518 ingredients. After cleaning and parsing each recipe into a dictionary, each recipe had a list of ingredients and a portion size for each ingredient.Prior to modeling the data, I noticed that the presence of most ingredients were quite sparse. I wrote a Python script to match up similar ingredients and then lump them together into categories. This put similar ingredients like “apple liqueur” and “green apple liqueur” into the same category. I converted each drink recipe to a binary vector. This means that each recipe was represented using a long string of 1’s and 0’s, one binary digit for each ingredient that was 1 if the recipe included that ingredient and 0 otherwise. The vectors were then fitted to a Gaussian Mixture Model (GMM), which is essentially a series of Gaussian curves in many dimensions. With each ingredient constituting a dimension, the GMM allows us to generate random samples with vector distributions probabilistically similar to those in our original dataset. After using the GMM to generate random lists of ingredients, I wrote a separate program to take those ingredient lists and match them up with amounts depending on their categories (ex: “2 oz apple liqueur”). I ran these programs together to produce hundreds of different computer-generated cocktail recipes.

I then wrote a program to automatically produce “bar charts”. The illustrations above are entirely automatically digitally generated images. The image- generator is essentially a highly modified data visualization.

The project now exists as anĀ Instagram bot.