BookmarkSubscribeRSS Feed

Enhance Forecasting Accuracy with Time-Series Segmentation and Machine Learning

Started ‎02-16-2023 by
Modified ‎02-16-2023 by
Views 949

Several papers discussed the importance of segmenting time series into groups and modeling each group separately to enhance forecasting accuracy overall. But what does this look like in practice? At the end of the day, why not use an AutoML package (Automated Machine Learning) or an Auto-forecasting tool and let it do the job for you?

 

The answer is quite simple, but we need to dive a bit deeper to understand the concept. An AutoML tool will usually use all the data you have available, develop several models, and then select the best-performing model as a global ‘champion’ to generate forecasts for all time series. An auto-forecasting tool will usually compare various statistical models (sometimes deep-learning models are included as well) for each time series and then select the best-performing one based on users’ criteria to model the specific series.

 

However, we already know that:

  1. Machine Learning models deliver better results in terms of accuracy when we are dealing with interrelated series and complex patterns in our data.
  2. Machine Learning and Deep Learning models are much more computationally intensive compared to statistical methods, which makes them more expensive to run and scale in the cloud.
  3. Classical statistical methods (such as Exponential Smoothing and ARIMA) could outperform complex techniques when we have enough data history and specific characteristics in our data such as trend and seasonality.

Wouldn’t it be great to segment the time series first and then apply the appropriate modeling strategy to each group to deliver optimal results both in terms of accuracy and computational efficiency? Absolutely! So how do we choose from all the available different clustering methods?

 

While there are many different methods (such as similarity, component-based, and Kmeans) to explore, SAS Visual Forecasting provides a demand classification template where time series are grouped based on their historical demand patterns and an appropriate pre-selected modeling method is applied to each group.

 

The groups are formed following the flow below (for a more detailed explanation have a look at the documentation here).

Now let’s take this a step further. Using the default pre-selected models and settings we could enhance forecasting accuracy by quite a bit, but a significant uplift can be realized when modifying the pipelines that are automatically generated.

 

In the short clip below we showcase the logic. In SAS VF you can have many competing forecasting pipelines. In our example, we use two pipelines: the Auto-forecasting template, which selects the best-performing method from various statistical models, and a demand-classification template, which implements the flow we presented above and creates nested forecasting pipelines for each group that is formed.

 

 

In the video, you can see that 519 times series are classified as ‘Year Round — Non-Seasonal’ which means that these series have long time span without seasonal patterns. This is a great opportunity to use machine learning and other advanced techniques to see if we can enhance the accuracy of our results. In our example we used a gradient boosting model, a panel series neural network, a hybrid technique called Stacked Model (which implements a strategy where the results from a Neural Network and statistical time series techniques are cleverly combined), and the preselected non-seasonal model node which implements a series of non-seasonal, statistical time series methods and selects the best performing one.

 

For the data we used, the Stacked Model achieves a reduction of the error in Weighted Mean Absolute Error (WMAE) of 5.5% without much tuning of the algorithm which is not bad at all! After implementing our changes, the demand classification pipeline reduces the overall error in our forecasting process by approx. 21% compared to the Auto-Forecasting one — quite impressive!

 

When happy with our forecasts, we could also infuse business knowledge, that is not captured in the data, by using the “Overrides” tab and then explore the key information of our project in the automated report that is generated in the “Insights tab”, which can be exported as PDF and shared with other business units. 

 

Happy forecasting!

Version history
Last update:
‎02-16-2023 03:57 AM
Updated by:
Contributors

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Free course: Data Literacy Essentials

Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning  and boost your career prospects.

Get Started

Article Tags