Upgrade to Pro — share decks privately, control downloads, hide ads and more …

A drunkard’s walk in the science of cocktails

A drunkard’s walk in the science of cocktails

An introduction to the science and data science of cocktails, including the fundamental law of cocktail making and kernel method for kernels.

Michiel Stock

May 14, 2020
Tweet

More Decks by Michiel Stock

Other Decks in Science

Transcript

  1. A DRUNKARD’S WALK IN THE SCIENCE OF COCKTAILS Photo by

    Helena Yankovska on Unsplash Michiel Stock @michielstock michielfmstock@gmailcom KERMIT
  2. 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?
  3. 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)
  4. 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
  5. β = [β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
  6. - 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
  7. 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
  8. 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
  9. 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!
  10. 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…
  11. Tell me more! Warning: you will want to extend your

    kitchen equipment after reading these…
  12. 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