SlideShare a Scribd company logo
1 of 28
Download to read offline
Automatic Forecasting at Scale
Sean J. Taylor
12 Aug 2015
Joint Statistical Meetings
Many Forecasting Problems at Facebook
• capacity planning: servers, switches, people, even food
• user / advertiser growth
• revenue
• goal setting for teams (with respect to forecast)
• detecting anomalies
• “trending” units
Business Time Series Have Similar Attributes
• comprised by multiple “units”

(e.g. countries, users, advertisers, hardware units)
• units are “born” at different times, can exit the sample
• growth curves are common (e.g. saturating a market)
• complex, human-scale seasonality, holidays and events
• structural breaks as exogenous changes happen

(e.g. new products, redesigns, site outages)
• missing data
Thousands or millions of forecasts?
Mo’ Data,
Mo’ Problems
A second (and third) kind of scale:
many people and problems
Goal is to create technology:
people who are not experts can
use it easily with few decisions
and trust the output
Technology?
Results of my search for forecasting advice
▪ carefully clean, scale, and fix missingness in data
▪ try many kinds of models
▪ use model selection procedures based on (penalized)
goodness-of-fit or just ocular goodness-of-fit
▪ lots of tacit knowledge involved — experienced
forecasters have earned a lot of credibility
Why is building a forecaster harder
than building a classifier?
How most people build a classifier:
1. Choose a loss function.
2. Gather as much data as possible and construct
potentially useful features.
3. Train models using different amounts of regularization.
4. Choose the one that predicts the best out-of-sample
using some cross-validation procedure.
With a flexible enough learner, the only time a human
needs to intervene is during feature construction!
Forecasting as (special) supervised learning
Features
▪ state-features constructed from historical data
▪ time-based features for seasonality, events, etc.
Training
▪ off-the-shelf regularized regression (glmnet, VW)
Model selection
▪ use simulated forecasts to estimate expected loss
When you have a
really awesome
hammer,
make everything
look like a
regularized
regression.
arg min ky X k2
+ 1k k1 + 2k k2
A flexible extrapolation model
Fixed-Horizon Forecasting Regression
Regressors are generated from paste state:
yt+H = f(yt, yt 1, yt 2, . . .)
yt+H = ↵yt +
1
t
tX
i=1
yi
Last Value
Mean Value
State features from one-sided kernel-
weighted statistics
t
Can use any weighted statistic to generate features:
mean, variance, quantiles, etc.
past
data
Assumption: local smoothness
Assume parameters vary smoothly over forecast horizon
(same as assuming forecast is locally smooth).
yt+H = ↵H · yt + H ·
1
t
tX
i=1
yi
Different model
for each horizon
↵H
H0 Max
Horizon
Adding Seasonality Features
Add components to the model that represent deterministic
functions of time:
▪ trend
▪ cyclic cubic splines for yearly seasonality
▪ day-of-week, day-of-year, hour-of-day dummy variables
▪ smooth curves around known holidays
yt+H = f(yt, yt 1, yt 2, . . .) + g(t + H)
t y
1/1 5
1/2 9
1/3 16
t last mean
1/1 - -
1/2 5 5
1/3 9 7
t+H y Mon Tue
1/1 5 1 0
1/2 9 0 1
1/3 14 0 0
State Features
Target +
Time Features
t+H t H y last mean Mon Tues
1/2 1/1 1 5 - - 0 1
1/3 1/1 2 9 - - 0 0
1/3 1/2 1 14 5 5 0 0
Input Data for Training
Series
Making it hierarchical
We want to borrow information about processes across
units. Huge opportunity because:
1. We know more about “new” time series than we think if
we are willing to assume they are generated from a
similar process.
2. The more examples from a family of time series
processes we have, the better we are able to learn about
its structure. Example: stock market.
3. Precision gains from borrowing information.
One weird trick for hierarchical models
Common
Features
United States
Canada
Mexico
Global parameters Unit-specific
yi,t+H = ↵yt +
1
t
tX
i=1
yi + ↵iyt + i
1
t
tX
i=1
yi
Training
▪ BIG DATA: optimization-based techniques are difficult to
use here because
▪ Online learning using SGD/Adagrad/Adadelta work well
here AND we can update parameters for different loss
functions and regularization parameters at the same time.
▪ Other bonus for online learning: incremental learning on
data sorted by time!
Model Selection via
Forward Cross-Validation
We have two sets of hyper-parameters:
1. regularization of the model coefficients.
2. amount of differencing we do before
fitting.
Just like in the classification version of the
problem, we choose the model that
empirically forecasts the best by selecting
K simulated forecast dates.
Training
stream
Testing
stream
Checkpoint
Model
1
2 1
23
Predictive Intervals with Quantile Regression
Very important to quantify uncertainty about a forecast.
Often we’d prefer that people not even look at the point
estimates.
Once you’re in the land of regularized linear regression, we
can get predictive intervals simply by changing loss
function to quantile loss.
Directly optimizing the model for the correct amount of
empirical coverage!
Computational Tricks
▪ online feature scaling
▪ feature hashing
▪ stochastic gradient descent (and Adagrad, Adadelta)
▪ fitting several models simultaneously on the same data
stream
Scaling to More People/Problems
1. Start with a single use-case and nail it.
2. Parameterize that solution — adding new problems
should simple be configuration.
3. Work on model/fitting procedure, then run all previous
models for diagnostics.
4. Provide easy tools for model criticism — top predictive
errors, examples with under/over coverage, etc.
Conclusions
▪ Different kinds of “at scale” — people and problems are
more important than size of data
▪ If a model/technique is hard to use, it’s worth thinking
about what it would take for a non-expert to use it.
▪ Making problems look like regularized linear regression is
GREAT.
▪ Forecasting can be made into a very special kind of
supervised learning.
▪ Email me with comments/feedback: sjt@fb.com

More Related Content

What's hot

Adding research notes to a reference in EndNote Web
Adding research notes to a reference in EndNote WebAdding research notes to a reference in EndNote Web
Adding research notes to a reference in EndNote WebiSkillsTav
 
Chapter 4 Part 2
Chapter 4 Part 2Chapter 4 Part 2
Chapter 4 Part 2hcsc2016
 
Reporting spearman rho in apa
Reporting spearman rho in apaReporting spearman rho in apa
Reporting spearman rho in apaKen Plummer
 
The picot method lo
The picot method loThe picot method lo
The picot method loAmanda Cole
 
Levels of evidence, systematic review and guidelines
Levels of evidence, systematic review and  guidelinesLevels of evidence, systematic review and  guidelines
Levels of evidence, systematic review and guidelinesAboubakr Elnashar
 
A gentle introduction to survival analysis
A gentle introduction to survival analysisA gentle introduction to survival analysis
A gentle introduction to survival analysisAngelo Tinazzi
 
Life Tables & Kaplan-Meier Method.pptx
 Life Tables & Kaplan-Meier Method.pptx Life Tables & Kaplan-Meier Method.pptx
Life Tables & Kaplan-Meier Method.pptxPravin Kolekar
 
Observational descriptive study: case report, case series & ecological study
Observational descriptive study: case report, case series & ecological studyObservational descriptive study: case report, case series & ecological study
Observational descriptive study: case report, case series & ecological studyPrabesh Ghimire
 
Systematic review and meta analaysis course - part 1
Systematic review and meta analaysis course - part 1Systematic review and meta analaysis course - part 1
Systematic review and meta analaysis course - part 1Ahmed Negida
 
What is bias in statistics its definition and types
What is bias in statistics its definition and typesWhat is bias in statistics its definition and types
What is bias in statistics its definition and typesStat Analytica
 
vancouver style of referencing
vancouver style of referencingvancouver style of referencing
vancouver style of referencingRaghu Prasada
 
Quick introduction to critical appraisal of quantitative research
Quick introduction to critical appraisal of quantitative researchQuick introduction to critical appraisal of quantitative research
Quick introduction to critical appraisal of quantitative researchAlan Fricker
 
Types of graphs used in medicine
Types of graphs used in medicineTypes of graphs used in medicine
Types of graphs used in medicineSamir Haffar
 
Findings and disscussion chapters
Findings and disscussion chaptersFindings and disscussion chapters
Findings and disscussion chaptersJAHennessyMurdoch
 
Power Analysis and Sample Size Determination
Power Analysis and Sample Size DeterminationPower Analysis and Sample Size Determination
Power Analysis and Sample Size DeterminationAjay Dhamija
 
Ebdm n concept of critical appraisal
Ebdm n concept of critical appraisalEbdm n concept of critical appraisal
Ebdm n concept of critical appraisalMonali2011
 

What's hot (20)

Adding research notes to a reference in EndNote Web
Adding research notes to a reference in EndNote WebAdding research notes to a reference in EndNote Web
Adding research notes to a reference in EndNote Web
 
Chapter 4 Part 2
Chapter 4 Part 2Chapter 4 Part 2
Chapter 4 Part 2
 
CASP Tool for Qualitative Studies (Sample Answers - September 19 and 27, 2018...
CASP Tool for Qualitative Studies (Sample Answers - September 19 and 27, 2018...CASP Tool for Qualitative Studies (Sample Answers - September 19 and 27, 2018...
CASP Tool for Qualitative Studies (Sample Answers - September 19 and 27, 2018...
 
Reporting spearman rho in apa
Reporting spearman rho in apaReporting spearman rho in apa
Reporting spearman rho in apa
 
The picot method lo
The picot method loThe picot method lo
The picot method lo
 
Grading Strength of Evidence
Grading Strength of EvidenceGrading Strength of Evidence
Grading Strength of Evidence
 
Levels of evidence, systematic review and guidelines
Levels of evidence, systematic review and  guidelinesLevels of evidence, systematic review and  guidelines
Levels of evidence, systematic review and guidelines
 
A gentle introduction to survival analysis
A gentle introduction to survival analysisA gentle introduction to survival analysis
A gentle introduction to survival analysis
 
Life Tables & Kaplan-Meier Method.pptx
 Life Tables & Kaplan-Meier Method.pptx Life Tables & Kaplan-Meier Method.pptx
Life Tables & Kaplan-Meier Method.pptx
 
Observational descriptive study: case report, case series & ecological study
Observational descriptive study: case report, case series & ecological studyObservational descriptive study: case report, case series & ecological study
Observational descriptive study: case report, case series & ecological study
 
Systematic review and meta analaysis course - part 1
Systematic review and meta analaysis course - part 1Systematic review and meta analaysis course - part 1
Systematic review and meta analaysis course - part 1
 
What is bias in statistics its definition and types
What is bias in statistics its definition and typesWhat is bias in statistics its definition and types
What is bias in statistics its definition and types
 
vancouver style of referencing
vancouver style of referencingvancouver style of referencing
vancouver style of referencing
 
Quick introduction to critical appraisal of quantitative research
Quick introduction to critical appraisal of quantitative researchQuick introduction to critical appraisal of quantitative research
Quick introduction to critical appraisal of quantitative research
 
Types of graphs used in medicine
Types of graphs used in medicineTypes of graphs used in medicine
Types of graphs used in medicine
 
Findings and disscussion chapters
Findings and disscussion chaptersFindings and disscussion chapters
Findings and disscussion chapters
 
Epidata lecture note
Epidata lecture note Epidata lecture note
Epidata lecture note
 
Power Analysis and Sample Size Determination
Power Analysis and Sample Size DeterminationPower Analysis and Sample Size Determination
Power Analysis and Sample Size Determination
 
Ebdm n concept of critical appraisal
Ebdm n concept of critical appraisalEbdm n concept of critical appraisal
Ebdm n concept of critical appraisal
 
Bias in Research
Bias in ResearchBias in Research
Bias in Research
 

Similar to Automatic Forecasting at Scale

Online learning with structured streaming, spark summit brussels 2016
Online learning with structured streaming, spark summit brussels 2016Online learning with structured streaming, spark summit brussels 2016
Online learning with structured streaming, spark summit brussels 2016Ram Sriharsha
 
Scaling & Transforming Stitch Fix's Visibility into What Folks will love
Scaling & Transforming Stitch Fix's Visibility into What Folks will loveScaling & Transforming Stitch Fix's Visibility into What Folks will love
Scaling & Transforming Stitch Fix's Visibility into What Folks will loveJune Andrews
 
Time Series Anomaly Detection with .net and Azure
Time Series Anomaly Detection with .net and AzureTime Series Anomaly Detection with .net and Azure
Time Series Anomaly Detection with .net and AzureMarco Parenzan
 
Quantitative Forecasting Techniques in SCM
Quantitative Forecasting Techniques in SCMQuantitative Forecasting Techniques in SCM
Quantitative Forecasting Techniques in SCMYountek1
 
TDC2017 | São Paulo - Trilha Java EE How we figured out we had a SRE team at ...
TDC2017 | São Paulo - Trilha Java EE How we figured out we had a SRE team at ...TDC2017 | São Paulo - Trilha Java EE How we figured out we had a SRE team at ...
TDC2017 | São Paulo - Trilha Java EE How we figured out we had a SRE team at ...tdc-globalcode
 
Predicting Stock Market Price Using Support Vector Regression
Predicting Stock Market Price Using Support Vector RegressionPredicting Stock Market Price Using Support Vector Regression
Predicting Stock Market Price Using Support Vector RegressionChittagong Independent University
 
Release planning using feature points
Release planning using feature pointsRelease planning using feature points
Release planning using feature pointsMadhur Kathuria
 
Misha Bilenko, Principal Researcher, Microsoft at MLconf SEA - 5/01/15
Misha Bilenko, Principal Researcher, Microsoft at MLconf SEA - 5/01/15Misha Bilenko, Principal Researcher, Microsoft at MLconf SEA - 5/01/15
Misha Bilenko, Principal Researcher, Microsoft at MLconf SEA - 5/01/15MLconf
 
Performance OR Capacity #CMGimPACt2016
Performance OR Capacity #CMGimPACt2016 Performance OR Capacity #CMGimPACt2016
Performance OR Capacity #CMGimPACt2016 Alex Gilgur
 
Using Graphs for Feature Engineering_ Graph Reduce-2.pdf
Using Graphs for Feature Engineering_ Graph Reduce-2.pdfUsing Graphs for Feature Engineering_ Graph Reduce-2.pdf
Using Graphs for Feature Engineering_ Graph Reduce-2.pdfWes Madrigal
 
AI Class Topic 3: Building Machine Learning Predictive Systems (Predictive Ma...
AI Class Topic 3: Building Machine Learning Predictive Systems (Predictive Ma...AI Class Topic 3: Building Machine Learning Predictive Systems (Predictive Ma...
AI Class Topic 3: Building Machine Learning Predictive Systems (Predictive Ma...Value Amplify Consulting
 
Demand time series analysis and forecasting
Demand time series analysis and forecastingDemand time series analysis and forecasting
Demand time series analysis and forecastingM Baddar
 
Production-Ready BIG ML Workflows - from zero to hero
Production-Ready BIG ML Workflows - from zero to heroProduction-Ready BIG ML Workflows - from zero to hero
Production-Ready BIG ML Workflows - from zero to heroDaniel Marcous
 
Spark Summit EU talk by Ram Sriharsha and Vlad Feinberg
Spark Summit EU talk by Ram Sriharsha and Vlad FeinbergSpark Summit EU talk by Ram Sriharsha and Vlad Feinberg
Spark Summit EU talk by Ram Sriharsha and Vlad FeinbergSpark Summit
 

Similar to Automatic Forecasting at Scale (20)

Online learning with structured streaming, spark summit brussels 2016
Online learning with structured streaming, spark summit brussels 2016Online learning with structured streaming, spark summit brussels 2016
Online learning with structured streaming, spark summit brussels 2016
 
kdd2015
kdd2015kdd2015
kdd2015
 
Scaling & Transforming Stitch Fix's Visibility into What Folks will love
Scaling & Transforming Stitch Fix's Visibility into What Folks will loveScaling & Transforming Stitch Fix's Visibility into What Folks will love
Scaling & Transforming Stitch Fix's Visibility into What Folks will love
 
presentationIDC - 14MAY2015
presentationIDC - 14MAY2015presentationIDC - 14MAY2015
presentationIDC - 14MAY2015
 
Costing
CostingCosting
Costing
 
Time Series Anomaly Detection with .net and Azure
Time Series Anomaly Detection with .net and AzureTime Series Anomaly Detection with .net and Azure
Time Series Anomaly Detection with .net and Azure
 
Quantitative Forecasting Techniques in SCM
Quantitative Forecasting Techniques in SCMQuantitative Forecasting Techniques in SCM
Quantitative Forecasting Techniques in SCM
 
When Should I Use Simulation?
When Should I Use Simulation?When Should I Use Simulation?
When Should I Use Simulation?
 
TDC2017 | São Paulo - Trilha Java EE How we figured out we had a SRE team at ...
TDC2017 | São Paulo - Trilha Java EE How we figured out we had a SRE team at ...TDC2017 | São Paulo - Trilha Java EE How we figured out we had a SRE team at ...
TDC2017 | São Paulo - Trilha Java EE How we figured out we had a SRE team at ...
 
Predicting Stock Market Price Using Support Vector Regression
Predicting Stock Market Price Using Support Vector RegressionPredicting Stock Market Price Using Support Vector Regression
Predicting Stock Market Price Using Support Vector Regression
 
Release planning using feature points
Release planning using feature pointsRelease planning using feature points
Release planning using feature points
 
Misha Bilenko, Principal Researcher, Microsoft at MLconf SEA - 5/01/15
Misha Bilenko, Principal Researcher, Microsoft at MLconf SEA - 5/01/15Misha Bilenko, Principal Researcher, Microsoft at MLconf SEA - 5/01/15
Misha Bilenko, Principal Researcher, Microsoft at MLconf SEA - 5/01/15
 
Performance OR Capacity #CMGimPACt2016
Performance OR Capacity #CMGimPACt2016 Performance OR Capacity #CMGimPACt2016
Performance OR Capacity #CMGimPACt2016
 
Sap Analytics Cloud
Sap Analytics CloudSap Analytics Cloud
Sap Analytics Cloud
 
Using Graphs for Feature Engineering_ Graph Reduce-2.pdf
Using Graphs for Feature Engineering_ Graph Reduce-2.pdfUsing Graphs for Feature Engineering_ Graph Reduce-2.pdf
Using Graphs for Feature Engineering_ Graph Reduce-2.pdf
 
AI Class Topic 3: Building Machine Learning Predictive Systems (Predictive Ma...
AI Class Topic 3: Building Machine Learning Predictive Systems (Predictive Ma...AI Class Topic 3: Building Machine Learning Predictive Systems (Predictive Ma...
AI Class Topic 3: Building Machine Learning Predictive Systems (Predictive Ma...
 
Demand time series analysis and forecasting
Demand time series analysis and forecastingDemand time series analysis and forecasting
Demand time series analysis and forecasting
 
Analytics
AnalyticsAnalytics
Analytics
 
Production-Ready BIG ML Workflows - from zero to hero
Production-Ready BIG ML Workflows - from zero to heroProduction-Ready BIG ML Workflows - from zero to hero
Production-Ready BIG ML Workflows - from zero to hero
 
Spark Summit EU talk by Ram Sriharsha and Vlad Feinberg
Spark Summit EU talk by Ram Sriharsha and Vlad FeinbergSpark Summit EU talk by Ram Sriharsha and Vlad Feinberg
Spark Summit EU talk by Ram Sriharsha and Vlad Feinberg
 

Recently uploaded

Customer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxCustomer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxEmmanuel Dauda
 
CebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxCebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxolyaivanovalion
 
Unveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data AnalystUnveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data AnalystSamantha Rae Coolbeth
 
RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998YohFuh
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfMarinCaroMartnezBerg
 
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
Dubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls DubaiDubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls Dubaihf8803863
 
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service AmravatiVIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service AmravatiSuhani Kapoor
 
BigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxBigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxolyaivanovalion
 
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxMature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxolyaivanovalion
 
Introduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptxIntroduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptxfirstjob4
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAroojKhan71
 
Schema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfSchema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfLars Albertsson
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxolyaivanovalion
 
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /WhatsappsBeautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsappssapnasaifi408
 
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130Suhani Kapoor
 
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
Industrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfIndustrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfLars Albertsson
 
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfMarket Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfRachmat Ramadhan H
 

Recently uploaded (20)

Customer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxCustomer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptx
 
CebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxCebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptx
 
Unveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data AnalystUnveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data Analyst
 
E-Commerce Order PredictionShraddha Kamble.pptx
E-Commerce Order PredictionShraddha Kamble.pptxE-Commerce Order PredictionShraddha Kamble.pptx
E-Commerce Order PredictionShraddha Kamble.pptx
 
RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdf
 
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
Dubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls DubaiDubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls Dubai
 
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service AmravatiVIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
 
BigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxBigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptx
 
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxMature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptx
 
Introduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptxIntroduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptx
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
 
Schema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfSchema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdf
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFx
 
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /WhatsappsBeautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
 
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
 
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
 
Industrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfIndustrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdf
 
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfMarket Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
 

Automatic Forecasting at Scale

  • 1. Automatic Forecasting at Scale Sean J. Taylor 12 Aug 2015 Joint Statistical Meetings
  • 2.
  • 3. Many Forecasting Problems at Facebook • capacity planning: servers, switches, people, even food • user / advertiser growth • revenue • goal setting for teams (with respect to forecast) • detecting anomalies • “trending” units
  • 4. Business Time Series Have Similar Attributes • comprised by multiple “units”
 (e.g. countries, users, advertisers, hardware units) • units are “born” at different times, can exit the sample • growth curves are common (e.g. saturating a market) • complex, human-scale seasonality, holidays and events • structural breaks as exogenous changes happen
 (e.g. new products, redesigns, site outages) • missing data
  • 5. Thousands or millions of forecasts?
  • 7. A second (and third) kind of scale: many people and problems
  • 8. Goal is to create technology: people who are not experts can use it easily with few decisions and trust the output
  • 10. Results of my search for forecasting advice ▪ carefully clean, scale, and fix missingness in data ▪ try many kinds of models ▪ use model selection procedures based on (penalized) goodness-of-fit or just ocular goodness-of-fit ▪ lots of tacit knowledge involved — experienced forecasters have earned a lot of credibility
  • 11. Why is building a forecaster harder than building a classifier?
  • 12. How most people build a classifier: 1. Choose a loss function. 2. Gather as much data as possible and construct potentially useful features. 3. Train models using different amounts of regularization. 4. Choose the one that predicts the best out-of-sample using some cross-validation procedure. With a flexible enough learner, the only time a human needs to intervene is during feature construction!
  • 13. Forecasting as (special) supervised learning Features ▪ state-features constructed from historical data ▪ time-based features for seasonality, events, etc. Training ▪ off-the-shelf regularized regression (glmnet, VW) Model selection ▪ use simulated forecasts to estimate expected loss
  • 14. When you have a really awesome hammer, make everything look like a regularized regression. arg min ky X k2 + 1k k1 + 2k k2
  • 16. Fixed-Horizon Forecasting Regression Regressors are generated from paste state: yt+H = f(yt, yt 1, yt 2, . . .) yt+H = ↵yt + 1 t tX i=1 yi Last Value Mean Value
  • 17. State features from one-sided kernel- weighted statistics t Can use any weighted statistic to generate features: mean, variance, quantiles, etc. past data
  • 18. Assumption: local smoothness Assume parameters vary smoothly over forecast horizon (same as assuming forecast is locally smooth). yt+H = ↵H · yt + H · 1 t tX i=1 yi Different model for each horizon ↵H H0 Max Horizon
  • 19. Adding Seasonality Features Add components to the model that represent deterministic functions of time: ▪ trend ▪ cyclic cubic splines for yearly seasonality ▪ day-of-week, day-of-year, hour-of-day dummy variables ▪ smooth curves around known holidays yt+H = f(yt, yt 1, yt 2, . . .) + g(t + H)
  • 20. t y 1/1 5 1/2 9 1/3 16 t last mean 1/1 - - 1/2 5 5 1/3 9 7 t+H y Mon Tue 1/1 5 1 0 1/2 9 0 1 1/3 14 0 0 State Features Target + Time Features t+H t H y last mean Mon Tues 1/2 1/1 1 5 - - 0 1 1/3 1/1 2 9 - - 0 0 1/3 1/2 1 14 5 5 0 0 Input Data for Training Series
  • 21. Making it hierarchical We want to borrow information about processes across units. Huge opportunity because: 1. We know more about “new” time series than we think if we are willing to assume they are generated from a similar process. 2. The more examples from a family of time series processes we have, the better we are able to learn about its structure. Example: stock market. 3. Precision gains from borrowing information.
  • 22. One weird trick for hierarchical models Common Features United States Canada Mexico Global parameters Unit-specific yi,t+H = ↵yt + 1 t tX i=1 yi + ↵iyt + i 1 t tX i=1 yi
  • 23. Training ▪ BIG DATA: optimization-based techniques are difficult to use here because ▪ Online learning using SGD/Adagrad/Adadelta work well here AND we can update parameters for different loss functions and regularization parameters at the same time. ▪ Other bonus for online learning: incremental learning on data sorted by time!
  • 24. Model Selection via Forward Cross-Validation We have two sets of hyper-parameters: 1. regularization of the model coefficients. 2. amount of differencing we do before fitting. Just like in the classification version of the problem, we choose the model that empirically forecasts the best by selecting K simulated forecast dates. Training stream Testing stream Checkpoint Model 1 2 1 23
  • 25. Predictive Intervals with Quantile Regression Very important to quantify uncertainty about a forecast. Often we’d prefer that people not even look at the point estimates. Once you’re in the land of regularized linear regression, we can get predictive intervals simply by changing loss function to quantile loss. Directly optimizing the model for the correct amount of empirical coverage!
  • 26. Computational Tricks ▪ online feature scaling ▪ feature hashing ▪ stochastic gradient descent (and Adagrad, Adadelta) ▪ fitting several models simultaneously on the same data stream
  • 27. Scaling to More People/Problems 1. Start with a single use-case and nail it. 2. Parameterize that solution — adding new problems should simple be configuration. 3. Work on model/fitting procedure, then run all previous models for diagnostics. 4. Provide easy tools for model criticism — top predictive errors, examples with under/over coverage, etc.
  • 28. Conclusions ▪ Different kinds of “at scale” — people and problems are more important than size of data ▪ If a model/technique is hard to use, it’s worth thinking about what it would take for a non-expert to use it. ▪ Making problems look like regularized linear regression is GREAT. ▪ Forecasting can be made into a very special kind of supervised learning. ▪ Email me with comments/feedback: sjt@fb.com