Drink Worthy Data

Exploring the Iowa Liquor Sales data set.

Exploratory data analysis

Taking a closer look at the data

Who drinks the most?

Who are the top 10 vendors in Iowa?

ID Sales (Millions of $) Vendor
260 307.54 Diageo Americas
370 103.29 Pernod Ricard USA/Austin Nichols
65 100.22 Jim Beam Brands
434 96.61 Luxco-St Louis
115 85.89 “Constellation Wine Company, Inc.”
85 80.92 Brown-Forman Corporation
421 79.48 “Sazerac Co., Inc.”
35 67.17 “Bacardi U.S.A., Inc.”
395 47.44 Proximo
55 46.03 Sazerac North America

What are Jim Beam’s top selling liquors?

Item ID Sales (Millions of $) Vendor ID Item Volume (ml)
19068 5.39 65 Jim Beam 1750
19067 4.9 65 Jim Beam 1000
34578 4.33 65 Pinnacle Vodka 1750
15248 3.97 65 Windsor Canadian Pet 1750
19066 3.9 65 Jim Beam 750
19476 3.88 65 Maker’s Mark 750
19477 3.82 65 Maker’s Mark 1000
24458 3.26 65 Kessler Blend Whiskey 1750
82847 3.09 65 Dekuyper Peachtree 1000
10628 2.63 65 Canadian Club Whisky 1750

What is the price-response for Jim Beam 1750ml?

Log-log price-response?

Taking a closer look at demand (our response)

How has demand for Jim Beam 1750ml varied over time?

How has change in demand varied over time?

Comparing demand, % change, and log diff distributions.

How has demand varied month-to-month?

How has change in demand varied month-to-month?

Taking a closer look at price (our predictor)

How has price for Jim Beam 1750ml varied over time?

How has change in price varied over time?

Comparing price, % change, and log diff distributions.

How has price varied month-to-month?

How has change in price varied month-to-month?

Developing a demand model

Modeling approach

We take month (one hot encoded) and log price as our features or predictors.  We take log demand as our response.  Then we fit a regression model using linear least squares with L2 regularization (i.e. ridge regression).

Hyperparameter tuning

Residual analysis

Error

RMSE Mean = 779 Bottles

Inferring seasonality and price elasticity

Seasonality coefficients

Price elasticity coefficient

Price Elasticity of Demand (PED) = -0.02

PED = % Change in Quantity Demanded / % Change in Price

Therefore,

% Change in Quantity Demanded = PED x % Change in Price

So a +1% change in price will only result in a (-0.02) x 1% = -0.02% change in demand (very inelastic).

Therefore, it’s no wonder Jim Beam has continued to raise prices and stopped offering promotions all together in 2016.

Optimizing promotions to maximize profit

Profit curves

Primer on Binary Classification or Answering Yes/No Questions with Machine Learning

Binary classification

The goal of binary classification is to put objects into one of two categories based on a set of attributes. For example, a credit card company may wish to categorize a transaction as legitimate or fraudulent based on the amount and location of the transaction. This is an example of binary classification since there are two categories, legitimate and fraudulent, a transaction can be classified as. A couple other popular examples of binary classification include spam detection and medical fraud detection.

The goal of binary classification is to put objects into one of two categories based on a set of attributes.

Continue reading