Browse by Topic

# Cheers! A Computational Exploration of Alcoholic Beverages with the Wolfram Language

For 10 thousand years, humans have been using fermentation to produce beverages for pleasure, rituals and healing. In ancient Greece, honey was fermented to produce mead. Today, popular sources of beverage fermentation are grains, grapes, berries and rice. The science of fermentation—known as zymology (or zymurgy)—is a fascinating blend of chemistry, biology, history and geography. The Wolfram Language now brings a new dimension to the study of alcoholic beverages through an extensive dataset ready to be explored and analyzed.

## Alcohol Arithmetic

The Wolfram Language offers more than six thousand functions, including arithmetic functions like Max, Min, Mean and Median. Let’s look at the median alcohol content per serving and default serving size volume for all rums in the alcoholic beverages data:

 ✕

This mimics EntityValue’s default behavior when working with attributed Food entities:

 ✕

You can apply the same calculation to other alcoholic beverages, including "Cognac", "Sake" and "Brandy"—which are all part of the FoodType entity—to see how they compare with "Rum".

Wolfram Language data on the alcohol content of beverages can help when deciding how much to drink. On a night out, approximately how many drafts of beer equate to the usual glass of Chardonnay you have at home? The average glass of wine is about five fluid ounces:

 ✕

A serving of draft beer is usually one pint:

 ✕

So, every pint of beer is equivalent in alcohol content to slightly more than one and a half glasses of wine:

 ✕

Knowledge of alcohol content can be useful when designing or choosing cocktails. Once liquors start to mix, it becomes harder to determine the actual alcohol content of the drink. Disclosing this information on menus could help less experienced bar patrons have a better understanding of what’s on offer.

Here’s a function that gets the total alcohol content of a group of alcohols (assuming the density of most alcohols is about one g/mL, the density of water):

 ✕

Let’s apply this function to a whiskey sour and a gin martini to compare the total alcohol content for these mixed drinks. A whiskey sour is often made with two fl. oz. of whiskey, and a classic gin martini can include two fl. oz. of gin and one fl. oz. of dry vermouth:

 ✕
 ✕
 ✕

In this example, the martini has a higher total alcohol content than the whiskey sour. But we are leaving the most important question for you to decide—shaken or stirred?

## Counting Calories

If you count calories, have you ever wondered whether red wines and white wines differ in calorie content? Do all white wines have similar calories? You can create informative plots that answer questions like these.

First, query the "RelativeTotalCaloriesContent" for both red and white wines using EntityValue:

 ✕

Use ListPlot to visualize the data:

 ✕
 ✕

## The World of Whiskey

If you enjoy whiskey, geography or travel, GeoBubbleChart can answer the question, “Where in the world are the whiskey producers?” You come away with an informative visualization and an entertaining tongue-twister.

Query the FoodLocation attribute for all whiskeys in the alcoholic beverages data:

 ✕

Use Interpreter to get the geo positions that correspond to the FoodLocation entities:

 ✕

Tally the geo positions and then plot them on a GeoBubbleChart to visualize the data:

 ✕

According to the data, the most common locations for whiskey producers are Kentucky, Tennessee, Scotland and Ireland, with less prolific whiskey producers in Canada and Japan. In this way, you could make sure that whiskeys from all around the world are represented in your home collection and explore the flavors produced across different regions.

You can reuse this code to produce another GeoBubbleChart and discover where FoodType values "Rum", "Beer" and "Vodka" are produced globally.

## Wine or Beer?

Machine learning and neural networks are prevalent in our everyday lives. You can apply Wolfram Language machine learning to the alcoholic beverages data. Use Classify to train a neural network to distinguish wines from beers based on relative alcohol content:

 ✕
 ✕

We split the data obtained from EntityValue into a training set (80% of the available data) and a testing set to make sure we can tell how well our ClassifierFunction works on values it hasn’t seen before:

 ✕

Create the ClassifierFunction:

 ✕

Classify a subset of the testing set data we reserved earlier:

 ✕
 ✕

NiceGrid from the Wolfram Function Repository displays a readable grid:

 ✕

## Flavorful Fruits

The alcoholic beverages available via the Wolfram Language are full of flavors. Several functions give you the ability to explore and visualize the data:

 ✕

You can continue to explore vodka flavors, like "Mango", "Peach" and "Coconut".

Use Manipulate to investigate other flavored alcoholic beverages:

 ✕
 ✕

## Flavors in Focus

The Wolfram Language can visualize data in many different ways. ImageCollage can tell your data story in full color:

 ✕

Find the images corresponding to the vodka FoodFlavor entities:

 ✕
 ✕

Use ImageCollage and Scaled to create a visualization of the most common flavors among vodkas in the Wolfram Language alcoholic beverages data:

 ✕

From this image, we can quickly see that citrus fruits are among the most popular vodka flavors, as well as strawberry, cherry, raspberry, cucumber and coconut. The data reveals some surprising flavors like pumpkin, dragon fruit, espresso and caramel.

WordCloud also provides an interesting weighted visualization of the most common vodka flavors:

 ✕

## A Parting Toast

I have enjoyed sharing some of the innovative ways you can analyze and visualize the wide range of alcoholic beverage data now available. I hope you continue to explore Wolfram Language food and beverage data and that you share your exploration with us. (And if you drink, please don’t drive. Arrange a designated driver.) Here’s to our wonderful Wolfram community:

 ✕
 Get full access to the latest Wolfram Language functionality with a Mathematica or Wolfram|One trial.