	{"id":60226,"date":"2021-04-14T09:01:04","date_gmt":"2021-04-14T08:01:04","guid":{"rendered":"https:\/\/www.artefact.com\/?post_type=news&#038;p=60226"},"modified":"2024-09-20T17:45:41","modified_gmt":"2024-09-20T16:45:41","slug":"the-path-to-developing-a-high-performance-demand-forecasting-model-part-1","status":"publish","type":"blog","link":"https:\/\/www.artefact.com\/nl\/blog\/the-path-to-developing-a-high-performance-demand-forecasting-model-part-1\/","title":{"rendered":"De weg naar het ontwikkelen van een goed presterend vraagvoorspellingsmodel - Deel 1"},"content":{"rendered":"<p><div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-1 fusion-flex-container nonhundred-percent-fullwidth non-hundred-percent-height-scrolling article-author\" style=\"--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-background-color:#ffffff;--awb-flex-wrap:wrap;\" ><div class=\"fusion-builder-row fusion-row fusion-flex-align-items-flex-start fusion-flex-content-wrap\" style=\"max-width:calc( 1440px + 20px );margin-left: calc(-20px \/ 2 );margin-right: calc(-20px \/ 2 );\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-0 fusion_builder_column_1_2 1_2 fusion-flex-column\" style=\"--awb-bg-size:cover;--awb-width-large:50%;--awb-margin-top-large:0px;--awb-spacing-right-large:10px;--awb-margin-bottom-large:0px;--awb-spacing-left-large:10px;--awb-width-medium:50%;--awb-order-medium:0;--awb-spacing-right-medium:10px;--awb-spacing-left-medium:10px;--awb-width-small:100%;--awb-order-small:0;--awb-spacing-right-small:10px;--awb-spacing-left-small:10px;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-justify-content-flex-start fusion-content-layout-column\"><div class=\"fusion-title title fusion-title-1 fusion-sep-none fusion-title-text fusion-title-size-two\" style=\"--awb-margin-bottom-small:8px;\"><h2 class=\"fusion-title-heading title-heading-left fusion-responsive-typography-calculated\" style=\"margin:0;--fontSize:50;line-height:1.2;\">Author<\/h2><\/div><img decoding=\"async\" src=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%27150%27%20height%3D%270%27%20viewBox%3D%270%200%20150%200%27%3E%3Crect%20width%3D%27150%27%20height%3D%270%27%20fill-opacity%3D%220%22%2F%3E%3C%2Fsvg%3E\" data-orig-src=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2020\/11\/Pengfei-Zhang-.jpg\" alt=\"Image\" class=\"lazyload artefact-elegant-image align-left article-author-image\" style=\"width: 150px; border-radius: 54% 46% 77% 23% \/ 74% 40% 60% 26%; overflow: hidden;\" width=\"150\" height=\"auto\" \/><div class=\"fusion-title title fusion-title-2 fusion-sep-none fusion-title-text fusion-title-size-three article-author-name-title\" style=\"--awb-margin-bottom-small:8px;\"><h3 class=\"fusion-title-heading title-heading-left fusion-responsive-typography-calculated\" style=\"margin:0;--fontSize:20;line-height:1.2;\">Phil Zhang<\/h3><\/div><div class=\"fusion-text fusion-text-1 article-author-description\"><p>Lead Data Scientist &#8211; Director at Artefact<\/p>\n<\/div><\/div><\/div><\/div><\/div><div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-2 fusion-flex-container nonhundred-percent-fullwidth non-hundred-percent-height-scrolling\" style=\"--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-flex-wrap:wrap;\" ><div class=\"fusion-builder-row fusion-row fusion-flex-align-items-flex-start fusion-flex-content-wrap\" style=\"max-width:calc( 1440px + 20px );margin-left: calc(-20px \/ 2 );margin-right: calc(-20px \/ 2 );\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-1 fusion_builder_column_1_1 1_1 fusion-flex-column\" style=\"--awb-bg-size:cover;--awb-width-large:100%;--awb-margin-top-large:0px;--awb-spacing-right-large:10px;--awb-margin-bottom-large:0px;--awb-spacing-left-large:10px;--awb-width-medium:100%;--awb-order-medium:0;--awb-spacing-right-medium:10px;--awb-spacing-left-medium:10px;--awb-width-small:100%;--awb-order-small:0;--awb-spacing-right-small:10px;--awb-spacing-left-small:10px;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-justify-content-flex-start fusion-content-layout-column\"><div class=\"fusion-title title fusion-title-3 fusion-sep-none fusion-title-text fusion-title-size-two\" style=\"--awb-margin-bottom-small:8px;\"><h2 class=\"fusion-title-heading title-heading-left fusion-responsive-typography-calculated\" style=\"margin:0;--fontSize:50;line-height:1.2;\">GLADS &#8211; 5 choices you need to make before starting modeling<\/h2><\/div><div class=\"fusion-image-element\" style=\"--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><span class=\" fusion-imageframe imageframe-none imageframe-1 hover-type-none\"><img decoding=\"async\" width=\"300\" height=\"74\" title=\"Medium Blog\" src=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2021\/04\/Medium-Blog.png\" data-orig-src=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2021\/04\/Medium-Blog-300x74.png\" alt class=\"lazyload img-responsive wp-image-60582\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%274000%27%20height%3D%27992%27%20viewBox%3D%270%200%204000%20992%27%3E%3Crect%20width%3D%274000%27%20height%3D%27992%27%20fill-opacity%3D%220%22%2F%3E%3C%2Fsvg%3E\" data-srcset=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2021\/04\/Medium-Blog-200x50.png 200w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2021\/04\/Medium-Blog-400x99.png 400w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2021\/04\/Medium-Blog-600x149.png 600w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2021\/04\/Medium-Blog-800x198.png 800w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2021\/04\/Medium-Blog-1200x298.png 1200w\" data-sizes=\"auto\" data-orig-sizes=\"(max-width: 640px) 100vw, 300px\" \/><\/span><\/div><div class=\"fusion-text fusion-text-2 description\"><p><strong>TL;DR<\/strong><\/p>\n<p>Demand forecasting is always challenging, we all know that. In this series of articles you will understand the main challenges of developing a complex forecasting model on a real world problem. Our model has to beat baseline predictions made by demand planners in terms of forecast accuracy and be easily deployed to other countries. First, we would like to provide you with useful tips regarding the choices you should make, before training your own model.<\/p>\n<p><strong>What to expect from this series ?<\/strong><\/p>\n<p>We aim to provide you with insights and good practices that go beyond things you might find on Kaggle competitions. The problem with online forecasting competitions is that they often omit real world constraints like corrupted data, data not available in advance, etc.<\/p>\n<p>Each article in this series will tackle a challenge that you might encounter, for which there are no clear answers on Kaggle discussions:<\/p>\n<li>GLADS : 5 choices you need to make before you start<\/li>\n<li>Making accurate forecasts during frequent promotions<\/li>\n<li>Building a visualisation tool to evaluate your model<\/li>\n<li>Predicting sales for products with no historical data<\/li>\n<li>Performing automated data quality checks in production phase<\/li>\n<li>Rolling out your forecasting model to different countries<\/li>\n<\/div><\/div><\/div><\/div><\/div><article class=\"fusion-fullwidth fullwidth-box fusion-builder-row-3 fusion-flex-container nonhundred-percent-fullwidth non-hundred-percent-height-scrolling\" style=\"--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-flex-wrap:wrap;\" ><div class=\"fusion-builder-row fusion-row fusion-flex-align-items-flex-start fusion-flex-justify-content-center fusion-flex-content-wrap\" style=\"max-width:calc( 1440px + 20px );margin-left: calc(-20px \/ 2 );margin-right: calc(-20px \/ 2 );\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-2 fusion_builder_column_1_1 1_1 fusion-flex-column\" style=\"--awb-bg-size:cover;--awb-width-large:100%;--awb-margin-top-large:0px;--awb-spacing-right-large:10px;--awb-margin-bottom-large:0px;--awb-spacing-left-large:10px;--awb-width-medium:100%;--awb-order-medium:0;--awb-spacing-right-medium:10px;--awb-spacing-left-medium:10px;--awb-width-small:100%;--awb-order-small:0;--awb-spacing-right-small:10px;--awb-spacing-left-small:10px;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-justify-content-flex-start fusion-content-layout-column\"><div class=\"fusion-title title fusion-title-4 fusion-sep-none fusion-title-text fusion-title-size-two\" style=\"--awb-margin-bottom-small:8px;\"><h2 class=\"fusion-title-heading title-heading-left fusion-responsive-typography-calculated\" style=\"margin:0;--fontSize:50;line-height:1.2;\">The GLADS framework<\/h2><\/div><div class=\"fusion-text fusion-text-3\"><p>Demand forecasting has been a powerful tool to help companies on decision making, logistic optimization as well as business insights learning. However, it remains a challenge to have an accurate and robust forecasting model, machine learning based approaches struggle to be applied on real business due to different constraints. The challenge may rise from both the business side and the data side. To help business owners and data scientists overcome these difficulties, we have summarized five choices you need to make based on our experience. We call it GLADS, which stands for:<\/p>\n<\/div><ul style=\"--awb-line-height:27.2px;--awb-icon-width:27.2px;--awb-icon-height:27.2px;--awb-icon-margin:11.2px;--awb-content-margin:38.4px;\" class=\"fusion-checklist fusion-checklist-1 fusion-checklist-default type-icons\"><li class=\"fusion-li-item\" style=\"\"><span class=\"icon-wrapper circle-no\"><i class=\"fusion-li-icon fa-angle-right fas\" aria-hidden=\"true\"><\/i><\/span><div class=\"fusion-li-item-content\">\n<p>Choosing the right <strong>Granularity of data<\/strong><\/p>\n<\/div><\/li><li class=\"fusion-li-item\" style=\"\"><span class=\"icon-wrapper circle-no\"><i class=\"fusion-li-icon fa-angle-right fas\" aria-hidden=\"true\"><\/i><\/span><div class=\"fusion-li-item-content\">\n<p>Choosing the right <strong>Length of horizon<\/strong><\/p>\n<\/div><\/li><li class=\"fusion-li-item\" style=\"\"><span class=\"icon-wrapper circle-no\"><i class=\"fusion-li-icon fa-angle-right fas\" aria-hidden=\"true\"><\/i><\/span><div class=\"fusion-li-item-content\">\n<p>Choosing the right <strong>Algorithm for prediction<\/strong><\/p>\n<\/div><\/li><li class=\"fusion-li-item\" style=\"\"><span class=\"icon-wrapper circle-no\"><i class=\"fusion-li-icon fa-angle-right fas\" aria-hidden=\"true\"><\/i><\/span><div class=\"fusion-li-item-content\">\n<p>Choosing the right <strong>Drivers of sales<\/strong><\/p>\n<\/div><\/li><li class=\"fusion-li-item\" style=\"\"><span class=\"icon-wrapper circle-no\"><i class=\"fusion-li-icon fa-angle-right fas\" aria-hidden=\"true\"><\/i><\/span><div class=\"fusion-li-item-content\">\n<p>Choosing the right <strong>Sets of SKUs<\/strong><\/p>\n<\/div><\/li><\/ul><div class=\"fusion-text fusion-text-4\"><p>In the passage, we will briefly explain what, why and how we chose GLADS.<\/p>\n<\/div><div class=\"fusion-title title fusion-title-5 fusion-sep-none fusion-title-text fusion-title-size-two\" style=\"--awb-margin-bottom-small:8px;\"><h2 class=\"fusion-title-heading title-heading-left fusion-responsive-typography-calculated\" style=\"margin:0;--fontSize:50;line-height:1.2;\">G: Granularity of data<\/h2><\/div><div class=\"fusion-title title fusion-title-6 fusion-sep-none fusion-title-text fusion-title-size-three\" style=\"--awb-margin-bottom-small:8px;\"><h3 class=\"fusion-title-heading title-heading-left fusion-responsive-typography-calculated\" style=\"margin:0;--fontSize:20;line-height:1.2;\">What is it?<\/h3><\/div><div class=\"fusion-text fusion-text-5\"><p>Granularity of data is how detailed your sales description will be. It usually comes in two dimensions: items and time (frequency). For example, do you describe your sales by SKU \/ category \/ BU \/ Country? Do you record your sales by hour \/ day \/ week \/ month \/ year?<\/p>\n<\/div><div class=\"fusion-title title fusion-title-7 fusion-sep-none fusion-title-text fusion-title-size-three\" style=\"--awb-margin-bottom-small:8px;\"><h3 class=\"fusion-title-heading title-heading-left fusion-responsive-typography-calculated\" style=\"margin:0;--fontSize:20;line-height:1.2;\">Why is it important?<\/h3><\/div><div class=\"fusion-text fusion-text-6\"><p><img decoding=\"async\" class=\"lazyload aligncenter wp-image-60392 size-full\" src=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2021\/04\/Example-of-time-series-in-different-time-granularity.png\" data-orig-src=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2021\/04\/Example-of-time-series-in-different-time-granularity.png\" alt=\"\" width=\"694\" height=\"520\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%27694%27%20height%3D%27520%27%20viewBox%3D%270%200%20694%20520%27%3E%3Crect%20width%3D%27694%27%20height%3D%27520%27%20fill-opacity%3D%220%22%2F%3E%3C%2Fsvg%3E\" data-srcset=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2021\/04\/Example-of-time-series-in-different-time-granularity-200x150.png 200w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2021\/04\/Example-of-time-series-in-different-time-granularity-300x225.png 300w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2021\/04\/Example-of-time-series-in-different-time-granularity-400x300.png 400w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2021\/04\/Example-of-time-series-in-different-time-granularity-600x450.png 600w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2021\/04\/Example-of-time-series-in-different-time-granularity.png 694w\" data-sizes=\"auto\" data-orig-sizes=\"(max-width: 694px) 100vw, 694px\" \/><\/p>\n<div class=\"quote-baseline\" style=\"text-align: center;\"><strong class=\"as lj\">Example of time series in different time granularity\u00a0<\/strong>[Jiang, Yexi &amp; Perng, Chang-shing &amp; Li, Tao &amp; Chang, Rong. (2012). Intelligent Cloud Capacity Management. 10.1109\/NOMS.2012.6211941. ]<\/div>\n<\/div><div class=\"fusion-text fusion-text-7\"><p>While the more detailed the raw data are, the more options that the Data Scientist can work around for sales forecasting, choice of the granularity is not that straightforward. Apparently, a higher granularity can keep more information when describing the sales, however, it can also bring about a large amount of noise into the data. Choosing the right granularity is a necessary step to denoise the data and to keep as much information as possible, which can build a solid base for the next modeling steps.<\/p>\n<\/div><div class=\"fusion-title title fusion-title-8 fusion-sep-none fusion-title-text fusion-title-size-three\" style=\"--awb-margin-bottom-small:8px;\"><h3 class=\"fusion-title-heading title-heading-left fusion-responsive-typography-calculated\" style=\"margin:0;--fontSize:20;line-height:1.2;\">How to Choose?<\/h3><\/div><div class=\"fusion-text fusion-text-8\"><p>The granularity should be chosen by considering two main factors: business need and data characteristics itself.<\/p>\n<\/div><div class=\"fusion-text fusion-text-9\"><p><strong>Based on your business need<\/strong>: Business need is always the first thing that should be taken into consideration. In some cases, monthly sales would be enough whereas in other cases, you might be asked to predict sales for each single hour. The business need varies a lot in different industries, and please make sure you start building the model after understanding it first.<\/p>\n<\/div><div class=\"fusion-text fusion-text-10\"><p><strong>Based on data characteristics<\/strong>: Bricks cannot be made without straw, if the granularity of the data conflicts with the business need, the first idea that you come up in mind should be collecting the data in another way. Although some algorithms can help you to elevate the granularity of your data by simulation or machine learning, building a model using pseudo-data brings you too much uncertainty. Nevertheless, aggregating the data to lower granularity is sometimes necessary, in these cases, the data are too unstable with a high variance, data aggregation can be a useful tool to stabilize the data and increase the performance of your model.<\/p>\n<\/div><div class=\"fusion-title title fusion-title-9 fusion-sep-none fusion-title-text fusion-title-size-two\" style=\"--awb-margin-bottom-small:8px;\"><h2 class=\"fusion-title-heading title-heading-left fusion-responsive-typography-calculated\" style=\"margin:0;--fontSize:50;line-height:1.2;\">L: Length of horizon<\/h2><\/div><div class=\"fusion-title title fusion-title-10 fusion-sep-none fusion-title-text fusion-title-size-three\" style=\"--awb-margin-bottom-small:8px;\"><h3 class=\"fusion-title-heading title-heading-left fusion-responsive-typography-calculated\" style=\"margin:0;--fontSize:20;line-height:1.2;\">What is it?<\/h3><\/div><div class=\"fusion-text fusion-text-11\"><p><img decoding=\"async\" class=\"lazyload aligncenter wp-image-60391 size-full\" src=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2021\/04\/Definition-illustration-of-forecasting-horizon.jpeg\" data-orig-src=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2021\/04\/Definition-illustration-of-forecasting-horizon.jpeg\" alt=\"\" width=\"700\" height=\"393\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%27700%27%20height%3D%27393%27%20viewBox%3D%270%200%20700%20393%27%3E%3Crect%20width%3D%27700%27%20height%3D%27393%27%20fill-opacity%3D%220%22%2F%3E%3C%2Fsvg%3E\" data-srcset=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2021\/04\/Definition-illustration-of-forecasting-horizon-200x112.jpeg 200w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2021\/04\/Definition-illustration-of-forecasting-horizon-300x168.jpeg 300w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2021\/04\/Definition-illustration-of-forecasting-horizon-400x225.jpeg 400w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2021\/04\/Definition-illustration-of-forecasting-horizon-600x337.jpeg 600w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2021\/04\/Definition-illustration-of-forecasting-horizon.jpeg 700w\" data-sizes=\"auto\" data-orig-sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/p>\n<div class=\"quote-baseline\" style=\"text-align: center;\"><strong class=\"as lj\">Definition illustration of forecasting horizon<\/strong><\/div>\n<\/div><div class=\"fusion-text fusion-text-12\"><p>The time Horizon of your forecasting model is basically how long in the future the prediction should perform. If we prepare a forecast with the time horizon of two months, then it means our model would give the predicted result two months from current time with a certain granularity.<\/p>\n<\/div><div class=\"fusion-title title fusion-title-11 fusion-sep-none fusion-title-text fusion-title-size-three\" style=\"--awb-margin-bottom-small:8px;\"><h3 class=\"fusion-title-heading title-heading-left fusion-responsive-typography-calculated\" style=\"margin:0;--fontSize:20;line-height:1.2;\">Why is it important?<\/h3><\/div><div class=\"fusion-text fusion-text-13\"><p>While the accuracy of the model is often used as the only performance metric when evaluating a forecasting model, time horizon can be essential when applying the model in the real world. Just like weather forecasting, one can always reach a better accuracy when predicting the temperature in the next few hours than that of one week after. It is the same case when it comes to sales forecasting, the longer the horizon is, the lower the accuracy would be. However, for business applications, it would be the opposite. Normally, there is no need to predict the sales of the next coming day since few decisions can be made and executed during the night whereas it could be very helpful to know what will happen in the following weeks or months. Don\u2019t be blind without having a time horizon in mind and build a model that cannot be applied in the real world.<\/p>\n<\/div><div class=\"fusion-title title fusion-title-12 fusion-sep-none fusion-title-text fusion-title-size-three\" style=\"--awb-margin-bottom-small:8px;\"><h3 class=\"fusion-title-heading title-heading-left fusion-responsive-typography-calculated\" style=\"margin:0;--fontSize:20;line-height:1.2;\">How to choose?<\/h3><\/div><div class=\"fusion-text fusion-text-14\"><p>The length of the time horizon will fully depend on business needs. For example, if the forecast is going to be used in order to help optimize warehouse scheduling\uff0cthen forecasting sales for the next day might not be of help. Thus the forecast horizon should be set based on how long it takes from knowing the future to actually apply the action. Or to put it more frankly: how much should you know numbers in advance? As a reminder, a horizon which is too long can decrease the quantity of training samples you have if the time coverage of the data is not long enough.<\/p>\n<\/div><div class=\"fusion-title title fusion-title-13 fusion-sep-none fusion-title-text fusion-title-size-two\" style=\"--awb-margin-bottom-small:8px;\"><h2 class=\"fusion-title-heading title-heading-left fusion-responsive-typography-calculated\" style=\"margin:0;--fontSize:50;line-height:1.2;\">A: Algorithm for prediction<\/h2><\/div><div class=\"fusion-title title fusion-title-14 fusion-sep-none fusion-title-text fusion-title-size-three\" style=\"--awb-margin-bottom-small:8px;\"><h3 class=\"fusion-title-heading title-heading-left fusion-responsive-typography-calculated\" style=\"margin:0;--fontSize:20;line-height:1.2;\">What is it?<\/h3><\/div><div class=\"fusion-text fusion-text-15\"><p>Sales forecasting approaches have been evolving for years, thus the diversity of the algorithms. While the most popular tools when talking about sales forecasting are ARIMA from statsmodel and Prophet, tree-based regression models have also been applied on sales forecasting tasks. Meanwhile, deep neural networks have never been out of the list of candidates whenever machine learning is applied.<\/p>\n<\/div><div class=\"fusion-title title fusion-title-15 fusion-sep-none fusion-title-text fusion-title-size-three\" style=\"--awb-margin-bottom-small:8px;\"><h3 class=\"fusion-title-heading title-heading-left fusion-responsive-typography-calculated\" style=\"margin:0;--fontSize:20;line-height:1.2;\">Why is it important?<\/h3><\/div><div class=\"fusion-text fusion-text-16\"><p>It may not be the job of a Data Scientist to develop a brand new algorithm for a special task, the main challenge for them nowadays goes to choosing the right algorithm and the customized data processing for the algorithm. Choosing an algorithm without considering the available data, the business context or the requirements on the transparency of the model would probably turn the model into tons of parameters staying in the server with no proper application.<\/p>\n<\/div><div class=\"fusion-title title fusion-title-16 fusion-sep-none fusion-title-text fusion-title-size-three\" style=\"--awb-margin-bottom-small:8px;\"><h3 class=\"fusion-title-heading title-heading-left fusion-responsive-typography-calculated\" style=\"margin:0;--fontSize:20;line-height:1.2;\">How to Choose?<\/h3><\/div><div class=\"fusion-text fusion-text-17\"><p>Before choosing the best algorithm in your case, here are some general concepts that should be known for each branch of the algorithm.<\/p>\n<\/div><div class=\"fusion-text fusion-text-18\"><p><img decoding=\"async\" class=\"lazyload aligncenter wp-image-60390 size-full\" src=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2021\/04\/Comparison-of-different-forecasting-algorithms.png\" data-orig-src=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2021\/04\/Comparison-of-different-forecasting-algorithms.png\" alt=\"\" width=\"700\" height=\"288\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%27700%27%20height%3D%27288%27%20viewBox%3D%270%200%20700%20288%27%3E%3Crect%20width%3D%27700%27%20height%3D%27288%27%20fill-opacity%3D%220%22%2F%3E%3C%2Fsvg%3E\" data-srcset=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2021\/04\/Comparison-of-different-forecasting-algorithms-200x82.png 200w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2021\/04\/Comparison-of-different-forecasting-algorithms-300x123.png 300w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2021\/04\/Comparison-of-different-forecasting-algorithms-400x165.png 400w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2021\/04\/Comparison-of-different-forecasting-algorithms-600x247.png 600w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2021\/04\/Comparison-of-different-forecasting-algorithms.png 700w\" data-sizes=\"auto\" data-orig-sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/p>\n<div class=\"quote-baseline\" style=\"text-align: center;\"><strong>Comparison of different forecasting algorithms<\/strong><\/div>\n<\/div><div class=\"fusion-text fusion-text-19\"><p><strong>ARIMA<\/strong>: ARIMA is used to build a model for a time series using purely classical statistical methods without other features that can represent the characteristics of the sku.<\/p>\n<\/div><div class=\"fusion-text fusion-text-20\"><p><strong>Prophet<\/strong>: Prophet is an advanced forecasting tool designed by Facebook, which can customize the events and the festivals, however, no static features can be added.<\/p>\n<\/div><div class=\"fusion-text fusion-text-21\"><p>Both ARIMA and Prophet cannot build a model for multiple time series and the error will be stacked with as the horizon increases.<\/p>\n<\/div><div class=\"fusion-text fusion-text-22\"><p><strong>Tree based models<\/strong>: Tree based models are often used for classification and regression problems, however, it can also be used for time series forecasting through some special data processing tricks. One can build a table where each feature represents the values of the series on the specific time stamp, and the forecasting can be made by rolling the time of prediction with the time window. Tree based ensemble models are now one of the most efficient ways when building a sales forecasting model since one can customize more features into the model without too much work on feature engineering.<\/p>\n<\/div><div class=\"fusion-text fusion-text-23\"><p><strong>Neural network<\/strong>: Neural network methods are never out-of-fashioned because of its performance. One can always build a neural network like LSTM with similar feature engineering processes with tree based models. However, the transparency of the model, the amount of data needed and the training efficiency should always be estimated before such approaches are applied.<\/p>\n<\/div><div class=\"fusion-title title fusion-title-17 fusion-sep-none fusion-title-text fusion-title-size-two\" style=\"--awb-margin-bottom-small:8px;\"><h2 class=\"fusion-title-heading title-heading-left fusion-responsive-typography-calculated\" style=\"margin:0;--fontSize:50;line-height:1.2;\">D: Drivers of sales<\/h2><\/div><div class=\"fusion-title title fusion-title-18 fusion-sep-none fusion-title-text fusion-title-size-three\" style=\"--awb-margin-bottom-small:8px;\"><h3 class=\"fusion-title-heading title-heading-left fusion-responsive-typography-calculated\" style=\"margin:0;--fontSize:20;line-height:1.2;\">What is it?<\/h3><\/div><div class=\"fusion-text fusion-text-24\"><p>It is a common knowledge in business, that the sales of an item can be hugely influenced by other factors (holidays, events, campaigns, media, weather, etc). When you are able to catch these drivers, you might have a better chance to improve the forecasting with the driver data, especially when some of the drivers could be known or set prior to forecasting.<\/p>\n<\/div><div class=\"fusion-text fusion-text-25\"><p><img decoding=\"async\" class=\"lazyload aligncenter wp-image-60389 size-full\" src=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2021\/04\/Example-of-driver-of-sales.png\" data-orig-src=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2021\/04\/Example-of-driver-of-sales.png\" alt=\"\" width=\"700\" height=\"367\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%27700%27%20height%3D%27367%27%20viewBox%3D%270%200%20700%20367%27%3E%3Crect%20width%3D%27700%27%20height%3D%27367%27%20fill-opacity%3D%220%22%2F%3E%3C%2Fsvg%3E\" data-srcset=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2021\/04\/Example-of-driver-of-sales-200x105.png 200w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2021\/04\/Example-of-driver-of-sales-300x157.png 300w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2021\/04\/Example-of-driver-of-sales-400x210.png 400w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2021\/04\/Example-of-driver-of-sales-600x315.png 600w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2021\/04\/Example-of-driver-of-sales.png 700w\" data-sizes=\"auto\" data-orig-sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/p>\n<div class=\"quote-baseline\" style=\"text-align: center;\"><strong>Example of driver of sales<\/strong><\/div>\n<\/div><div class=\"fusion-title title fusion-title-19 fusion-sep-none fusion-title-text fusion-title-size-three\" style=\"--awb-margin-bottom-small:8px;\"><h3 class=\"fusion-title-heading title-heading-left fusion-responsive-typography-calculated\" style=\"margin:0;--fontSize:20;line-height:1.2;\">Why is it important?<\/h3><\/div><div class=\"fusion-text fusion-text-26\"><p>Sales forecasting models can hardly achieve a satisfactory performance if they only use history sales because customers\u2019 behavior can be influenced by too many factors. The sales of a supermarket might be influenced by the weather, and the sales of a cosmetic brand might be pulled by the campaigns. Based on our experience, the impact of different drivers can be so strong that the sales are sometimes doubled during the festive season and it can cause huge errors on the model prediction. Nevertheless, analyzing the impact of drivers is always an interesting topic for both marketers and the logistics department, what are the key factors that master the sales? How would the sales change if a big campaign is scheduled in the future? And how to optimize the logistics under different scenarios?<\/p>\n<\/div><div class=\"fusion-title title fusion-title-20 fusion-sep-none fusion-title-text fusion-title-size-three\" style=\"--awb-margin-bottom-small:8px;\"><h3 class=\"fusion-title-heading title-heading-left fusion-responsive-typography-calculated\" style=\"margin:0;--fontSize:20;line-height:1.2;\">How to Choose?<\/h3><\/div><div class=\"fusion-text fusion-text-27\"><p><strong>Transformation to time series<\/strong>: Given the data related to potential drivers, the first thing we need to do is to transform these data into time-series so that we can analyze the co-relationship between the driver and the sales of one sku. However, this can be really tricky. The easiest way is to encode a group of events as a binary variable indicating whether at least one of these events happens during a certain period of time. Based on that, the events can be encoded as a numerical time sequence, too. For example, the number of events on the same day, the number of cities where the events happened on that day, etc. Some customized-transformation can also be added such as using other forms of waves instead of square waves according to the business experience.<\/p>\n<\/div><div class=\"fusion-text fusion-text-28\"><p><strong>Study of correlation<\/strong>: Next, we need to study the correlation between two time series. We suggest using TLCC (Time Lagged Cross Correlation) as the effect of an event can appear before or after the event. For example, campaigns usually take effect several days after the launch while people tend to prepare the gift one week before the festival. As a result, the offset can be positive or negative, while the absolute values need to be limited based on business experience, otherwise it would be too difficult to explain why today\u2019s sales are impacted by the Christmas of 2018.<\/p>\n<\/div><div class=\"fusion-title title fusion-title-21 fusion-sep-none fusion-title-text fusion-title-size-two\" style=\"--awb-margin-bottom-small:8px;\"><h2 class=\"fusion-title-heading title-heading-left fusion-responsive-typography-calculated\" style=\"margin:0;--fontSize:50;line-height:1.2;\">S: Sets of SKUs<\/h2><\/div><div class=\"fusion-title title fusion-title-22 fusion-sep-none fusion-title-text fusion-title-size-three\" style=\"--awb-margin-bottom-small:8px;\"><h3 class=\"fusion-title-heading title-heading-left fusion-responsive-typography-calculated\" style=\"margin:0;--fontSize:20;line-height:1.2;\">What is it?<\/h3><\/div><div class=\"fusion-text fusion-text-29\"><p>Most of the time, the sales data are gathered by SKU (Stock keeping unit), so an important question when building a forecasting model on SKU-level is whether to train an individual model for each SKU or to use all the available SKUs to train one model. While the former focuses on one single SKU and differentiates the characteristics of it, the latter benefits from the huge volume of the training data and saves space for stocking the parameters of models.<\/p>\n<\/div><div class=\"fusion-title title fusion-title-23 fusion-sep-none fusion-title-text fusion-title-size-three\" style=\"--awb-margin-bottom-small:8px;\"><h3 class=\"fusion-title-heading title-heading-left fusion-responsive-typography-calculated\" style=\"margin:0;--fontSize:20;line-height:1.2;\">Why is it important?<\/h3><\/div><div class=\"fusion-text fusion-text-30\"><p>The reason why we can train the model with all SKUs is that most of the signals learned by the model are similar, therefore, if we are able to maximize the similarity among the data we use for training, we can optimize the trade-off between the respect of the particularity of each sku and the volume of the training data.<\/p>\n<\/div><div class=\"fusion-title title fusion-title-24 fusion-sep-none fusion-title-text fusion-title-size-three\" style=\"--awb-margin-bottom-small:8px;\"><h3 class=\"fusion-title-heading title-heading-left fusion-responsive-typography-calculated\" style=\"margin:0;--fontSize:20;line-height:1.2;\">How to Choose?<\/h3><\/div><div class=\"fusion-text fusion-text-31\"><p>Based on that assumption, we suggest two different methods to group the SKUs.<\/p>\n<\/div><div class=\"fusion-text fusion-text-32\"><p><strong>Business way<\/strong>: Since the sales of one category can be similar, grouping the SKUs by their categories would be a practical way to benefit from the common patterns among certain SKU. Sometimes there are even sub-categories that you can leverage to find the best cut of SKU.<\/p>\n<\/div><div class=\"fusion-text fusion-text-33\"><p><strong>Data science way<\/strong>: A data science way to group the SKUs is to apply clustering algorithms. In the previous section, we have mentioned about the analysis of the correlation between SKUs and drivers, we can utilize the same method to calculate the correlation across the SKUs. In fact, the correlation can be considered as distance, clustering algorithms can be thus applied to the distance matrix across all pairs of SKUs, then the model can be trained individually on each of these clusters.<\/p>\n<\/div><div class=\"fusion-text fusion-text-34\"><p><img decoding=\"async\" class=\"lazyload aligncenter wp-image-60388 size-full\" src=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2021\/04\/Example-of-SKU-clustering-based-on-time-series-pattern-similarity.png\" data-orig-src=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2021\/04\/Example-of-SKU-clustering-based-on-time-series-pattern-similarity.png\" alt=\"\" width=\"700\" height=\"496\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%27700%27%20height%3D%27496%27%20viewBox%3D%270%200%20700%20496%27%3E%3Crect%20width%3D%27700%27%20height%3D%27496%27%20fill-opacity%3D%220%22%2F%3E%3C%2Fsvg%3E\" data-srcset=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2021\/04\/Example-of-SKU-clustering-based-on-time-series-pattern-similarity-200x142.png 200w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2021\/04\/Example-of-SKU-clustering-based-on-time-series-pattern-similarity-300x213.png 300w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2021\/04\/Example-of-SKU-clustering-based-on-time-series-pattern-similarity-400x283.png 400w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2021\/04\/Example-of-SKU-clustering-based-on-time-series-pattern-similarity-600x425.png 600w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2021\/04\/Example-of-SKU-clustering-based-on-time-series-pattern-similarity.png 700w\" data-sizes=\"auto\" data-orig-sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/p>\n<div class=\"quote-baseline\" style=\"text-align: center;\"><strong>Example of SKU clustering based on time series pattern similarity<\/strong><\/div>\n<\/div><div class=\"fusion-title title fusion-title-25 fusion-sep-none fusion-title-text fusion-title-size-two\" style=\"--awb-margin-bottom-small:8px;\"><h2 class=\"fusion-title-heading title-heading-left fusion-responsive-typography-calculated\" style=\"margin:0;--fontSize:50;line-height:1.2;\">Conclusion<\/h2><\/div><div class=\"fusion-text fusion-text-35\"><p>As a conclusion, here is a short version of \u201cGLADS\u201d to keep in mind when you make forecasting choices:<\/p>\n<\/div><ul style=\"--awb-line-height:27.2px;--awb-icon-width:27.2px;--awb-icon-height:27.2px;--awb-icon-margin:11.2px;--awb-content-margin:38.4px;\" class=\"fusion-checklist fusion-checklist-2 fusion-checklist-default type-icons\"><li class=\"fusion-li-item\" style=\"\"><span class=\"icon-wrapper circle-no\"><i class=\"fusion-li-icon awb-icon-check\" aria-hidden=\"true\"><\/i><\/span><div class=\"fusion-li-item-content\">\n<p><strong>G<\/strong>ranularity of data: Choose it based on the real data granularity you have, and see if you need to aggregate based on the data variance.<\/p>\n<\/div><\/li><li class=\"fusion-li-item\" style=\"\"><span class=\"icon-wrapper circle-no\"><i class=\"fusion-li-icon awb-icon-check\" aria-hidden=\"true\"><\/i><\/span><div class=\"fusion-li-item-content\">\n<p><strong>L<\/strong>ength of Horizon: Align with business need on how long to forecast in future, and pay attention to the data update frequency<\/p>\n<\/div><\/li><li class=\"fusion-li-item\" style=\"\"><span class=\"icon-wrapper circle-no\"><i class=\"fusion-li-icon awb-icon-check\" aria-hidden=\"true\"><\/i><\/span><div class=\"fusion-li-item-content\">\n<p><strong>A<\/strong>lgorithm for prediction: there\u2019s no single model to serve all needs, choose carefully based on your data characteristic<\/p>\n<\/div><\/li><li class=\"fusion-li-item\" style=\"\"><span class=\"icon-wrapper circle-no\"><i class=\"fusion-li-icon awb-icon-check\" aria-hidden=\"true\"><\/i><\/span><div class=\"fusion-li-item-content\">\n<p><strong>D<\/strong>rivers of sales: Try to Identify as much as possible the valid drivers, either from business insights or data science tools, this will help a LOT.<\/p>\n<\/div><\/li><li class=\"fusion-li-item\" style=\"\"><span class=\"icon-wrapper circle-no\"><i class=\"fusion-li-icon awb-icon-check\" aria-hidden=\"true\"><\/i><\/span><div class=\"fusion-li-item-content\">\n<p><strong>S<\/strong>ets of SKUs: Don\u2019t train a model only for a single SKU, try to get a good set of SKUs that have similar patterns in the past.<\/p>\n<\/div><\/li><\/ul><div class=\"fusion-text fusion-text-36\"><p>At the end of the day, these choices would only be able to help you get on a good head start at the beginning of a forecasting project, or help fine tune the methodology along the way. But the devil is in the details, and we will post later on some more detailed methodology related to this topic. <strong>After all, there\u2019s no end game in forecasting, there\u2019s always the need to do better<\/strong>.<\/p>\n<\/div><\/div><\/div><\/div><\/article><div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-4 fusion-flex-container nonhundred-percent-fullwidth non-hundred-percent-height-scrolling\" style=\"--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-flex-wrap:wrap;\" ><div class=\"fusion-builder-row fusion-row fusion-flex-align-items-flex-start fusion-flex-content-wrap\" style=\"max-width:calc( 1440px + 20px );margin-left: calc(-20px \/ 2 );margin-right: calc(-20px \/ 2 );\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-3 fusion_builder_column_1_1 1_1 fusion-flex-column\" style=\"--awb-bg-size:cover;--awb-width-large:100%;--awb-margin-top-large:0px;--awb-spacing-right-large:10px;--awb-margin-bottom-large:0px;--awb-spacing-left-large:10px;--awb-width-medium:100%;--awb-order-medium:0;--awb-spacing-right-medium:10px;--awb-spacing-left-medium:10px;--awb-width-small:100%;--awb-order-small:0;--awb-spacing-right-small:10px;--awb-spacing-left-small:10px;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-justify-content-flex-start fusion-content-layout-column\"><div class=\"fusion-text fusion-text-37\"><p>You can find more about us and our projects on our Medium blog<\/p>\n<\/div><div ><a class=\"fusion-button button-flat fusion-button-default-size button-default fusion-button-default button-1 fusion-button-default-span fusion-button-default-type button-primary-medium\" target=\"_self\" href=\"https:\/\/medium.com\/artefact-engineering-and-data-science\/the-path-to-developing-a-high-performance-demand-forecasting-model-part-1-e977889d4595\" rel=\"noopener\"><span class=\"fusion-button-text awb-button__text awb-button__text--default\">View Article<\/span><\/a><\/div><\/div><\/div><\/div><\/div><\/p>\n","protected":false},"excerpt":{"rendered":"<p>14 april 2021<br \/>\nHet voorspellen van de vraag is altijd een uitdaging, dat weten we allemaal. In deze reeks artikelen zult u inzicht krijgen in de belangrijkste uitdagingen bij het ontwikkelen van een complex voorspellingsmodel voor een praktijkprobleem.<\/p>","protected":false},"featured_media":60230,"parent":0,"template":"","meta":{"_acf_changed":false,"ep_exclude_from_search":false},"blog-category":[22035],"blog-language":[2991],"class_list":["post-60226","blog","type-blog","status-publish","has-post-thumbnail","hentry","blog-category-data-ai-consulting","blog-language-en"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.artefact.com\/nl\/wp-json\/wp\/v2\/blog\/60226","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.artefact.com\/nl\/wp-json\/wp\/v2\/blog"}],"about":[{"href":"https:\/\/www.artefact.com\/nl\/wp-json\/wp\/v2\/types\/blog"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.artefact.com\/nl\/wp-json\/wp\/v2\/media\/60230"}],"wp:attachment":[{"href":"https:\/\/www.artefact.com\/nl\/wp-json\/wp\/v2\/media?parent=60226"}],"wp:term":[{"taxonomy":"blog-category","embeddable":true,"href":"https:\/\/www.artefact.com\/nl\/wp-json\/wp\/v2\/blog-category?post=60226"},{"taxonomy":"blog-language","embeddable":true,"href":"https:\/\/www.artefact.com\/nl\/wp-json\/wp\/v2\/blog-language?post=60226"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}