Slide 1

Slide 1 text

A DRUNKARD’S WALK IN THE SCIENCE OF COCKTAILS Photo by Helena Yankovska on Unsplash Michiel Stock @michielstock michielfmstock@gmailcom KERMIT

Slide 2

Slide 2 text

A formal definition A cocktail is an alcoholic mixed drink, which is either a combination of spirits, or one or more spirits mixed with other ingredients such as fruit juice, flavored syrup, or cream. Sweet vermouth Gin Campari Cognac Cointreau Lime juice Lemon juice Simple syrup Saline solution Tequila 0 0.15 0.3 0.45 0.6 Negroni Sidecar Margarita Which ingredients? What ratios to mix?

Slide 3

Slide 3 text

Fundamental law of traditional cocktails There is no chilling without dilution, and there is no dilution without chilling. Corollary 2: shape of ice doesn’t matter Corollary 1: use a food thermometer to reproduce the perfect cocktail Corollary 3: don’t use plastic ice cubes heat capacity ice: 2.03 J/(g·K) enthalpy of fusion 333.55 J/g heat capacity water: 4.18 J/(g·K)

Slide 4

Slide 4 text

Consequences of the fundamental law more mixing colder more dilution more alcohol, acid and sugar!

Slide 5

Slide 5 text

Cocktail balance at glance egg white shaken blended stirred carbonated From Liquid Intelligence

Slide 6

Slide 6 text

How do we compute with cocktail data?

Slide 7

Slide 7 text

Kernels A kernel is symmetric positive-definite function that is equivalent to an inner product in an implied Hilbert space. k h (x), (x0)i H X H k(x, x′ ) = ⟨ϕ(x), ϕ(x′ )⟩ℋ feature map characterizing a datapoint in a high-dimensional space e.g. mixer described by alcohol %, sugar content, acidity… kernel PCA is a way to look into this space

Slide 8

Slide 8 text

β = [β1 , …, βn ]T ∈ Δn−1 Kernel mean embedding Kernel mean embedding in injective for many kernels, i.e., embedding retains all information on the distribution! μ = ∑ i βi ϕ(xi ) Cognac Cointreau Lemon juice Simple syrup 0 0.15 0.3 0.45 0.6 ϕ ℋ Represent a probability distribution as a weighted sum in the Hilbert space. embedding of mixer i volume fraction of mixer i cocktail embedding

Slide 9

Slide 9 text

- 0.50 - 0.25 0.00 0.25 0.50 - 0.4 - 0.2 0.0 0.2 0.4 Mixers in the Hilbert space First component Second component Mixer Sidecar Margarita Negroni Generic sweet vermouth Gin Campari Cognac Cointreau Lemon juice Simple syrup Blanco tequila Lime juice Saline solution Sidecar Margarita Negroni Margarita

Slide 10

Slide 10 text

KPCA mixers First component Second component vermouth liquors bitters juices acids sweeteners others modified spirits spirits Carpano Antica Formula Dolin Blanc Dolin Dry Doling Rouge Generic dry vermouth Generic sweet vermouth Lillet blanc Martinelli Amaro CioCiaro Amer Picon Aperol Benedictine Campari Chartreuse Green Chartreuse Yellow Cointreau Crème de cacao white Crème de violette Drambui Fernet Branca Luxardo Maraschino Angostura Hellfire Peychauds Ashmead s Kernel apple Concord grape Cranberry Granny Smith apple Grapefruit Honeycrisp apple Orange Strawberry Wickson apple Champagne acid Lemon juice Lime acid orange Lime juice Orange juice lime strength x70 Brix caramel syrup Butter syrup Coriander syrup Demerara syrup Djer syrup Grenadine Honey syrup Maple syrup any nut orgeat Commercial orgeat Quinine simple syrup Raspberry syrup Simple syrup Cabernet sauvignon Coconut water Egg white Espresso Heavy cream Saline solution Sour orange juice Café Zacapa Chocolate vodka Jalapeño Tequila Lemongrass vodka Milk washed rum Peanut butter and jelly vodka Sugared 100 proof Sugared 80 proof Tea vodka Turmeric gin Absinthe Absolute citron vodka Apple brandy Blanco tequila Bourbon Cherry Heering Cognac Gin Lairds Applejack Pisco Plymoth gin Rye Scotch Sloe gin Sugared 80 proof rum Sugared 100 proof rye White mezcal White rum Orange bitters Curacao KPCA cocktails First component Second component built stirred shaken egg white blended carbonated Old- fashioned Widow's kiss De La Louisiane Improved Whiskey Cocktail Rusty Nail Manhattan with Rye Bijou Brooklyn Vieux Carré Old Pall Rob Roy Robby Burns Manhattan with Bourbon Martinez Hanky Panky Blackthorn Negroni Pegu Club Blinker Brandy Crusta Between the Sheets Last Word Champs- Elysées Sidecar Aviation Margarita Jack Rose Corpse Reviver #2 Fresh Lime Gimlet 20th- Century Cocktail Bee's Knees Southside Gold Rush Cosmopolitan Cosmopolitan TC Brown Derby Hemingway Daiquiri Alexander Blood and Sand Classic Daiquiri Honeysuckle Daiquiri (more lime) Whiskey Sour Clover Club Pink Lady Pisco Sour Blended Whiskey Sour Blender Margarita Blender Daiquiri Chartruth Gin and Juice, Agar Clarified Gin and Juice, Centrifuge Clarified Carbonated Negroni Gin and Tonic (dry) Carbonated Whiskey Sour Carbonated Margarita K CKCT kernel matrix on mixers kernel matrix on cocktails matrix containing the mixer ratio for each ingredient

Slide 11

Slide 11 text

Determining a composition of mixers min β∈Δn−1 ||μ − n ∑ i=1 βi ϕ(xi )||2 − λ ⋅ H(β) Given a recipe containing n mixers x1,…, xn , find the mixing ratio vector β to obtain a cocktail similar to embedding μ. entropy term: makes problem strongly convex rational: try a bit of everything H(β) = − n ∑ i=1 βi log βi 0.0 0.2 0.4 0.6 0.8 1.0 0.0 0.2 0.4 0.6 0.8 1.0 0 2.5 5.0 7.5 10.0 12.5 15.0 0.0 0.2 0.4 0.6 0.8 1.0 0.0 0.2 0.4 0.6 0.8 1.0 0 2.5 5.0 7.5 10.0 12.5 15.0 λ = 0 λ > 0 easy to solve! 3 mixers embedding of the cocktails you want to emulate match between suggested cocktail and embedding

Slide 12

Slide 12 text

Creating a new recipe min β∈ΔN−1 ||μ − N ∑ i=1 βi ϕ(xi )||2 + λ ⋅ |β| 0 Given a liquor cabinet of N mixers x1,…, xN , select a subset of mixers and find the mixing ratio vector β to obtain a cocktail similar to embedding μ. zero-norm, i.e. number of nonzero entries: induces sparsity match between suggested cocktail and embedding Very hard problem: NP complete Similar to the knapsack problem Moral: determining the quantities in a recipe is easy, constructing a recipe from scratch is hard!

Slide 13

Slide 13 text

Digestif • Cocktails are a fun and interesting topic for data science! • Kernel mean embedding is a promising way of modelling compositional data. • Link to more ‘serious’ applications: growth medium formulation, recipe adaptation, ecosystems management, pharmaceuticals…

Slide 14

Slide 14 text

Tell me more! Warning: you will want to extend your kitchen equipment after reading these…

Slide 15

Slide 15 text

Kernels, you say? Muandet, K., Fukumizu, K., Sriperumbudur, B., & Schölkopf, B. (2017). Kernel mean embedding of distributions: a review and beyond. Foundations and Trends in Machine Learning, 10(1–2), 1–141. Retrieved from https:// arxiv.org/pdf/1605.09522.pdf Kanagawa, M., Hennig, P., Sejdinovic, D., & Sriperumbudur, B. K. (2018). Gaussian Processes and kernel methods: a review on connections and equivalences. Retrieved from http://arxiv.org/abs/1807.02582 Van Hauwermeiren, D., Stock, M., Beer, T. De, & Nopens, I. (2020). Predicting pharmaceutical particle size distributions using kernel mean embedding. Pharmaceutics 2020, Vol. 12, Page 271, 12(3), 271. https://doi.org/10.3390/ PHARMACEUTICS12030271