automating inventory at stitch fix - qcon new york · automating inventory at stitch fix using beta...
TRANSCRIPT
![Page 1: Automating Inventory at Stitch Fix - QCon New York · Automating Inventory at Stitch Fix Using Beta Binomial Regression for Cold Start Problems Sally Langford - Data Scientist](https://reader030.vdocuments.mx/reader030/viewer/2022041022/5ed39d31a6e11e2c6714deb8/html5/thumbnails/1.jpg)
Automating Inventory at Stitch FixUsing Beta Binomial Regression for Cold Start Problems
Sally Langford - Data Scientist
![Page 2: Automating Inventory at Stitch Fix - QCon New York · Automating Inventory at Stitch Fix Using Beta Binomial Regression for Cold Start Problems Sally Langford - Data Scientist](https://reader030.vdocuments.mx/reader030/viewer/2022041022/5ed39d31a6e11e2c6714deb8/html5/thumbnails/2.jpg)
How Stitch Fix works:
![Page 3: Automating Inventory at Stitch Fix - QCon New York · Automating Inventory at Stitch Fix Using Beta Binomial Regression for Cold Start Problems Sally Langford - Data Scientist](https://reader030.vdocuments.mx/reader030/viewer/2022041022/5ed39d31a6e11e2c6714deb8/html5/thumbnails/3.jpg)
- Tell us about your style, fit and price preferences.
How Stitch Fix works:
![Page 4: Automating Inventory at Stitch Fix - QCon New York · Automating Inventory at Stitch Fix Using Beta Binomial Regression for Cold Start Problems Sally Langford - Data Scientist](https://reader030.vdocuments.mx/reader030/viewer/2022041022/5ed39d31a6e11e2c6714deb8/html5/thumbnails/4.jpg)
- Tell us about your style, fit and price preferences.- A personal stylist will curate five pieces for you.
How Stitch Fix works:
![Page 5: Automating Inventory at Stitch Fix - QCon New York · Automating Inventory at Stitch Fix Using Beta Binomial Regression for Cold Start Problems Sally Langford - Data Scientist](https://reader030.vdocuments.mx/reader030/viewer/2022041022/5ed39d31a6e11e2c6714deb8/html5/thumbnails/5.jpg)
- Tell us about your style, fit and price preferences.- A personal stylist will curate five pieces for you.- Try all the items on at home.
How Stitch Fix works:
![Page 6: Automating Inventory at Stitch Fix - QCon New York · Automating Inventory at Stitch Fix Using Beta Binomial Regression for Cold Start Problems Sally Langford - Data Scientist](https://reader030.vdocuments.mx/reader030/viewer/2022041022/5ed39d31a6e11e2c6714deb8/html5/thumbnails/6.jpg)
- Tell us about your style, fit and price preferences.- A personal stylist will curate five pieces for you.- Try all the items on at home.- Give your stylist feedback on all items, then only pay for what you keep.
How Stitch Fix works:
![Page 7: Automating Inventory at Stitch Fix - QCon New York · Automating Inventory at Stitch Fix Using Beta Binomial Regression for Cold Start Problems Sally Langford - Data Scientist](https://reader030.vdocuments.mx/reader030/viewer/2022041022/5ed39d31a6e11e2c6714deb8/html5/thumbnails/7.jpg)
- Tell us about your style, fit and price preferences.- A personal stylist will curate five pieces for you.- Try all the items on at home.- Give your stylist feedback on all items, then only pay for what you keep.- Return the other items in envelope provided.
How Stitch Fix works:
![Page 8: Automating Inventory at Stitch Fix - QCon New York · Automating Inventory at Stitch Fix Using Beta Binomial Regression for Cold Start Problems Sally Langford - Data Scientist](https://reader030.vdocuments.mx/reader030/viewer/2022041022/5ed39d31a6e11e2c6714deb8/html5/thumbnails/8.jpg)
Benefits of Machine Learning in Inventory Management:
- Scalable with business.- Rapid reforecasting.- Capture nonlinear relationships.- Cold start problems.
![Page 9: Automating Inventory at Stitch Fix - QCon New York · Automating Inventory at Stitch Fix Using Beta Binomial Regression for Cold Start Problems Sally Langford - Data Scientist](https://reader030.vdocuments.mx/reader030/viewer/2022041022/5ed39d31a6e11e2c6714deb8/html5/thumbnails/9.jpg)
time
number of units
order arrives in warehouse
shirt is sent to clients and is sold
plaid shirt
![Page 10: Automating Inventory at Stitch Fix - QCon New York · Automating Inventory at Stitch Fix Using Beta Binomial Regression for Cold Start Problems Sally Langford - Data Scientist](https://reader030.vdocuments.mx/reader030/viewer/2022041022/5ed39d31a6e11e2c6714deb8/html5/thumbnails/10.jpg)
timeorder arrives in warehouse
shirt is sent to clients and is sold
plaid shirt
number of units
![Page 11: Automating Inventory at Stitch Fix - QCon New York · Automating Inventory at Stitch Fix Using Beta Binomial Regression for Cold Start Problems Sally Langford - Data Scientist](https://reader030.vdocuments.mx/reader030/viewer/2022041022/5ed39d31a6e11e2c6714deb8/html5/thumbnails/11.jpg)
Inventory consumption of a style is proportional to;
- daily demand,
- clients for which the style is recommended,
- whether there are units in the warehouse,
- probability a stylist chooses to send the client this style,
- if the client buys the style.
![Page 12: Automating Inventory at Stitch Fix - QCon New York · Automating Inventory at Stitch Fix Using Beta Binomial Regression for Cold Start Problems Sally Langford - Data Scientist](https://reader030.vdocuments.mx/reader030/viewer/2022041022/5ed39d31a6e11e2c6714deb8/html5/thumbnails/12.jpg)
Inventory consumption of a style is proportional to;
- daily demand,
- clients for which the style is recommended,
- whether there are units in the warehouse,
- probability a stylist chooses to send the client this style,
- if the client buys the style.
![Page 13: Automating Inventory at Stitch Fix - QCon New York · Automating Inventory at Stitch Fix Using Beta Binomial Regression for Cold Start Problems Sally Langford - Data Scientist](https://reader030.vdocuments.mx/reader030/viewer/2022041022/5ed39d31a6e11e2c6714deb8/html5/thumbnails/13.jpg)
Inventory consumption of a style is proportional to;
- daily demand,
- clients for which the style is recommended,
- whether there are units in the warehouse,
- probability a stylist chooses to send the client this style,
- if the client buys the style.
![Page 14: Automating Inventory at Stitch Fix - QCon New York · Automating Inventory at Stitch Fix Using Beta Binomial Regression for Cold Start Problems Sally Langford - Data Scientist](https://reader030.vdocuments.mx/reader030/viewer/2022041022/5ed39d31a6e11e2c6714deb8/html5/thumbnails/14.jpg)
Ranked styles recommended for client - which will the stylist choose to send?
![Page 15: Automating Inventory at Stitch Fix - QCon New York · Automating Inventory at Stitch Fix Using Beta Binomial Regression for Cold Start Problems Sally Langford - Data Scientist](https://reader030.vdocuments.mx/reader030/viewer/2022041022/5ed39d31a6e11e2c6714deb8/html5/thumbnails/15.jpg)
Ranked styles recommended for client - which will the stylist choose to send?
![Page 16: Automating Inventory at Stitch Fix - QCon New York · Automating Inventory at Stitch Fix Using Beta Binomial Regression for Cold Start Problems Sally Langford - Data Scientist](https://reader030.vdocuments.mx/reader030/viewer/2022041022/5ed39d31a6e11e2c6714deb8/html5/thumbnails/16.jpg)
Ranked styles recommended for client - which will the stylist choose to send?
![Page 17: Automating Inventory at Stitch Fix - QCon New York · Automating Inventory at Stitch Fix Using Beta Binomial Regression for Cold Start Problems Sally Langford - Data Scientist](https://reader030.vdocuments.mx/reader030/viewer/2022041022/5ed39d31a6e11e2c6714deb8/html5/thumbnails/17.jpg)
Ranked styles recommended for client - which will the stylist choose to send?
![Page 18: Automating Inventory at Stitch Fix - QCon New York · Automating Inventory at Stitch Fix Using Beta Binomial Regression for Cold Start Problems Sally Langford - Data Scientist](https://reader030.vdocuments.mx/reader030/viewer/2022041022/5ed39d31a6e11e2c6714deb8/html5/thumbnails/18.jpg)
Ranked styles recommended for client - which will the stylist choose to send?
![Page 19: Automating Inventory at Stitch Fix - QCon New York · Automating Inventory at Stitch Fix Using Beta Binomial Regression for Cold Start Problems Sally Langford - Data Scientist](https://reader030.vdocuments.mx/reader030/viewer/2022041022/5ed39d31a6e11e2c6714deb8/html5/thumbnails/19.jpg)
plaid long-sleeve shirt
![Page 20: Automating Inventory at Stitch Fix - QCon New York · Automating Inventory at Stitch Fix Using Beta Binomial Regression for Cold Start Problems Sally Langford - Data Scientist](https://reader030.vdocuments.mx/reader030/viewer/2022041022/5ed39d31a6e11e2c6714deb8/html5/thumbnails/20.jpg)
?
plaid long-sleeve shirt
![Page 21: Automating Inventory at Stitch Fix - QCon New York · Automating Inventory at Stitch Fix Using Beta Binomial Regression for Cold Start Problems Sally Langford - Data Scientist](https://reader030.vdocuments.mx/reader030/viewer/2022041022/5ed39d31a6e11e2c6714deb8/html5/thumbnails/21.jpg)
plaid long-sleeve shirt
![Page 22: Automating Inventory at Stitch Fix - QCon New York · Automating Inventory at Stitch Fix Using Beta Binomial Regression for Cold Start Problems Sally Langford - Data Scientist](https://reader030.vdocuments.mx/reader030/viewer/2022041022/5ed39d31a6e11e2c6714deb8/html5/thumbnails/22.jpg)
plaid long-sleeve shirt
![Page 23: Automating Inventory at Stitch Fix - QCon New York · Automating Inventory at Stitch Fix Using Beta Binomial Regression for Cold Start Problems Sally Langford - Data Scientist](https://reader030.vdocuments.mx/reader030/viewer/2022041022/5ed39d31a6e11e2c6714deb8/html5/thumbnails/23.jpg)
...
plaid long-sleeve shirt
![Page 24: Automating Inventory at Stitch Fix - QCon New York · Automating Inventory at Stitch Fix Using Beta Binomial Regression for Cold Start Problems Sally Langford - Data Scientist](https://reader030.vdocuments.mx/reader030/viewer/2022041022/5ed39d31a6e11e2c6714deb8/html5/thumbnails/24.jpg)
...
P(chosen) + P(not chosen) = 1
plaid long-sleeve shirt
![Page 25: Automating Inventory at Stitch Fix - QCon New York · Automating Inventory at Stitch Fix Using Beta Binomial Regression for Cold Start Problems Sally Langford - Data Scientist](https://reader030.vdocuments.mx/reader030/viewer/2022041022/5ed39d31a6e11e2c6714deb8/html5/thumbnails/25.jpg)
?
...plaid long-sleeve shirt
blue long-sleeve shirt
![Page 26: Automating Inventory at Stitch Fix - QCon New York · Automating Inventory at Stitch Fix Using Beta Binomial Regression for Cold Start Problems Sally Langford - Data Scientist](https://reader030.vdocuments.mx/reader030/viewer/2022041022/5ed39d31a6e11e2c6714deb8/html5/thumbnails/26.jpg)
![Page 27: Automating Inventory at Stitch Fix - QCon New York · Automating Inventory at Stitch Fix Using Beta Binomial Regression for Cold Start Problems Sally Langford - Data Scientist](https://reader030.vdocuments.mx/reader030/viewer/2022041022/5ed39d31a6e11e2c6714deb8/html5/thumbnails/27.jpg)
Prior Beliefs
![Page 28: Automating Inventory at Stitch Fix - QCon New York · Automating Inventory at Stitch Fix Using Beta Binomial Regression for Cold Start Problems Sally Langford - Data Scientist](https://reader030.vdocuments.mx/reader030/viewer/2022041022/5ed39d31a6e11e2c6714deb8/html5/thumbnails/28.jpg)
Prior Beliefs
Evidence
![Page 29: Automating Inventory at Stitch Fix - QCon New York · Automating Inventory at Stitch Fix Using Beta Binomial Regression for Cold Start Problems Sally Langford - Data Scientist](https://reader030.vdocuments.mx/reader030/viewer/2022041022/5ed39d31a6e11e2c6714deb8/html5/thumbnails/29.jpg)
Prior Beliefs
Posterior Beliefs
Evidence
![Page 30: Automating Inventory at Stitch Fix - QCon New York · Automating Inventory at Stitch Fix Using Beta Binomial Regression for Cold Start Problems Sally Langford - Data Scientist](https://reader030.vdocuments.mx/reader030/viewer/2022041022/5ed39d31a6e11e2c6714deb8/html5/thumbnails/30.jpg)
N ~ Binom(Nav
, p)
![Page 31: Automating Inventory at Stitch Fix - QCon New York · Automating Inventory at Stitch Fix Using Beta Binomial Regression for Cold Start Problems Sally Langford - Data Scientist](https://reader030.vdocuments.mx/reader030/viewer/2022041022/5ed39d31a6e11e2c6714deb8/html5/thumbnails/31.jpg)
N ~ Binom(Nav
, p)
![Page 32: Automating Inventory at Stitch Fix - QCon New York · Automating Inventory at Stitch Fix Using Beta Binomial Regression for Cold Start Problems Sally Langford - Data Scientist](https://reader030.vdocuments.mx/reader030/viewer/2022041022/5ed39d31a6e11e2c6714deb8/html5/thumbnails/32.jpg)
N ~ Binom(Nav
, p)
p ~ B(α, β)
![Page 33: Automating Inventory at Stitch Fix - QCon New York · Automating Inventory at Stitch Fix Using Beta Binomial Regression for Cold Start Problems Sally Langford - Data Scientist](https://reader030.vdocuments.mx/reader030/viewer/2022041022/5ed39d31a6e11e2c6714deb8/html5/thumbnails/33.jpg)
B(α’, β’) = B(α0 + k, β
0 + n - k)
![Page 34: Automating Inventory at Stitch Fix - QCon New York · Automating Inventory at Stitch Fix Using Beta Binomial Regression for Cold Start Problems Sally Langford - Data Scientist](https://reader030.vdocuments.mx/reader030/viewer/2022041022/5ed39d31a6e11e2c6714deb8/html5/thumbnails/34.jpg)
B(α’, β’) = B(α0 + k, β
0 + n - k)
![Page 35: Automating Inventory at Stitch Fix - QCon New York · Automating Inventory at Stitch Fix Using Beta Binomial Regression for Cold Start Problems Sally Langford - Data Scientist](https://reader030.vdocuments.mx/reader030/viewer/2022041022/5ed39d31a6e11e2c6714deb8/html5/thumbnails/35.jpg)
Step 1: Use maximum likelihood to calculate α0 and β
0 for the distribution of p in
groups of similar styles.
Step 2: After a period of time, update this prior for the number of times the new style has been recommended for a client (n), and chosen to be sent (k).
Step 3: Calculate the mean and confidence interval of p from the resulting distribution. This is used as the probability that the new style will be chosen to be sent to a client.
Step 4: Repeat steps 2-3.
![Page 36: Automating Inventory at Stitch Fix - QCon New York · Automating Inventory at Stitch Fix Using Beta Binomial Regression for Cold Start Problems Sally Langford - Data Scientist](https://reader030.vdocuments.mx/reader030/viewer/2022041022/5ed39d31a6e11e2c6714deb8/html5/thumbnails/36.jpg)
VGAM (in python):import rpy2.robjects as robjectsrobjects.r.library("VGAM")robjects.r("fit = vglm(cbind(successData,trialData - successData) ~ 1,
betabinomialff, trace=TRUE)")alpha, beta = robjects.r("Coef(fit)")
import scipyfit = scipy.stats.beta.fit(data, floc=0, fscale=1)alpha, beta = fit[0], fit[1]
---
result = scipy.optimize.minimize(loss_function, p0, jac=True, **kwargs)
![Page 37: Automating Inventory at Stitch Fix - QCon New York · Automating Inventory at Stitch Fix Using Beta Binomial Regression for Cold Start Problems Sally Langford - Data Scientist](https://reader030.vdocuments.mx/reader030/viewer/2022041022/5ed39d31a6e11e2c6714deb8/html5/thumbnails/37.jpg)
Data Storage
Job Scheduler
SQL Engine
SQL EngineHive Metastore
Flotilla: Auto scaling cluster
Job server for Spark cluster
Data Scientist Code
![Page 38: Automating Inventory at Stitch Fix - QCon New York · Automating Inventory at Stitch Fix Using Beta Binomial Regression for Cold Start Problems Sally Langford - Data Scientist](https://reader030.vdocuments.mx/reader030/viewer/2022041022/5ed39d31a6e11e2c6714deb8/html5/thumbnails/38.jpg)
![Page 39: Automating Inventory at Stitch Fix - QCon New York · Automating Inventory at Stitch Fix Using Beta Binomial Regression for Cold Start Problems Sally Langford - Data Scientist](https://reader030.vdocuments.mx/reader030/viewer/2022041022/5ed39d31a6e11e2c6714deb8/html5/thumbnails/39.jpg)
Top 5 recommendations for client D
Top 5 recommendations for client C
Top 5 recommendations for client B
Top 5 recommendations for client A
Top 5 recommendations for client E
![Page 40: Automating Inventory at Stitch Fix - QCon New York · Automating Inventory at Stitch Fix Using Beta Binomial Regression for Cold Start Problems Sally Langford - Data Scientist](https://reader030.vdocuments.mx/reader030/viewer/2022041022/5ed39d31a6e11e2c6714deb8/html5/thumbnails/40.jpg)
B(α , β ) = B(μ/σ, (1 - μ)/σ)
μ
σ
![Page 41: Automating Inventory at Stitch Fix - QCon New York · Automating Inventory at Stitch Fix Using Beta Binomial Regression for Cold Start Problems Sally Langford - Data Scientist](https://reader030.vdocuments.mx/reader030/viewer/2022041022/5ed39d31a6e11e2c6714deb8/html5/thumbnails/41.jpg)
μ = μ0 + μ
n log(1 + n)
![Page 42: Automating Inventory at Stitch Fix - QCon New York · Automating Inventory at Stitch Fix Using Beta Binomial Regression for Cold Start Problems Sally Langford - Data Scientist](https://reader030.vdocuments.mx/reader030/viewer/2022041022/5ed39d31a6e11e2c6714deb8/html5/thumbnails/42.jpg)
number of units
timenow planned ordersnew styles
![Page 43: Automating Inventory at Stitch Fix - QCon New York · Automating Inventory at Stitch Fix Using Beta Binomial Regression for Cold Start Problems Sally Langford - Data Scientist](https://reader030.vdocuments.mx/reader030/viewer/2022041022/5ed39d31a6e11e2c6714deb8/html5/thumbnails/43.jpg)
number of units
timenow
forecasted units
planned ordersnew styles
![Page 44: Automating Inventory at Stitch Fix - QCon New York · Automating Inventory at Stitch Fix Using Beta Binomial Regression for Cold Start Problems Sally Langford - Data Scientist](https://reader030.vdocuments.mx/reader030/viewer/2022041022/5ed39d31a6e11e2c6714deb8/html5/thumbnails/44.jpg)
How do we use our inventory forecast model?
- When should we re-order inventory?
- How should we buy inventory by size?
- How should orders be separated into different warehouses?
- When should a style not be sent out anymore, in place of a new option?
![Page 45: Automating Inventory at Stitch Fix - QCon New York · Automating Inventory at Stitch Fix Using Beta Binomial Regression for Cold Start Problems Sally Langford - Data Scientist](https://reader030.vdocuments.mx/reader030/viewer/2022041022/5ed39d31a6e11e2c6714deb8/html5/thumbnails/45.jpg)
Metrics of success:
- Fraction of inventory out with clients compared to in the warehouse?
- How many styles are available to send to a client?
- ∆ in the beginning of month projected units.
- Cumulative units sold over time.
![Page 46: Automating Inventory at Stitch Fix - QCon New York · Automating Inventory at Stitch Fix Using Beta Binomial Regression for Cold Start Problems Sally Langford - Data Scientist](https://reader030.vdocuments.mx/reader030/viewer/2022041022/5ed39d31a6e11e2c6714deb8/html5/thumbnails/46.jpg)
Do you want to calculate the probability of success in a binomial process?
Not enough data?
Use Beta Binomial Regression for your cold start problem!
![Page 47: Automating Inventory at Stitch Fix - QCon New York · Automating Inventory at Stitch Fix Using Beta Binomial Regression for Cold Start Problems Sally Langford - Data Scientist](https://reader030.vdocuments.mx/reader030/viewer/2022041022/5ed39d31a6e11e2c6714deb8/html5/thumbnails/47.jpg)
Stitch Fix
Algorithms Blog
Algorithms Tour
@stitchfix_algo