SlideShare a Scribd company logo
1 of 15
Comparing Classical and Machine Learning Algorithms
for Time Series Forecasting
Yifan Wang
Time series forecast problem can be
multivariate, LSTMs can be used to model
univariate and multivariate time series
forecasting problems.
LSTM Neural network
Sales forecasting is one of the most
fundamental and common analytics need
for business. By accurately estimating
future sales, companies to make informed
business decisions and predict short-term
and long-term performance.
Sales Forecasting
Classical Method
Simple Feed-forward Neural Network
1
Table of Content
Exponential smoothing and autoregressive
integrated moving average (ARIMA) are
most common methods for univariate time
series.
In this comparison, we use nnetar() function
from forecast package in R.
Feed-forward neural networks with a single
hidden layer and lagged inputs for forecasting
univariate time series.
2
Measurement
Gross Sales & Net Sales
Challenges
The Return & Net Sales
Objectives
Forecast future 12 Month
Product Categories
Digital & Traditional
Sales Forecasting: The Time Series Data
In this example, we have a monthly sales
data from a business sell their products
via distributors. (Gross Sales)
For this industry, the distributors can
also return unsold products within a
negotiated time frame:
Gross Sales – Return = Net Sales
There are two products: the new
emerging Digital Product and the legacy
Traditional Product.
From the historical data, we can see
these two products perform differently
for past 10 years.
Because of the nature of industry, the
gross sales for both product categories
have very stable seasonality.
However, because of the return, the net
sales are more challenging to forecast.
The objective is to forecast the sales of
future two years and also the remaining
month of the current year.
e
Digital Product Gross Sales Traditional Product Gross Sales
Digital Product Net Sales Traditional Product Net Sales
3
Digital Product Gross Sales Forecast Traditional Product Gross Sales Forecast
Digital Product Net Sales Forecast Traditional Product Net Sales Forecast
Classic Method: ETS Model
Model Fitted vs Actual Model Fitted vs Actual
4
Digital Product Gross Sales Forecast Traditional Product Gross Sales Forecast
Digital Product Net Sales Forecast Traditional Product Net Sales Forecast
Classic Method: ARIMA Model
Model Fitted vs Actual Model Fitted vs Actual
5
Digital Product Gross Sales Forecast Traditional Product Gross Sales Forecast
Digital Product Net Sales Forecast Traditional Product Net Sales Forecast
Machine Learning Algorithms : Feedforward Neural Network
Model Fitted vs Actual Model Fitted vs Actual
Traditional
Gross Sales
Traditional
Net Sales
Digital
Gross Sales
Digital Net
Sales
ME -637038.10 -1770053.00 -380326.10 -155923.20
RMSE 7485097.00 11024208.00 4418118.00 5084155.00
MAE 4894202.00 8021170.00 3061446.00 3741741.00
MPE -3.34 61.18 -2.27 -1.76
MAPE 10.35 110.42 13.21 58.16
ACF1 -0.18 0.15 0.02 0.18
6
14.57 16.67 2.43
Model Performance Comparison
Traditional
Gross Sales
Traditional
Net Sales
Digital
Gross Sales
Digital Net
Sales
ME -594759.10 -916118.10 3686.56 353.98
RMSE 9136902.00 10307341.00 4237217.00 4358207.00
MAE 6132050.00 7248800.00 3001718.00 3166288.00
MPE 7.98 49.67 -6.51 -18.24
MAPE 20.05 108.67 15.21 28.75
ACF1 0.15 0.14 0.00 0.00
Traditional
Gross Sales
Traditional
Net Sales
Digital
Gross Sales
Digital Net
Sales
ME -999.89 17489.41 -1622.06 5287.69
RMSE 1884502.00 1739840.00 441536.00 514144.60
MAE 1345289.00 1240022.00 310168.40 335859.80
MPE -0.69 5.83 -0.41 -1.65
MAPE 4.20 17.39 2.43 4.51
ACF1 -0.05 0.07 -0.00 0.10
ETS Model
The Best MAPE
ARIMA Model
The Best MAPE
nnetar Model
The Best MAPE
8
e
Mean SD
ME 656426.89 2710422.20
RMSE 9543108.05 961744.88
MAE 6711391.31 813266.35
MPE -1.90 3.16
MAPE 16.27 1.48
ACF1 0.18 0.17
Theil's U 0.26 0.08
Mean SD
ME 165959.29 1067295.57
RMSE 4660559.64 1250324.59
MAE 3431855.56 869998.87
MPE -8.44 17.99
MAPE 28.54 18.76
ACF1 -0.09 0.22
Theil's U 0.38 0.08
Mean SD
ME -199338.85 2133135.44
RMSE 10506026.58 1650492.68
MAE 7698473.24 789304.16
MPE 17.34 27.47
MAPE 53.49 36.58
ACF1 0.02 0.15
Theil's U 0.18 0.05
Mean SD
ME 201135.86 1497058.44
RMSE 4646052.77 628516.22
MAE 3475533.26 602313.80
MPE -0.21 6.83
MAPE 15.27 3.87
ACF1 0.02 0.15
Theil's U 0.40 0.07
Digital Product
Gross Sales
Traditional Product
Gross Sales
Digital Product
Net Sales
Traditional Product
Net Sales
Did nnetar model overfitted? 5 Fold Cross Validation
The cross validation result from nnetar model, which measure against the test data that model
have never seen, shows the model perform not as good at the training set. however, it still
perform better than the training set with ETS and ARIMA.
Theil’s U (less than 1), indicate that the forecasting technique is better than guessing.
When it equal to 1, the forecasting technique is about as good as guessing.
If it is above 1, then the forecasting technique is worse than guessing.
Traditional
Gross Sales
Traditional
Net Sales
Digital
Gross Sales
Digital Net
Sales
ME 656426.89 -199338.85 201135.86 165959.29
RMSE 9543108.05 10506026.58 4646052.77 4660559.64
MAE 6711391.31 7698473.24 3475533.26 3431855.56
MPE -1.90 17.34 -0.21 -8.44
MAPE 16.27 53.49 15.27 28.54
ACF1 0.18 0.02 0.02 -0.09
9
Model Performance Comparison
Traditional
Gross Sales
Traditional
Net Sales
Digital
Gross Sales
Digital Net
Sales
ME -637038.10 -1770053.00 -380326.10 -155923.20
RMSE 7485097.00 11024208.00 4418118.00 5084155.00
MAE 4894202.00 8021170.00 3061446.00 3741741.00
MPE -3.34 61.18 -2.27 -1.76
MAPE 10.35 110.42 13.21 58.16
ACF1 -0.18 0.15 0.02 0.18
Traditional
Gross Sales
Traditional
Net Sales
Digital
Gross Sales
Digital Net
Sales
ME -594759.10 -916118.10 3686.56 353.98
RMSE 9136902.00 10307341.00 4237217.00 4358207.00
MAE 6132050.00 7248800.00 3001718.00 3166288.00
MPE 7.98 49.67 -6.51 -18.24
MAPE 20.05 108.67 15.21 28.75
ACF1 -0.01 -0.02 -0.02 0.09
ETS Model
Training Set
ARIMA Model
Training Set
nnetar Model
Testing Set (5 folds cross validation)
Traditional
Gross Sales
Traditional
Net Sales
Digital
Gross Sales
Digital Net
Sales
ME -999.89 17489.41 -1622.06 5287.69
RMSE 1884502.00 1739840.00 441536.00 514144.60
MAE 1345289.00 1240022.00 310168.40 335859.80
MPE -0.69 5.83 -0.41 -1.65
MAPE 4.20 17.39 2.43 4.51
ACF1 -0.05 0.07 -0.00 0.10
nnetar Model
Training Set
10
Multivariate Time Series
Digital Product
Gross Sales
Traditional Product
Gross Sales
Digital Product
Net Sales
Traditional Product
Net Sales
Historic Data Future Data
Digital Product
Gross Sales
Traditional Product
Gross Sales
Digital Product
Net Sales
Traditional Product
Net Sales
Historic Data Future Data
Univariate Time Series Multivariate Time Series
Time X1 X2 X3 X4 Y1
t-12 Var1(t-12) Var2(t-12) Var3(t-12) Var4(t-12) Var4(t)
t-11 Var1(t-11) Var2(t-11) Var3(t-11) Var4(t-11) Var4(t+1)
t-10 Var1(t-10) Var2(t-10) Var3(t-10) Var4(t-10) Var4(t+2)
t-9 Var1(t-9) Var2(t-9) Var3(t-9) Var4(t-9) Var4(t+3)
t-8 Var1(t-8) Var2(t-8) Var3(t-8) Var4(t-8) Var4(t+4)
t-7 Var1(t-7) Var2(t-7) Var3(t-7) Var4(t-7) Var4(t+5)
t-6 Var1(t-6) Var2(t-6) Var3(t-6) Var4(t-6) Var4(t+6)
t-5 Var1(t-5) Var2(t-5) Var3(t-5) Var4(t-5) Var4(t+7)
t-4 Var1(t-4) Var2(t-4) Var3(t-4) Var4(t-4) Var4(t+8)
t-3 Var1(t-3) Var2(t-3) Var3(t-3) Var4(t-3) Var4(t+9)
t-2 Var1(t-2) Var2(t-2) Var3(t-2) Var4(t-2) Var4(t+10)
t-1 Var1(t-1) Var2(t-1) Var3(t-1) Var4(t-1) Var4(t+11)
t Var1(t) Var2(t) Var3(t) Var4(t) Var4(t+12)
t+1 Var1(t+1) Var2(t+1) Var3(t+1) Var4(t+1) Var4(t+13)
t+2 Var1(t+2) Var2(t+2) Var3(t+2) Var4(t+2) Var4(t+14)
t+3 Var1(t+3) Var2(t+3) Var3(t+3) Var4(t+3) Var4(t+15)
t+4 Var1(t+4) Var2(t+4) Var3(t+4) Var4(t+4) Var4(t+16)
t+5 Var1(t+5) Var2(t+5) Var3(t+5) Var4(t+5) Var4(t+17)
1a
11
Advanced Model: Long short-term memory (LSTM)
Configure LSTM Model
An Recurrent Neural Network
Data Preparation Training Model
150 epochsSupervised Learning Dataset
MAPE vs validation MAPE
Traditional
Gross Sales
Traditional
Net Sales
Digital
Gross Sales
Digital Net
Sales
ME
RMSE 2207332.06 2123658.12 7831121.66 6760654.91
MAE 1509378.75 1567319.13 6734541.00 5577573.50
MPE
MAPE 7.92 5.30 12.24 13.56
ACF1
Traditional
Gross Sales
Traditional
Net Sales
Digital
Gross Sales
Digital Net
Sales
ME
RMSE 3553031.81 3535456.35 3478618.88 3656988.30
MAE 2190123.75 2435441.00 2561047.75 2594779.50
MPE
MAPE 6.84 8.25 9.08 9.33
ACF1
Traditional
Gross Sales
Traditional
Net Sales
Digital
Gross Sales
Digital Net
Sales
ME 656426.89 -199338.85 201135.86 165959.29
RMSE 9543108.05 10506026.58 4646052.77 4660559.64
MAE 6711391.31 7698473.24 3475533.26 3431855.56
MPE -1.90 17.34 -0.21 -8.44
MAPE 16.27 53.49 15.27 28.54
ACF1 0.18 0.02 0.02 -0.09
4
nnetar vs LSTM Model
LSTM Model
Testing Set
nnetar Model
Testing Set (5 folds cross validation)
Traditional
Gross Sales
Traditional
Net Sales
Digital
Gross Sales
Digital Net
Sales
ME -999.89 17489.41 -1622.06 5287.69
RMSE 1884502.00 1739840.00 441536.00 514144.60
MAE 1345289.00 1240022.00 310168.40 335859.80
MPE -0.69 5.83 -0.41 -1.65
MAPE 4.20 17.39 2.43 4.51
ACF1 -0.05 0.07 -0.00 0.10
nnetar Model
Training Set
LSTM Model
Training Set
With training dataset, the LSTM model does
not outperform nnetar model, but the
performance are more consistent across
different measurements.
The cross validation result from LSTM model,
which measure against the test data that
model have never seen, shows the model
perform much better than nnetar model with
test dataset.
MAE vs validation MAE
Advanced Model: Long short-term memory (LSTM)
Digital Product Gross Sales Forecast Traditional Product Gross Sales Forecast
Digital Product Net Sales Forecast Traditional Product Net Sales Forecast
Model Fitted vs Actual Model Fitted vs Actual
Simple to implement
Require re-requisites (stationarity,
no level shifts)
Fast to run
Limited performance
Simple to implement
No pre-requisites (stationarity, no
level shifts)
Can model non-linear function
with neural networks
Univariate model
Structure supervised training
dataset and tune the model can
be difficult
No pre-requisites (stationarity, no
level shifts)
Can model non-linear function
with neural networks
univariate and multivariate time
series
Final Conclusion
ETS & ARIMA nnetar model LSTM model
THANK YOU

More Related Content

What's hot

Bdm presentation template girbban
Bdm presentation template   girbbanBdm presentation template   girbban
Bdm presentation template girbbanGirbban Paul
 
Plan de Negocios - Cuadros
Plan de Negocios - CuadrosPlan de Negocios - Cuadros
Plan de Negocios - CuadrosMaricel Jorge
 
Consolidated Analytic Report - Carnival Court (Phase I)
Consolidated Analytic Report - Carnival Court (Phase I)Consolidated Analytic Report - Carnival Court (Phase I)
Consolidated Analytic Report - Carnival Court (Phase I)IZE Creative
 
How to manage effective display advertising
How to manage effective display advertisingHow to manage effective display advertising
How to manage effective display advertisingWAAChicago
 
Standard Deviation
Standard DeviationStandard Deviation
Standard Deviationkellsierees
 

What's hot (8)

Bdm presentation template girbban
Bdm presentation template   girbbanBdm presentation template   girbban
Bdm presentation template girbban
 
Amtrust metrics
Amtrust metricsAmtrust metrics
Amtrust metrics
 
Plan de Negocios - Cuadros
Plan de Negocios - CuadrosPlan de Negocios - Cuadros
Plan de Negocios - Cuadros
 
Consolidated Analytic Report - Carnival Court (Phase I)
Consolidated Analytic Report - Carnival Court (Phase I)Consolidated Analytic Report - Carnival Court (Phase I)
Consolidated Analytic Report - Carnival Court (Phase I)
 
Amtrust metrics
Amtrust metricsAmtrust metrics
Amtrust metrics
 
Katherine A Chambers
Katherine A ChambersKatherine A Chambers
Katherine A Chambers
 
How to manage effective display advertising
How to manage effective display advertisingHow to manage effective display advertising
How to manage effective display advertising
 
Standard Deviation
Standard DeviationStandard Deviation
Standard Deviation
 

Similar to Comparing Classical and Machine Learning Algorithms for Time Series Forecasting

Sales data analysis with explanation and regional overview & Predictive Analy...
Sales data analysis with explanation and regional overview & Predictive Analy...Sales data analysis with explanation and regional overview & Predictive Analy...
Sales data analysis with explanation and regional overview & Predictive Analy...Subhankar Basak
 
Valuation of Indian hospitality industry
Valuation of Indian hospitality industryValuation of Indian hospitality industry
Valuation of Indian hospitality industryShivani Chaluvadi
 
DATA MINING WITH WEKA
DATA MINING WITH WEKADATA MINING WITH WEKA
DATA MINING WITH WEKAShubham Gupta
 
Melda Elmas-Project1-ppt.pptx
Melda Elmas-Project1-ppt.pptxMelda Elmas-Project1-ppt.pptx
Melda Elmas-Project1-ppt.pptxImelda903061
 
Activity-Based Costing
Activity-Based CostingActivity-Based Costing
Activity-Based Costingrexcris
 
Question1.xlsxAnova ResultsSUMMARY OUTPUTRegression Statistic.docx
Question1.xlsxAnova ResultsSUMMARY OUTPUTRegression Statistic.docxQuestion1.xlsxAnova ResultsSUMMARY OUTPUTRegression Statistic.docx
Question1.xlsxAnova ResultsSUMMARY OUTPUTRegression Statistic.docxcatheryncouper
 
Retail analytics ASIA workshop_ New perspective on GfK retail analytics
Retail analytics ASIA workshop_ New perspective on GfK retail analyticsRetail analytics ASIA workshop_ New perspective on GfK retail analytics
Retail analytics ASIA workshop_ New perspective on GfK retail analyticsRichard Jo
 
The 3 Basics - What a Company Needs
The 3 Basics - What a Company NeedsThe 3 Basics - What a Company Needs
The 3 Basics - What a Company NeedsBill Sims
 
BSE/NSE indices snapshot for 22 July 2014
BSE/NSE indices snapshot for 22 July 2014BSE/NSE indices snapshot for 22 July 2014
BSE/NSE indices snapshot for 22 July 2014Investors Empowered
 
How to Audit Adwords Campaign for An Existing Account
How to Audit Adwords Campaign for An Existing AccountHow to Audit Adwords Campaign for An Existing Account
How to Audit Adwords Campaign for An Existing AccountPandiyarajan ramu
 

Similar to Comparing Classical and Machine Learning Algorithms for Time Series Forecasting (20)

Amit Monthly Review Template.pptx
Amit Monthly Review Template.pptxAmit Monthly Review Template.pptx
Amit Monthly Review Template.pptx
 
Sales data analysis with explanation and regional overview & Predictive Analy...
Sales data analysis with explanation and regional overview & Predictive Analy...Sales data analysis with explanation and regional overview & Predictive Analy...
Sales data analysis with explanation and regional overview & Predictive Analy...
 
Valuation of Indian hospitality industry
Valuation of Indian hospitality industryValuation of Indian hospitality industry
Valuation of Indian hospitality industry
 
DATA MINING WITH WEKA
DATA MINING WITH WEKADATA MINING WITH WEKA
DATA MINING WITH WEKA
 
Scoring_model.pdf
Scoring_model.pdfScoring_model.pdf
Scoring_model.pdf
 
Scoring MODEL
Scoring MODELScoring MODEL
Scoring MODEL
 
Scoring model
Scoring modelScoring model
Scoring model
 
Monthly Review April-2023.pptx
Monthly Review April-2023.pptxMonthly Review April-2023.pptx
Monthly Review April-2023.pptx
 
Sample Financial Reports
Sample Financial ReportsSample Financial Reports
Sample Financial Reports
 
Melda Elmas-Project1-ppt.pptx
Melda Elmas-Project1-ppt.pptxMelda Elmas-Project1-ppt.pptx
Melda Elmas-Project1-ppt.pptx
 
Activity-Based Costing
Activity-Based CostingActivity-Based Costing
Activity-Based Costing
 
Question1.xlsxAnova ResultsSUMMARY OUTPUTRegression Statistic.docx
Question1.xlsxAnova ResultsSUMMARY OUTPUTRegression Statistic.docxQuestion1.xlsxAnova ResultsSUMMARY OUTPUTRegression Statistic.docx
Question1.xlsxAnova ResultsSUMMARY OUTPUTRegression Statistic.docx
 
Retail analytics ASIA workshop_ New perspective on GfK retail analytics
Retail analytics ASIA workshop_ New perspective on GfK retail analyticsRetail analytics ASIA workshop_ New perspective on GfK retail analytics
Retail analytics ASIA workshop_ New perspective on GfK retail analytics
 
BSE/NSE Indices 07 July 2014
BSE/NSE Indices 07 July 2014BSE/NSE Indices 07 July 2014
BSE/NSE Indices 07 July 2014
 
Ecommerce index-2013-10
Ecommerce index-2013-10Ecommerce index-2013-10
Ecommerce index-2013-10
 
W&S_Cosmetics subpanel
W&S_Cosmetics subpanelW&S_Cosmetics subpanel
W&S_Cosmetics subpanel
 
The 3 Basics - What a Company Needs
The 3 Basics - What a Company NeedsThe 3 Basics - What a Company Needs
The 3 Basics - What a Company Needs
 
Indices 09 jul2014060128
Indices 09 jul2014060128Indices 09 jul2014060128
Indices 09 jul2014060128
 
BSE/NSE indices snapshot for 22 July 2014
BSE/NSE indices snapshot for 22 July 2014BSE/NSE indices snapshot for 22 July 2014
BSE/NSE indices snapshot for 22 July 2014
 
How to Audit Adwords Campaign for An Existing Account
How to Audit Adwords Campaign for An Existing AccountHow to Audit Adwords Campaign for An Existing Account
How to Audit Adwords Campaign for An Existing Account
 

Recently uploaded

Carero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptxCarero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptxolyaivanovalion
 
ELKO dropshipping via API with DroFx.pptx
ELKO dropshipping via API with DroFx.pptxELKO dropshipping via API with DroFx.pptx
ELKO dropshipping via API with DroFx.pptxolyaivanovalion
 
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...Delhi Call girls
 
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdfAccredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdfadriantubila
 
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...amitlee9823
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...amitlee9823
 
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...amitlee9823
 
Ravak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxRavak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxolyaivanovalion
 
Edukaciniai dropshipping via API with DroFx
Edukaciniai dropshipping via API with DroFxEdukaciniai dropshipping via API with DroFx
Edukaciniai dropshipping via API with DroFxolyaivanovalion
 
Week-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionWeek-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionfulawalesam
 
BabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxBabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxolyaivanovalion
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxolyaivanovalion
 
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceBDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceDelhi Call girls
 
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...SUHANI PANDEY
 
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...amitlee9823
 
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...amitlee9823
 
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% SecureCall me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% SecurePooja Nehwal
 
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...amitlee9823
 

Recently uploaded (20)

Carero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptxCarero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptx
 
ELKO dropshipping via API with DroFx.pptx
ELKO dropshipping via API with DroFx.pptxELKO dropshipping via API with DroFx.pptx
ELKO dropshipping via API with DroFx.pptx
 
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
 
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdfAccredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
 
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
 
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
 
Ravak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxRavak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptx
 
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Edukaciniai dropshipping via API with DroFx
Edukaciniai dropshipping via API with DroFxEdukaciniai dropshipping via API with DroFx
Edukaciniai dropshipping via API with DroFx
 
Week-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionWeek-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interaction
 
Sampling (random) method and Non random.ppt
Sampling (random) method and Non random.pptSampling (random) method and Non random.ppt
Sampling (random) method and Non random.ppt
 
BabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxBabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptx
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFx
 
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceBDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
 
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
 
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
 
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
 
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% SecureCall me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
 
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
 

Comparing Classical and Machine Learning Algorithms for Time Series Forecasting

  • 1. Comparing Classical and Machine Learning Algorithms for Time Series Forecasting Yifan Wang
  • 2. Time series forecast problem can be multivariate, LSTMs can be used to model univariate and multivariate time series forecasting problems. LSTM Neural network Sales forecasting is one of the most fundamental and common analytics need for business. By accurately estimating future sales, companies to make informed business decisions and predict short-term and long-term performance. Sales Forecasting Classical Method Simple Feed-forward Neural Network 1 Table of Content Exponential smoothing and autoregressive integrated moving average (ARIMA) are most common methods for univariate time series. In this comparison, we use nnetar() function from forecast package in R. Feed-forward neural networks with a single hidden layer and lagged inputs for forecasting univariate time series.
  • 3. 2 Measurement Gross Sales & Net Sales Challenges The Return & Net Sales Objectives Forecast future 12 Month Product Categories Digital & Traditional Sales Forecasting: The Time Series Data In this example, we have a monthly sales data from a business sell their products via distributors. (Gross Sales) For this industry, the distributors can also return unsold products within a negotiated time frame: Gross Sales – Return = Net Sales There are two products: the new emerging Digital Product and the legacy Traditional Product. From the historical data, we can see these two products perform differently for past 10 years. Because of the nature of industry, the gross sales for both product categories have very stable seasonality. However, because of the return, the net sales are more challenging to forecast. The objective is to forecast the sales of future two years and also the remaining month of the current year. e Digital Product Gross Sales Traditional Product Gross Sales Digital Product Net Sales Traditional Product Net Sales
  • 4. 3 Digital Product Gross Sales Forecast Traditional Product Gross Sales Forecast Digital Product Net Sales Forecast Traditional Product Net Sales Forecast Classic Method: ETS Model Model Fitted vs Actual Model Fitted vs Actual
  • 5. 4 Digital Product Gross Sales Forecast Traditional Product Gross Sales Forecast Digital Product Net Sales Forecast Traditional Product Net Sales Forecast Classic Method: ARIMA Model Model Fitted vs Actual Model Fitted vs Actual
  • 6. 5 Digital Product Gross Sales Forecast Traditional Product Gross Sales Forecast Digital Product Net Sales Forecast Traditional Product Net Sales Forecast Machine Learning Algorithms : Feedforward Neural Network Model Fitted vs Actual Model Fitted vs Actual
  • 7. Traditional Gross Sales Traditional Net Sales Digital Gross Sales Digital Net Sales ME -637038.10 -1770053.00 -380326.10 -155923.20 RMSE 7485097.00 11024208.00 4418118.00 5084155.00 MAE 4894202.00 8021170.00 3061446.00 3741741.00 MPE -3.34 61.18 -2.27 -1.76 MAPE 10.35 110.42 13.21 58.16 ACF1 -0.18 0.15 0.02 0.18 6 14.57 16.67 2.43 Model Performance Comparison Traditional Gross Sales Traditional Net Sales Digital Gross Sales Digital Net Sales ME -594759.10 -916118.10 3686.56 353.98 RMSE 9136902.00 10307341.00 4237217.00 4358207.00 MAE 6132050.00 7248800.00 3001718.00 3166288.00 MPE 7.98 49.67 -6.51 -18.24 MAPE 20.05 108.67 15.21 28.75 ACF1 0.15 0.14 0.00 0.00 Traditional Gross Sales Traditional Net Sales Digital Gross Sales Digital Net Sales ME -999.89 17489.41 -1622.06 5287.69 RMSE 1884502.00 1739840.00 441536.00 514144.60 MAE 1345289.00 1240022.00 310168.40 335859.80 MPE -0.69 5.83 -0.41 -1.65 MAPE 4.20 17.39 2.43 4.51 ACF1 -0.05 0.07 -0.00 0.10 ETS Model The Best MAPE ARIMA Model The Best MAPE nnetar Model The Best MAPE
  • 8. 8 e Mean SD ME 656426.89 2710422.20 RMSE 9543108.05 961744.88 MAE 6711391.31 813266.35 MPE -1.90 3.16 MAPE 16.27 1.48 ACF1 0.18 0.17 Theil's U 0.26 0.08 Mean SD ME 165959.29 1067295.57 RMSE 4660559.64 1250324.59 MAE 3431855.56 869998.87 MPE -8.44 17.99 MAPE 28.54 18.76 ACF1 -0.09 0.22 Theil's U 0.38 0.08 Mean SD ME -199338.85 2133135.44 RMSE 10506026.58 1650492.68 MAE 7698473.24 789304.16 MPE 17.34 27.47 MAPE 53.49 36.58 ACF1 0.02 0.15 Theil's U 0.18 0.05 Mean SD ME 201135.86 1497058.44 RMSE 4646052.77 628516.22 MAE 3475533.26 602313.80 MPE -0.21 6.83 MAPE 15.27 3.87 ACF1 0.02 0.15 Theil's U 0.40 0.07 Digital Product Gross Sales Traditional Product Gross Sales Digital Product Net Sales Traditional Product Net Sales Did nnetar model overfitted? 5 Fold Cross Validation
  • 9. The cross validation result from nnetar model, which measure against the test data that model have never seen, shows the model perform not as good at the training set. however, it still perform better than the training set with ETS and ARIMA. Theil’s U (less than 1), indicate that the forecasting technique is better than guessing. When it equal to 1, the forecasting technique is about as good as guessing. If it is above 1, then the forecasting technique is worse than guessing. Traditional Gross Sales Traditional Net Sales Digital Gross Sales Digital Net Sales ME 656426.89 -199338.85 201135.86 165959.29 RMSE 9543108.05 10506026.58 4646052.77 4660559.64 MAE 6711391.31 7698473.24 3475533.26 3431855.56 MPE -1.90 17.34 -0.21 -8.44 MAPE 16.27 53.49 15.27 28.54 ACF1 0.18 0.02 0.02 -0.09 9 Model Performance Comparison Traditional Gross Sales Traditional Net Sales Digital Gross Sales Digital Net Sales ME -637038.10 -1770053.00 -380326.10 -155923.20 RMSE 7485097.00 11024208.00 4418118.00 5084155.00 MAE 4894202.00 8021170.00 3061446.00 3741741.00 MPE -3.34 61.18 -2.27 -1.76 MAPE 10.35 110.42 13.21 58.16 ACF1 -0.18 0.15 0.02 0.18 Traditional Gross Sales Traditional Net Sales Digital Gross Sales Digital Net Sales ME -594759.10 -916118.10 3686.56 353.98 RMSE 9136902.00 10307341.00 4237217.00 4358207.00 MAE 6132050.00 7248800.00 3001718.00 3166288.00 MPE 7.98 49.67 -6.51 -18.24 MAPE 20.05 108.67 15.21 28.75 ACF1 -0.01 -0.02 -0.02 0.09 ETS Model Training Set ARIMA Model Training Set nnetar Model Testing Set (5 folds cross validation) Traditional Gross Sales Traditional Net Sales Digital Gross Sales Digital Net Sales ME -999.89 17489.41 -1622.06 5287.69 RMSE 1884502.00 1739840.00 441536.00 514144.60 MAE 1345289.00 1240022.00 310168.40 335859.80 MPE -0.69 5.83 -0.41 -1.65 MAPE 4.20 17.39 2.43 4.51 ACF1 -0.05 0.07 -0.00 0.10 nnetar Model Training Set
  • 10. 10 Multivariate Time Series Digital Product Gross Sales Traditional Product Gross Sales Digital Product Net Sales Traditional Product Net Sales Historic Data Future Data Digital Product Gross Sales Traditional Product Gross Sales Digital Product Net Sales Traditional Product Net Sales Historic Data Future Data Univariate Time Series Multivariate Time Series
  • 11. Time X1 X2 X3 X4 Y1 t-12 Var1(t-12) Var2(t-12) Var3(t-12) Var4(t-12) Var4(t) t-11 Var1(t-11) Var2(t-11) Var3(t-11) Var4(t-11) Var4(t+1) t-10 Var1(t-10) Var2(t-10) Var3(t-10) Var4(t-10) Var4(t+2) t-9 Var1(t-9) Var2(t-9) Var3(t-9) Var4(t-9) Var4(t+3) t-8 Var1(t-8) Var2(t-8) Var3(t-8) Var4(t-8) Var4(t+4) t-7 Var1(t-7) Var2(t-7) Var3(t-7) Var4(t-7) Var4(t+5) t-6 Var1(t-6) Var2(t-6) Var3(t-6) Var4(t-6) Var4(t+6) t-5 Var1(t-5) Var2(t-5) Var3(t-5) Var4(t-5) Var4(t+7) t-4 Var1(t-4) Var2(t-4) Var3(t-4) Var4(t-4) Var4(t+8) t-3 Var1(t-3) Var2(t-3) Var3(t-3) Var4(t-3) Var4(t+9) t-2 Var1(t-2) Var2(t-2) Var3(t-2) Var4(t-2) Var4(t+10) t-1 Var1(t-1) Var2(t-1) Var3(t-1) Var4(t-1) Var4(t+11) t Var1(t) Var2(t) Var3(t) Var4(t) Var4(t+12) t+1 Var1(t+1) Var2(t+1) Var3(t+1) Var4(t+1) Var4(t+13) t+2 Var1(t+2) Var2(t+2) Var3(t+2) Var4(t+2) Var4(t+14) t+3 Var1(t+3) Var2(t+3) Var3(t+3) Var4(t+3) Var4(t+15) t+4 Var1(t+4) Var2(t+4) Var3(t+4) Var4(t+4) Var4(t+16) t+5 Var1(t+5) Var2(t+5) Var3(t+5) Var4(t+5) Var4(t+17) 1a 11 Advanced Model: Long short-term memory (LSTM) Configure LSTM Model An Recurrent Neural Network Data Preparation Training Model 150 epochsSupervised Learning Dataset MAPE vs validation MAPE
  • 12. Traditional Gross Sales Traditional Net Sales Digital Gross Sales Digital Net Sales ME RMSE 2207332.06 2123658.12 7831121.66 6760654.91 MAE 1509378.75 1567319.13 6734541.00 5577573.50 MPE MAPE 7.92 5.30 12.24 13.56 ACF1 Traditional Gross Sales Traditional Net Sales Digital Gross Sales Digital Net Sales ME RMSE 3553031.81 3535456.35 3478618.88 3656988.30 MAE 2190123.75 2435441.00 2561047.75 2594779.50 MPE MAPE 6.84 8.25 9.08 9.33 ACF1 Traditional Gross Sales Traditional Net Sales Digital Gross Sales Digital Net Sales ME 656426.89 -199338.85 201135.86 165959.29 RMSE 9543108.05 10506026.58 4646052.77 4660559.64 MAE 6711391.31 7698473.24 3475533.26 3431855.56 MPE -1.90 17.34 -0.21 -8.44 MAPE 16.27 53.49 15.27 28.54 ACF1 0.18 0.02 0.02 -0.09 4 nnetar vs LSTM Model LSTM Model Testing Set nnetar Model Testing Set (5 folds cross validation) Traditional Gross Sales Traditional Net Sales Digital Gross Sales Digital Net Sales ME -999.89 17489.41 -1622.06 5287.69 RMSE 1884502.00 1739840.00 441536.00 514144.60 MAE 1345289.00 1240022.00 310168.40 335859.80 MPE -0.69 5.83 -0.41 -1.65 MAPE 4.20 17.39 2.43 4.51 ACF1 -0.05 0.07 -0.00 0.10 nnetar Model Training Set LSTM Model Training Set With training dataset, the LSTM model does not outperform nnetar model, but the performance are more consistent across different measurements. The cross validation result from LSTM model, which measure against the test data that model have never seen, shows the model perform much better than nnetar model with test dataset. MAE vs validation MAE
  • 13. Advanced Model: Long short-term memory (LSTM) Digital Product Gross Sales Forecast Traditional Product Gross Sales Forecast Digital Product Net Sales Forecast Traditional Product Net Sales Forecast Model Fitted vs Actual Model Fitted vs Actual
  • 14. Simple to implement Require re-requisites (stationarity, no level shifts) Fast to run Limited performance Simple to implement No pre-requisites (stationarity, no level shifts) Can model non-linear function with neural networks Univariate model Structure supervised training dataset and tune the model can be difficult No pre-requisites (stationarity, no level shifts) Can model non-linear function with neural networks univariate and multivariate time series Final Conclusion ETS & ARIMA nnetar model LSTM model