Forecasting
models
Machine Learning
Algorithms
1
Time Series Forecasting
Time Sales
30/03/20 200
31/03/20 220
• We don’t have predictors
01/04/20 230
• We need to use past data
02/04/20
Time 235
Sales
03/04/20 ?
04/04/20 ?
2
Time Series Forecasting
Time Sales
Simple models:
30/03/20 200
31/03/20 220
• Predict the last value
01/04/20 230
02/04/20
Time 235 • Predict the mean of the last x values
Sales
03/04/20 ?
(moving average)
04/04/20 ?
3
Time Series Forecasting
Time Sales Special models:
30/03/20 200
31/03/20 220
• Exponential Smoothing: weighted average of last values
01/04/20 230
• ARIMA - Autoregression: forecast with a linear
02/04/20
Time 235
Sales
combination of past values of the target.
03/04/20 ?
04/04/20
• Prophet
?
• Neuronal networks - RNN
• These models can take the “raw” time series as input.
• Neural Networks can also take additional features.
4
Time Series Forecasting
Time Sales Off-the-shelf machine learning models
30/03/20 200
31/03/20 220
• Linear regression
01/04/20 230
• Random Forests
02/04/20
Time 235
Sales
• Gradient Boosting Machines (xgb, lightGBMs)
03/04/20 ?
04/04/20
• SVM, KNN, etc
?
• We need predictors!
• These models predict a target based of predictors.
• We need predictor variables.
• We need a suitable target.
5
Extract features
Target Predictors
Machine
Time Sales Var 1 Var 2 Var 2 Var 4 Var 5 Var 5
Learning
30/03/20 200 Model 3 30 15 50 0.2 0
31/03/20 220 3 31 16 10 0.2 0
01/04/20 230 4 1 17 0 0.19 1
02/04/20
Time 235
Sales 4 1
Var 2 2
Var 19 2
Var 54
Var 0.175
Var 0 5
Var
03/04/20 ? 3 30 15 50 0.2 0
04/04/20 ? 3 31 16 10 0.2 0
• How do we generate the predictors and the target?
This is the main topic of the course.
6
Simple models predict future values
based of past values.
Summary Special models that can take the raw
time series, like ES, ARIMA and Prophet.
We can forecast with traditional
machine learning models plus feature
engineering.