{"id":916,"date":"2020-04-13T19:43:25","date_gmt":"2019-05-27T19:28:11","guid":{"rendered":"https:\/\/www.aihello.com\/resources\/?p=916"},"modified":"2026-09-23T10:16:32","modified_gmt":"2026-09-23T10:16:32","slug":"sales-forecast-using-multiple-predictors","status":"publish","type":"post","link":"https:\/\/www.aihello.com\/resources\/blog\/sales-forecast-using-multiple-predictors\/","title":{"rendered":"Sales Forecast using multiple Predictors"},"content":{"rendered":"<div class=\"wp-block-group ah-reading-guide ah-compact-toc\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\"><style>\n.ah-reading-guide{max-width:820px;margin:0 auto;color:#26364a;font-size:18px;line-height:1.8;counter-reset:ah-section}.ah-reading-guide *{box-sizing:border-box}.ah-reading-guide p{margin:0 0 22px;line-height:1.8}.ah-reading-guide strong{color:#142d48}.ah-reading-guide h2{position:relative;margin:56px 0 24px;padding-top:24px;border-top:1px solid #dce7ef;font-size:29px;line-height:1.35;letter-spacing:-.4px;color:#142d48}.ah-reading-guide h2.ah-numbered{padding-left:54px;counter-increment:ah-section}.ah-reading-guide h2.ah-numbered:before{content:counter(ah-section,decimal-leading-zero);position:absolute;left:0;top:26px;display:flex;align-items:center;justify-content:center;width:38px;height:38px;background:#eaf4fc;color:#216faf;border-radius:10px;font-size:15px;font-weight:700;letter-spacing:0}.ah-reading-guide h3{position:relative;margin:34px 0 16px;font-size:23px;line-height:1.4;color:#163f65}.ah-reading-guide h4{position:relative;margin:28px 0 14px;font-size:20px;line-height:1.45;color:#163f65}.ah-reading-guide .ah-lead{margin:0 0 28px;padding:24px 28px;border-left:4px solid #2479ba;border-radius:0 12px 12px 0;background:#eef6fc;font-size:20px;line-height:1.75}.ah-reading-guide .ah-callout,.ah-reading-guide .ah-formula{margin:28px 0;padding:24px 26px;border:1px solid #d7e5f1;border-left:4px solid #2479ba;border-radius:0 12px 12px 0;background:#f5f9fd}.ah-reading-guide .ah-formula{font-size:20px;font-weight:600;font-variant-numeric:tabular-nums;line-height:1.9;overflow-wrap:anywhere}.ah-reading-guide ul,.ah-reading-guide ol{margin:24px 0 30px;padding-left:28px}.ah-reading-guide li{margin:0 0 12px;padding-left:7px;line-height:1.75}.ah-reading-guide li::marker{color:#2479ba;font-weight:700}.ah-reading-guide ol.ah-steps{list-style:none;counter-reset:ah-step;padding:0;display:grid;gap:14px}.ah-reading-guide ol.ah-steps>li{position:relative;counter-increment:ah-step;margin:0;padding:22px 24px 22px 64px;border:1px solid #dbe7f1;border-radius:12px;background:#f6fafd}.ah-reading-guide ol.ah-steps>li:before{content:counter(ah-step);position:absolute;top:23px;left:20px;display:flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:50%;background:#2378b9;color:white;font-size:14px;font-weight:700}.ah-reading-guide ul.ah-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;padding:0;list-style:none}.ah-reading-guide ul.ah-cards>li{margin:0;padding:20px 22px;border:1px solid #dbe8f2;background:#f7fbfe;border-radius:12px;font-size:17px;line-height:1.7}.ah-reading-guide ul.ah-cards>li:last-child:nth-child(odd){grid-column:1\/-1}.ah-reading-guide .ah-cards>li>strong:first-child{display:block;margin-bottom:8px;color:#19598d}.ah-reading-guide .ah-step-panel{margin:22px 0;padding:24px 28px;border-left:4px solid #2479ba;border-radius:0 12px 12px 0;background:#f5f9fd}.ah-reading-guide .ah-step-panel h3{margin-top:0}.ah-reading-guide .ah-step-panel p:last-child{margin-bottom:0}.ah-reading-guide figure{max-width:100%;margin:30px 0}.ah-reading-guide figure.wp-block-image{padding:7px;border:1px solid #e0e8ef;border-radius:12px;background:white;box-shadow:0 5px 18px rgba(20,45,72,.06)}.ah-reading-guide img{max-width:100%;height:auto}.ah-reading-guide figure.wp-block-image img{display:block;border-radius:6px}.ah-reading-guide figcaption{font-size:14px;line-height:1.5;color:#587086;margin-top:10px}.ah-reading-guide figure.wp-block-table{overflow-x:auto;border:1px solid #d8e5ef;border-radius:10px}.ah-reading-guide table{width:100%;border-collapse:collapse;font-size:16px;line-height:1.6}.ah-reading-guide th,.ah-reading-guide td{padding:14px 16px;border:1px solid #d8e5ef;text-align:left;vertical-align:top}.ah-reading-guide th{background:#eaf4fc;color:#163f65;font-weight:700}.ah-reading-guide tbody tr:nth-child(even){background:#f6f9fc}.ah-reading-guide blockquote{margin:30px 0;padding:22px 26px;border-left:4px solid #2479ba;background:#f3f8fc;border-radius:0 10px 10px 0}.ah-reading-guide #ez-toc-container{width:100%;margin:32px 0 42px;padding:22px 24px;border:1px solid #cbdfee;border-top:4px solid #2479ba;border-radius:12px;background:#f7fbfe;box-shadow:none}.ah-reading-guide #ez-toc-container .ez-toc-title{margin:0;font-size:20px;font-weight:700;color:#163f65;line-height:1.5}.ah-reading-guide #ez-toc-container .ez-toc-title-container{margin-bottom:14px}.ah-reading-guide #ez-toc-container ul.ez-toc-list-level-1{display:block;column-count:2;column-gap:26px;padding:0;margin:0}.ah-reading-guide #ez-toc-container ul.ez-toc-list-level-1>li{break-inside:avoid;padding:11px 0;margin:0;border-bottom:1px solid #dce7ef;line-height:1.5;font-size:16px}.ah-reading-guide #ez-toc-container ul ul{margin:7px 0 0;padding-left:18px}.ah-reading-guide #ez-toc-container li li{padding:0;margin:5px 0;font-size:14px}.ah-reading-guide #ez-toc-container a{color:#19598d;text-decoration:none}.ah-reading-guide #ez-toc-container a:hover{text-decoration:underline}.ah-reading-guide #ez-toc-container a:focus-visible{outline:3px solid #2479ba;outline-offset:4px;border-radius:3px}.ah-reading-guide :is(h2,h3,h4)>.ez-toc-section{position:absolute;top:-100px;left:0}.ah-reading-guide :is(h2,h3,h4)>.ez-toc-section-end{position:absolute;top:0;left:0}.ah-reading-guide [id]{scroll-margin-top:100px}.ah-reading-guide .gspb_container{min-width:0}@media(max-width:700px){.ah-reading-guide{font-size:17px}.ah-reading-guide h2{font-size:25px;margin-top:44px}.ah-reading-guide h2.ah-numbered{padding-left:43px}.ah-reading-guide h2.ah-numbered:before{width:30px;height:30px;font-size:13px}.ah-reading-guide h3{font-size:21px}.ah-reading-guide ul.ah-cards{grid-template-columns:1fr}.ah-reading-guide .ah-lead,.ah-reading-guide .ah-callout,.ah-reading-guide .ah-formula,.ah-reading-guide .ah-step-panel{padding:20px}.ah-reading-guide .ah-lead,.ah-reading-guide .ah-formula{font-size:18px}.ah-reading-guide #ez-toc-container{padding:18px}.ah-reading-guide #ez-toc-container ul.ez-toc-list-level-1{column-count:1}}@media(prefers-reduced-motion:reduce){.ah-reading-guide [data-aos]{opacity:1!important;visibility:visible!important;transform:none!important;transition:none!important;animation:none!important}}\n\n.ah-reading-guide .ah-process-heading{padding-left:48px;min-height:36px}.ah-reading-guide .ah-process-heading:before{position:absolute;left:0;top:0;width:34px;height:34px;display:flex;align-items:center;justify-content:center;border-radius:9px;background:#eaf4fc;color:#216faf;font-size:15px;font-weight:700}.ah-reading-guide .ah-process-1:before{content:\"01\"}.ah-reading-guide .ah-process-2:before{content:\"02\"}.ah-reading-guide .ah-process-3:before{content:\"03\"}.ah-reading-guide .ah-process-4:before{content:\"04\"}.ah-reading-guide .ah-process-5:before{content:\"05\"}.ah-reading-guide .ah-process-6:before{content:\"06\"}.ah-reading-guide .ah-process-7:before{content:\"07\"}.ah-reading-guide .ah-process-8:before{content:\"08\"}.ah-reading-guide .ah-process-9:before{content:\"09\"}\n.ah-reading-guide .ah-definition{padding:20px 24px;margin:14px 0;border:1px solid #dbe7f1;border-radius:12px;background:#f8fbfe}.ah-reading-guide .ah-definition strong{color:#163f65}\n.ah-reading-guide .ah-long-form-list>li{margin-bottom:28px}.ah-reading-guide .ah-long-form-list>li>strong:first-child{display:block;font-size:22px;line-height:1.4;margin-bottom:16px}.ah-reading-guide .ah-long-form-list li img{display:block;margin:22px auto}.ah-reading-guide .ah-formula-comparison{font-variant-numeric:tabular-nums}\n.ah-reading-guide h5,.ah-reading-guide h6{font-size:18px;line-height:1.5;color:#163f65;margin:26px 0 14px;font-weight:700}\n.ah-reading-guide h2.ah-instruction-heading{font-size:21px;margin:24px 0 18px;padding-top:18px}.ah-reading-guide h2.ah-instruction-heading:before{top:18px}\n.ah-reading-guide ul.ah-stacked-cards{list-style:none;padding:0}.ah-reading-guide .ah-stacked-cards>li{margin:14px 0;padding:20px 24px;border:1px solid #dbe7f1;border-radius:12px;background:#f8fbfe}\n.ah-reading-guide .ah-minor-label{font-weight:700;color:#1e4e64;font-size:18px;margin:20px 0 8px;}\n.ah-reading-guide h3.ah-do,.ah-reading-guide h3.ah-dont{font-size:21px;padding:18px 22px;border-radius:0 10px 10px 0}.ah-reading-guide h3.ah-do{border-left:4px solid #20877e;background:#f0faf8}.ah-reading-guide h3.ah-dont{border-left:4px solid #ae6340;background:#fff7f0}\n.ah-reading-guide p.ah-fact-row{margin:6px 0;padding:12px 18px;background:#f4f8fc;border-left:3px solid #c7dcf0;border-radius:0 8px 8px 0;font-size:17px;line-height:1.65}.ah-reading-guide p.ah-cta a{display:inline-block;padding:12px 20px;border-radius:9px;background:#135faa;color:#fff;text-decoration:none;font-weight:700}.ah-reading-guide p.ah-cta a:hover{background:#104d89}.ah-reading-guide .ah-agency-summary td:first-child{width:38%;color:#184b75}\n.ah-reading-guide details.ah-original-index{padding:16px 20px;border:1px solid #dce7f0;border-radius:10px;margin:24px 0;background:#f8fafc}.ah-reading-guide details.ah-original-index summary{cursor:pointer;font-size:18px;font-weight:700;color:#244f74}.ah-reading-guide details.ah-original-index>ol{margin-top:18px}\n.ah-reading-guide ul.ah-cycle-cards{grid-template-columns:repeat(3,minmax(0,1fr));gap:22px}.ah-reading-guide ul.ah-cycle-cards>li{position:relative;text-align:center;display:flex;align-items:center;justify-content:center;min-height:110px;font-weight:700;color:#20567d}.ah-reading-guide ul.ah-cycle-cards>li:last-child:nth-child(odd){grid-column:auto}.ah-reading-guide ul.ah-cycle-cards>li:not(:last-child)::after{content:\"\u203a\";position:absolute;right:-19px;top:50%;transform:translateY(-50%);font-size:28px;color:#3785b4}@media(max-width:700px){.ah-reading-guide ul.ah-cycle-cards{grid-template-columns:1fr}.ah-reading-guide ul.ah-cycle-cards>li:not(:last-child)::after{right:50%;top:auto;bottom:-25px;transform:rotate(90deg)}}\n.ah-reading-guide .ah-process-10::before{content:\"10\"}\n.ah-reading-guide pre.wp-block-code{background:#122238;color:#eff6ff;border:1px solid #29415f;border-radius:12px;padding:22px 24px;margin:24px 0;overflow-x:auto;font-size:15px;line-height:1.7;white-space:pre;tab-size:4}.ah-reading-guide pre.wp-block-code code{background:transparent;color:inherit;padding:0;white-space:pre;font-family:Consolas,Monaco,monospace}.ah-reading-guide p code{background:#edf3fa;color:#204d78;border-radius:4px;padding:2px 5px}\n.ah-reading-guide ol.ah-steps.ah-start-2{counter-reset:ah-step 1}\n.ah-reading-guide ol.ah-steps.ah-start-3{counter-reset:ah-step 2}\n.ah-reading-guide ol.ah-steps.ah-start-4{counter-reset:ah-step 3}\n.ah-reading-guide ol.ah-steps.ah-start-5{counter-reset:ah-step 4}\n.ah-reading-guide ol.ah-steps.ah-start-6{counter-reset:ah-step 5}\n.ah-reading-guide ol.ah-steps.ah-start-7{counter-reset:ah-step 6}\n.ah-reading-guide ol.ah-steps.ah-start-8{counter-reset:ah-step 7}\n.ah-reading-guide ol.ah-steps.ah-start-9{counter-reset:ah-step 8}\n.ah-reading-guide ol.ah-steps.ah-start-10{counter-reset:ah-step 9}\n.ah-reading-guide ol.ah-steps.ah-start-11{counter-reset:ah-step 10}\n.ah-reading-guide ol.ah-steps.ah-start-12{counter-reset:ah-step 11}\n.ah-reading-guide #ez-toc-container nav{max-height:460px;overflow-y:auto;padding-right:8px}.ah-reading-guide figure.ah-comparison-wide{max-height:650px;overflow:auto;border:1px solid #dae4ee;border-radius:12px}.ah-reading-guide .ah-comparison-wide table{min-width:760px;font-size:15px}.ah-reading-guide .ah-comparison-wide thead th{position:sticky;top:0;background:#183f65;color:#fff;z-index:1}.ah-reading-guide figure.ah-agency-summary tbody th{width:30%;background:#edf4fa;color:#244764;font-weight:700}\n.ah-reading-guide #ez-toc-container a.ez-toc-link::before{content:none!important;display:none!important}\n.ah-reading-guide .ah-comparison-wide thead th,.ah-reading-guide .ah-comparison-wide thead th *{color:#fff!important}\n.ah-reading-guide .ah-equation{display:block;margin:16px 0;padding:16px 20px;border-left:4px solid #2378b9;background:#edf4fa;border-radius:8px;font-size:20px;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}\n.ah-reading-guide .ah-feature-comparison thead th:nth-child(1){width:18%}.ah-reading-guide .ah-feature-comparison thead th:nth-child(2){width:12%;white-space:nowrap}.ah-reading-guide .ah-feature-comparison thead th:nth-child(3){width:48%}.ah-reading-guide .ah-feature-comparison thead th:nth-child(4){width:22%}\n.ah-reading-guide.ah-compact-toc #ez-toc-container ul.ez-toc-list>li>ul>li>ul{display:none}.ah-reading-guide h4.ah-do{color:#276044!important}.ah-reading-guide h4.ah-dont{color:#855218!important}.ah-reading-guide p.ah-tool-bullet{margin:.45em 0!important;padding:.6em 1em;border-radius:8px;background:#f4f7fa;line-height:1.65}\n.ah-reading-guide .ah-glossary-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;margin:30px 0}.ah-reading-guide .ah-glossary-entry{background:#f7f9fc;border:1px solid #dce5ef;border-radius:12px;padding:22px;height:100%;box-sizing:border-box}.ah-reading-guide .ah-glossary-entry h2{font-size:21px!important;margin:0 0 14px!important;line-height:1.4!important;border:0;padding:0}.ah-reading-guide .ah-glossary-entry p{font-size:16px!important;line-height:1.7!important;margin:0!important}@media(max-width:650px){.ah-reading-guide .ah-glossary-grid{grid-template-columns:1fr}}\n.ah-reading-guide .ah-glossary-grid{display:block}.ah-reading-guide .ah-glossary-grid>.wp-block-group__inner-container{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;align-items:stretch}.ah-reading-guide .ah-glossary-entry{height:auto!important;margin:0!important;min-width:0}.ah-reading-guide .ah-glossary-grid>.wp-block-group__inner-container>.wp-block-greenshift-blocks-container{display:flex;min-width:0}.ah-reading-guide .ah-glossary-grid>.wp-block-group__inner-container>.wp-block-greenshift-blocks-container>.ah-glossary-entry{flex:1}@media(max-width:650px){.ah-reading-guide .ah-glossary-grid>.wp-block-group__inner-container{grid-template-columns:1fr}}\n.ah-reading-guide ol.ah-steps.ah-feature-grid{grid-template-columns:repeat(2,minmax(0,1fr))}@media(max-width:700px){.ah-reading-guide ol.ah-steps.ah-feature-grid{grid-template-columns:1fr}}\n.ah-reading-guide pre.wp-block-preformatted{background:#122238;color:#eff6ff;border:1px solid #29415f;border-radius:12px;padding:22px 24px;margin:24px 0;overflow-x:auto;font-size:15px;line-height:1.7;white-space:pre;tab-size:4;font-family:Consolas,Monaco,monospace}.ah-reading-guide pre.wp-block-preformatted code{background:transparent;color:inherit;padding:0;white-space:pre;font:inherit}.ah-reading-guide .ah-output-sample{max-height:360px;overflow:auto;padding:24px;border:1px solid #d7e5f1;border-radius:12px;background:#f5f9fd;font-size:16px;line-height:1.8}\n.ah-reading-guide pre.wp-block-preformatted,.ah-reading-guide pre.wp-block-preformatted code{white-space:pre!important;text-align:left!important}.ah-reading-guide pre br{display:initial!important}\n.ah-reading-guide .wp-block-media-text{display:grid!important;grid-template-columns:minmax(120px,22%) minmax(0,1fr)!important;gap:24px;padding:28px;border:1px solid #d7e5f1;border-radius:14px;background:#f5f9fd;align-items:center!important}.ah-reading-guide .wp-block-media-text__content{min-width:0;max-width:none!important;width:auto!important;padding:0!important}.ah-reading-guide .wp-block-media-text__content p{width:auto!important;max-width:none!important;text-align:left!important}.ah-reading-guide .wp-block-media-text__content p:not(:first-child) strong{font-weight:400}.ah-reading-guide .wp-block-media-text__media{margin:0!important;min-width:0}.ah-reading-guide .wp-block-media-text__media img{width:100%;max-width:160px;height:auto;margin:auto}.ah-reading-guide .wp-block-media-text__content .wp-block-button{max-width:100%}@media(max-width:650px){.ah-reading-guide .wp-block-media-text{grid-template-columns:1fr!important;padding:20px}.ah-reading-guide .wp-block-media-text__media{grid-column:1!important;grid-row:1!important}.ah-reading-guide .wp-block-media-text__content{grid-column:1!important;grid-row:2!important}}.ah-reading-guide h3.ah-research-two:before{content:\"2. \"}.ah-reading-guide h3.ah-research-three:before{content:\"3. \"}<\/style><noscript><style>.ah-reading-guide [data-aos]{opacity:1!important;visibility:visible!important;transform:none!important}<\/style><\/noscript><p class=\"ah-lead\">An accurate forecast of your <a  data-ilj-link-preview=\"true\"  data-featured-image=\"https:\/\/www.aihello.com\/resources\/wp-content\/uploads\/2022\/02\/boost-sales-300x200.jpg\"  data-excerpt=\"Unlock Amazon&#039;s Brand Referral Bonus! Discover how driving external traffic, especially from Google Ads, boosts your sales, increases organic reach, and earns rewards.\" href=\"https:\/\/www.aihello.com\/resources\/blog\/boost-amazon-sales-using-google-ads\/\">sales<\/a> and can help you to manage inventory more efficiently. However, it is hard to account for &nbsp;the various factors that affect sales, to capture seasonal changes, and the pattern changes over time. Thanks to Artificial Intelligence, and more specifically <a  data-ilj-link-preview=\"true\"  data-featured-image=\"https:\/\/www.aihello.com\/resources\/wp-content\/uploads\/2019\/05\/18297-1-300x116.jpg\"  data-excerpt=\"Predict grocery sales using Multivariate Time Series Forecasting. This article explores LSTNet, combining RNN and CNN for accurate e-commerce sales prediction.\" href=\"https:\/\/www.aihello.com\/resources\/blog\/multivariate-time-series-forecasting-using-deep-neural-networks\/\">deep learning<\/a>, this task has been made much more accessible and we can now predict the sales efficiently using a neural network that analyses sequential data and temporal data.<\/p><p>If that last sentence confused the hell out of you, well, fear not. This article is not going to be a highly technical plunge into the nitty-gritty of deep learning networks. (If that\u2019s your thing however do check out this <strong><a href=\"https:\/\/www.aihello.com\/resources\/multivariate-time-series-forecasting-using-deep-neural-networks\/\">article<\/a><\/strong> which explains the problem from a more technical perspective).<\/p><p>This article &nbsp;will focus more on the what using a artificial <a  data-ilj-link-preview=\"true\"  data-featured-image=\"https:\/\/www.aihello.com\/resources\/wp-content\/uploads\/2019\/05\/18297-1-300x116.jpg\"  data-excerpt=\"Predict grocery sales using Multivariate Time Series Forecasting. This article explores LSTNet, combining RNN and CNN for accurate e-commerce sales prediction.\" href=\"https:\/\/www.aihello.com\/resources\/blog\/multivariate-time-series-forecasting-using-deep-neural-networks\/\">neural network<\/a> entails, and what it can mean for a business, how it can analyse multiple features to make an accurate prediction. We will be demonstrating this using a publicly available dataset.<\/p><div class=\"wp-block-greenshift-blocks-container gspb_container gspb_container-gsbp-f916-1\" id=\"gspb_container-id-gsbp-f916-1\" data-aos=\"fade\" data-aos-easing=\"ease\" data-aos-duration=\"500\" data-aos-once=\"true\"><h2 id=\"problem-description\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Problem_Description\"><\/span>Problem Description<span class=\"ez-toc-section-end\"><\/span><\/h2><\/div><p>First off, we propose the problem we would like to solve. Our goal is to forecast the total sales for a retail chain across all its stores. Given sales data 2 months. Sounds good? Let\u2019s take a look at our data. This data was extracted from Kaggle dataset \u2014 <a href=\"https:\/\/www.kaggle.com\/c\/rossmann-store-sales\/data\">Rossman Sales Data.<\/a> Let\u2019s take a look at our data:<\/p><h4 id=\"rossman-store-sales-data\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Rossman_Store_Sales_Data\"><\/span>Rossman Store Sales Data<span class=\"ez-toc-section-end\"><\/span><\/h4><p>The figure shows the first 10 rows of the data. The column \u2018Promo\u2019 tells whether there was a promotional offer going on during the day. The column \u2018DayOfWeek\u2019 specifies what day it was\u200a\u2014\u200a1= Monday, 2= Tuesday\u20267=Sunday and so on. The number of customers and the total sales are both targets we would like to predict for the future.<\/p><p>This is a very simplified approach and we have neglected factors such as geographic locations of individual stores and whether there was a holiday that affected each store. But since we are interested in how the chain is doing as a whole, our data model should be able to predict sales with fairly accurate results.<\/p><h2 id=\"data-exploration\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Data_Exploration\"><\/span>Data Exploration<span class=\"ez-toc-section-end\"><\/span><\/h2><p>Before we go ahead and build our model let\u2019s explore the data to unravel any relations the data might hold. We would also like to see any general trends in the sales data over time. In particular, we are looking for any trends in terms of seasonality, or based on the day of week or whether there was a promotional offer on a given day.<\/p><h3 id=\"1-day-of-the-week\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_Day_Of_The_Week\"><\/span>1. Day Of The Week<span class=\"ez-toc-section-end\"><\/span><\/h3><h4 id=\"sales-on-each-day\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Sales_on_each_day\"><\/span>Sales on each day<span class=\"ez-toc-section-end\"><\/span><\/h4><p>The plot given above shows the sales on each day. Taking a close look, we see that there is a trend to this data \u2014 The sales seem to plummet every 7th day. On a closer inspection we can see that these dates corresponds to Sundays. It takes off again on Monday, and Mondays seem to be the best day for business.<\/p><p>Indeed, when we average the sale for each day (given below) we see this clearly.<\/p><h4 id=\"sales-by-day\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Sales_by_day\"><\/span>Sales by day<span class=\"ez-toc-section-end\"><\/span><\/h4><h3 id=\"yearly-trend\" class=\"wp-block-heading ah-research-two\"><span class=\"ez-toc-section\" id=\"Yearly_Trend\"><\/span> Yearly Trend<span class=\"ez-toc-section-end\"><\/span><\/h3><p>Let\u2019s see if there\u2019s a yearly trend. Plotted below is the average sales for each month. We see that sales peak towards the last few days of the year. September and October are not great months for sales either. However there is no periodicity here.<\/p><h3 id=\"promotions\" class=\"wp-block-heading ah-research-three\"><span class=\"ez-toc-section\" id=\"Promotions\"><\/span> Promotions<span class=\"ez-toc-section-end\"><\/span><\/h3><p>Promotions have a big impact. The sales almost doubled when a promotion was available:<\/p><div class=\"wp-block-greenshift-blocks-container gspb_container gspb_container-gsbp-f916-2\" id=\"gspb_container-id-gsbp-f916-2\" data-aos=\"fade\" data-aos-easing=\"ease\" data-aos-duration=\"500\" data-aos-once=\"true\"><h2 id=\"building-our-model\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Building_Our_Model\"><\/span>Building Our Model<span class=\"ez-toc-section-end\"><\/span><\/h2><\/div><p>We will train our model to predict the sales based on the data, and we will explore if our predictions are able to factor in the relations we mentioned here<\/p><p>A neural <a  data-ilj-link-preview=\"true\"  data-featured-image=\"https:\/\/www.aihello.com\/resources\/wp-content\/uploads\/2024\/12\/image-33-300x185.png\"  data-excerpt=\"Unlock the power of knowledge graphs for AI, LLMs &amp; RAG. Discover how to build efficient, cost-effective KGs with SpaCy: entity and relation extraction made easy.\" href=\"https:\/\/www.aihello.com\/resources\/blog\/creating-a-knowledge-graph-without-llms\/\">network<\/a> will be able to model the sales on a particular day as a function of the sales data of the days prior to it. However, some important factors to be considered :<\/p><ol class=\"ah-steps\"><li><p>Our model should be able to detect dips and peaks in sales data based on external factors \u2014 like promo code.<\/p><\/li><li><p>There is a periodicity in this data. The sales data tend to be periodic by the week. So after every 7 days we see a similar trend.<\/p><\/li><\/ol><div class=\"wp-block-group ah-definition\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\"><p>To consider all these into account, we use a novel architecture called LSTNet- which uses a convolutional neural network that analyses how each variable affects the sales on that day. We will use this in conjunction with a Recurrent Neural Network that analyse data by each day. Further we use another layer which factors in the fact that the sales trend is periodic by each week.ta<\/p><\/div><\/div><p>The features that we passed to the network are &#8211;<\/p><ol class=\"ah-steps\"><li><p>Sales Data on each day ( Integer)<\/p><\/li><li><p>The day of the week ( 1 = Monday ..to 7= Sunday)<\/p><\/li><li><p>Promotion ( 1= Yes, 0 = No)<\/p><\/li><\/ol><div class=\"wp-block-group ah-callout\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\"><p><i>It\u2019s worth mentioning here that training a model requires finding out the accurate hyper-parameters such as the number of epochs, number of timesteps to consider for making an accurate prediction. If this number is too high, the model runs the risk of over-fitting and taking too much runtime. Too low and the model will not be able to converge, and make an accurate prediction. <\/i><\/p><p><i>However these details are omitted here and are discussed in this article.<\/i><\/p><\/div><\/div><div class=\"wp-block-greenshift-blocks-container gspb_container gspb_container-gsbp-f916-3\" id=\"gspb_container-id-gsbp-f916-3\" data-aos=\"fade\" data-aos-easing=\"ease\" data-aos-duration=\"500\" data-aos-once=\"true\"><h2 id=\"how-close-did-we-get\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_close_did_we_get\"><\/span>How close did we get?<span class=\"ez-toc-section-end\"><\/span><\/h2><\/div><p>Having trained our model and collected the results, it\u2019s time to analyse them to see how our model is performing.<\/p><p>The graph below shows the predictions by each day, where the blue line represents the prediction:<\/p><!-- Preserved legacy layout tags: [et_pb_image src=\"https:\/\/www.aihello.com\/resources\/wp-content\/uploads\/2019\/05\/0_gfX_KfeG6Kxl99Xh.png\" _builder_version=\"3.22.5\"][\/et_pb_image][et_pb_text _builder_version=\"3.22.5\"] --><figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.aihello.com\/resources\/wp-content\/uploads\/2019\/05\/0_gfX_KfeG6Kxl99Xh.png\" alt=\"\"><figcaption>Predictions by day<\/figcaption><\/figure><p>The periodicity is captured almost flawlessly by the model, and the peaks on each day are very close. Some aberrations in the peak sales value occur, but this could be due to holidays which we have not factored in yet.<\/p><p>Here\u2019s the total sales calculated for each week. Calculating this on a weekly basis makes sense because stocks and <a  data-ilj-link-preview=\"true\"  data-featured-image=\"https:\/\/www.aihello.com\/resources\/wp-content\/uploads\/2022\/06\/mistake-300x215.jpg\"  data-excerpt=\"Master Amazon SEO to beat competition! Learn how the A10 search engine works and discover strategies to boost your product rankings and sales on the Marketplace.\" href=\"https:\/\/www.aihello.com\/resources\/blog\/amazon-seo-strategy-tips-and-tricks-for-beginners\/\">strategy<\/a> can usually be planned on a weekly basis in the retail market industry:<\/p><!-- Preserved legacy layout tags: [et_pb_image src=\"https:\/\/www.aihello.com\/resources\/wp-content\/uploads\/2019\/05\/0_sWJF3KCCb7s46adv.png\" _builder_version=\"3.22.5\"][\/et_pb_image][et_pb_text _builder_version=\"3.22.5\"] --><figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.aihello.com\/resources\/wp-content\/uploads\/2019\/05\/0_sWJF3KCCb7s46adv.png\" alt=\"\"><figcaption>Predictions for each week<\/figcaption><\/figure><p>The blue bar represents the prediction and the red bar represents the actual sales value.We can see that the error is minimal, and the prediction is accurate in most cases, and this is without even considering factors such as holidays externally.<\/p><!-- Preserved legacy layout tags: [et_pb_text _builder_version=\"3.22.5\"] --><div class=\"wp-block-greenshift-blocks-container gspb_container gspb_container-gsbp-f916-4\" id=\"gspb_container-id-gsbp-f916-4\" data-aos=\"fade\" data-aos-easing=\"ease\" data-aos-duration=\"500\" data-aos-once=\"true\"><h2 id=\"how-can-you-use-this-approach-to-fit-your-business-problems\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_can_you_use_this_approach_to_fit_your_business_problems\"><\/span>How can you use this approach to fit your business problems?<span class=\"ez-toc-section-end\"><\/span><\/h2><\/div><p>This demonstration was rather a simplistic approach to the forecasting problem although with very promising results. There may be multiple factors that would affect the sales of an enterprise.<\/p><p>In the case of our dataset, factoring in individual store locations and the holidays that affect each store could have made our predictions better. The geographic location would have helped <a  data-ilj-link-preview=\"true\"  data-featured-image=\"https:\/\/www.aihello.com\/resources\/wp-content\/uploads\/2022\/06\/selling-on-amazon-mexico-300x225.jpg\"  data-excerpt=\"Mexico&#039;s eCommerce boom presents huge opportunities for Amazon sellers. This guide explores the thriving Mexican online market, Amazon.mx&#039;s growth, and key considerations for successfully selling your products to millions of Mexican consumers. Learn how to navigate logistics, expand your reach, and capitalize on this expanding market.\" href=\"https:\/\/www.aihello.com\/resources\/blog\/how-to-launch-an-amazon-mexico-business\/\">us<\/a> to see which areas performed better and modify the strategy of the organisation.<\/p><p>In case of an <a  data-ilj-link-preview=\"true\"  data-featured-image=\"https:\/\/www.aihello.com\/resources\/wp-content\/uploads\/2017\/09\/14852061501918-300x166.jpg\"  data-excerpt=\"E-commerce didn&#039;t kill physical stores, but consumers still find flaws. Uncover top frustrations like queues, stock problems, and poor staff training.\" href=\"https:\/\/www.aihello.com\/resources\/blog\/the-4-realities-that-most-frustrate-and-annoy-buyers-in-physical-stores\/\">e-commerce<\/a> seller who is interested in seeing the trend for each product, the factors affecting their &nbsp;sales might include the price of the product, the location of <a  data-ilj-link-preview=\"true\"  data-featured-image=\"https:\/\/www.aihello.com\/resources\/wp-content\/uploads\/2022\/05\/amazon-fba-worth-it-2022-make-money-on-amazon-advertising-300x200.jpg\"  data-excerpt=\"Considering Amazon FBA to make money online? Learn how it works, its benefits, drawbacks, and if it&#039;s still a viable option for your e-commerce business.\" href=\"https:\/\/www.aihello.com\/resources\/blog\/is-amazon-fba-worth-it\/\">shipping<\/a> and origin, and even the weather conditions( if they are into selling, say, winter boots). Here we have demonstrated that these factors can be easily fed into a neural network to unravel these mysterious correlations and gain better understanding of future sales.<\/p><p>Additionally, we can also tune the periodicity, to look for long-term or short-term patterns. In our case, the pattern was weekly. It could be every quarter or even every year. The beauty of the LSTNet model we used is that all this additional information can be fed into the network.<\/p><h2 id=\"conclusion\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2><p>Well, I hope you enjoyed reading this article and that it helped you gain an understanding about how you can tap into the power of AI to boost your business.<\/p><p class=\"ah-callout\">Please feel free to ask away any questions <a  data-ilj-link-preview=\"true\"  data-featured-image=\"https:\/\/www.aihello.com\/resources\/wp-content\/uploads\/2020\/04\/images-1-300x147.jpg\"  data-excerpt=\"Optimize your Amazon seller journey! Discover how FBA streamlines shipping, boosts seller ratings, and leverages customer feedback for online success.\" href=\"https:\/\/www.aihello.com\/resources\/blog\/key-terms-you-need-to-know-when-you-start-out-as-a-seller\/\">you might<\/a> have in the comment section!<\/p><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>Master sales forecasting with AI and deep learning! Discover how neural networks analyze data to predict sales accurately, optimize inventory, and boost your business.<\/p>\n","protected":false},"author":1,"featured_media":932,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_gspb_post_css":".gspb_container-id-gsbp-f916-1,.gspb_container-id-gsbp-f916-2,.gspb_container-id-gsbp-f916-3,.gspb_container-id-gsbp-f916-4{flex-direction:column;box-sizing:border-box}#gspb_container-id-gsbp-f916-1.gspb_container>p:last-of-type,#gspb_container-id-gsbp-f916-2.gspb_container>p:last-of-type,#gspb_container-id-gsbp-f916-3.gspb_container>p:last-of-type,#gspb_container-id-gsbp-f916-4.gspb_container>p:last-of-type{margin-bottom:0}#gspb_container-id-gsbp-f916-1.gspb_container.aos-animate,#gspb_container-id-gsbp-f916-1.gspb_container[data-gs-aos],#gspb_container-id-gsbp-f916-2.gspb_container.aos-animate,#gspb_container-id-gsbp-f916-2.gspb_container[data-gs-aos],#gspb_container-id-gsbp-f916-3.gspb_container.aos-animate,#gspb_container-id-gsbp-f916-3.gspb_container[data-gs-aos],#gspb_container-id-gsbp-f916-4.gspb_container.aos-animate,#gspb_container-id-gsbp-f916-4.gspb_container[data-gs-aos]{opacity:1;transform:translateZ(0)}#gspb_container-id-gsbp-f916-1.gspb_container,#gspb_container-id-gsbp-f916-2.gspb_container,#gspb_container-id-gsbp-f916-3.gspb_container,#gspb_container-id-gsbp-f916-4.gspb_container{position:relative;transition-duration:.5s;transition-timing-function:var(--gs-root-animation-easing, cubic-bezier(0.42, 0, 0.58, 1));opacity:var(--gs-root-animation-opacity, 0);transition-property:opacity,transform,filter;box-sizing:border-box}","footnotes":""},"categories":[40,38],"tags":[52,51,53,54],"republish_tag":[],"class_list":["post-916","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-demand-forecasting","category-e-commerce-logistics","tag-amazon-seller-service","tag-amazon-seller-tools","tag-automation-fba","tag-shopify-automation"],"_links":{"self":[{"href":"https:\/\/www.aihello.com\/resources\/wp-json\/wp\/v2\/posts\/916","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.aihello.com\/resources\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.aihello.com\/resources\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.aihello.com\/resources\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.aihello.com\/resources\/wp-json\/wp\/v2\/comments?post=916"}],"version-history":[{"count":1,"href":"https:\/\/www.aihello.com\/resources\/wp-json\/wp\/v2\/posts\/916\/revisions"}],"predecessor-version":[{"id":14384,"href":"https:\/\/www.aihello.com\/resources\/wp-json\/wp\/v2\/posts\/916\/revisions\/14384"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.aihello.com\/resources\/wp-json\/wp\/v2\/media\/932"}],"wp:attachment":[{"href":"https:\/\/www.aihello.com\/resources\/wp-json\/wp\/v2\/media?parent=916"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.aihello.com\/resources\/wp-json\/wp\/v2\/categories?post=916"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.aihello.com\/resources\/wp-json\/wp\/v2\/tags?post=916"},{"taxonomy":"republish_tag","embeddable":true,"href":"https:\/\/www.aihello.com\/resources\/wp-json\/wp\/v2\/republish_tag?post=916"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}