{"id":6067,"date":"2018-01-29T15:12:25","date_gmt":"2018-01-29T20:12:25","guid":{"rendered":"https:\/\/demand-planning.com\/?p=6067"},"modified":"2018-03-16T12:53:53","modified_gmt":"2018-03-16T16:53:53","slug":"how-to-make-your-own-powerful-machine-learning-forecasting-models-for-free-without-coding","status":"publish","type":"post","link":"https:\/\/demand-planning.com\/2018\/01\/29\/how-to-make-your-own-powerful-machine-learning-forecasting-models-for-free-without-coding\/","title":{"rendered":"How To Use Microsoft Azure"},"content":{"rendered":"<span class=\"cb-itemprop\" itemprop=\"reviewBody\"><p><strong>If, like me, you work in a small to medium sized enterprise where forecasting is still done with pen and paper, you\u2019d be forgiven for thinking that Machine Learning is the exclusive preserve of big budget corporations. If you thought that, then get ready for a surprise. Not only are advanced data science tools largely accessible to the average user, <u>you can also access them without paying a bean.<\/u> <\/strong><\/p>\n<p>If this sounds too good to be true, let me prove it to you with a quick tutorial that will show you just how easy it is to make and deploy a predictive webservice using Microsoft\u2019s Azure Machine Learning (ML) Studio, using real-world (anonymised) data.<\/p>\n<h2><strong>What is Azure ML?<\/strong><\/h2>\n<p>To most people the words \u2018Microsoft Azure\u2019 conjure up vague ideas of cloud computing and TV adverts with bearded-hipsters working in designer industrial lofts, and yet, in my opinion, the Azure Machine Learning Studio is one of the more powerful and leading predictive modelling tools available on the market. And again, its free.\u00a0 What\u2019s more, because it has a graphical user interface, you don\u2019t need any advanced coding or mathematical skills to use it. It\u2019s all click and drag. In fact, it is entirely possible to build a machine learning model from beginning to end without typing a single line of code. How\u2019s that for a piece of gold?<\/p>\n<p>You can make a free account or sign in as a guest here &#8211; <a href=\"https:\/\/studio.azureml.net\">https:\/\/studio.azureml.net\u00a0<\/a>The free account or guest sign-in to the Microsoft Azure Machine Learning Studio gives you complete access to their easy-to-use drag and drop graphical user interface that allows you to build, test, and deploy predictive analytics solutions.\u00a0 You don\u2019t need much more.<\/p>\n<h2><strong>Microsoft Azure Tutorial Time!<\/strong><\/h2>\n<p>I promised you a quick tutorial on how to make a forecast that drives purchasing and other planning decisions in Azure ML, and a quick tutorial you shall have.<\/p>\n<p>If you\u2019re still with me, here are a couple of resources to help you get rolling:<\/p>\n<p><strong>A great hands on lab:<\/strong> <a href=\"https:\/\/github.com\/Azure-Readiness\/hol-azure-machine-learning\">https:\/\/github.com\/Azure-Readiness\/hol-azure-machine-learning<\/a><\/p>\n<p><strong>Edx courses you can access for free:<\/strong> <a href=\"https:\/\/www.edx.org\/course\/principles-machine-learning-microsoft-dat203-2x-6\">https:\/\/www.edx.org\/course\/principles-machine-learning-microsoft-dat203-2x-6<\/a><\/p>\n<p><a href=\"https:\/\/www.edx.org\/course\/data-science-essentials-microsoft-dat203-1x-6\">https:\/\/www.edx.org\/course\/data-science-essentials-microsoft-dat203-1x-6<\/a><\/p>\n<p>Having pointed you in the direction of more expansive and detailed resources, it\u2019s time to get into this quick demo. Here are the basic steps we\u2019ll go through:<\/p>\n<ul>\n<li>Uploading datasets<\/li>\n<li>Exploring and visualising data<\/li>\n<li>Pre-processing and transforming<\/li>\n<li>Predictive modelling<\/li>\n<li>Publishing a model and using it in Excel<\/li>\n<\/ul>\n<h2><strong>Uploading Datasets To Microsoft Azure<\/strong><\/h2>\n<p>So, you\u2019ve signed up. Once you\u2019re in, you\u2019re going to want to upload some data. I\u2019m loading up the weekly sales data of a crystal glass product for the years 2016 and 2017 which I\u2019m going to try and forecast. \u00a0You can read in a flat file csv. format by clicking on the \u2018Datasets\u2019 icon and clicking the big \u2018+ New\u2019:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6068\" src=\"https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A1.png\" alt=\"\" width=\"220\" height=\"391\" srcset=\"https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A1.png 220w, https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A1-169x300.png 169w\" sizes=\"(max-width: 220px) 100vw, 220px\" \/> \u00a0\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6085\" src=\"https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A2.png\" alt=\"\" width=\"675\" height=\"308\" srcset=\"https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A2.png 675w, https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A2-300x137.png 300w, https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A2-600x274.png 600w\" sizes=\"(max-width: 675px) 100vw, 675px\" \/>\u00a0Then you\u2019re going to want to load up your data from the file location and give it a name you can find easily later. Clicking on the \u2018flask\u2019 icon and hitting the same \u2018+ New\u2019 button will open a new experiment. You can drag your uploaded dataset from the \u2018my datasets\u2019 list on to the blank workflow:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6086\" src=\"https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A3.png\" alt=\"\" width=\"877\" height=\"435\" srcset=\"https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A3.png 877w, https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A3-300x149.png 300w, https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A3-768x381.png 768w, https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A3-600x298.png 600w, https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A3-800x397.png 800w\" sizes=\"(max-width: 877px) 100vw, 877px\" \/><\/p>\n<h2>Exploring and Visualizing<\/h2>\n<p>Right clicking on the workflow module number (1) will give you access to exploratory data analysis tools either through \u2018Visualise\u2019, or by opening a<a href=\"http:\/\/jupyter.org\/\"> Jupyter<\/a> notebook (Jupyter is an open source web application) in which to explore the data in either Python or R code. If you want to learn how to use and apply Python to your forecasting, practical insights will also be revealed at IBF\u2019s upcoming <a href=\"https:\/\/ibf.org\/events\/neworleans2018\/\">New Orleans conference on Predictive Business Analytics &amp; Forecasting<\/a>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6069\" src=\"https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A4.png\" alt=\"\" width=\"455\" height=\"284\" srcset=\"https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A4.png 455w, https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A4-300x187.png 300w\" sizes=\"(max-width: 455px) 100vw, 455px\" \/><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-6070\" src=\"https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A5-1024x451.png\" alt=\"\" width=\"1024\" height=\"451\" srcset=\"https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A5-1024x451.png 1024w, https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A5-300x132.png 300w, https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A5-768x338.png 768w, https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A5-600x264.png 600w, https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A5-800x352.png 800w, https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A5.png 1125w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p>Clicking on the \u2018Visualise\u2019 option calls up a view of the data, summary statistics and graphs. A quick look at the histogram of sales quantity shows that the data has some very large outliers. I\u2019ll have to do something about those during the transformation step. You also get some handy summary statistics for each feature. Let\u2019s have a look at the sales quantity column.<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6071\" src=\"https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A6.png\" alt=\"\" width=\"428\" height=\"277\" srcset=\"https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A6.png 428w, https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A6-300x194.png 300w, https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A6-100x65.png 100w\" sizes=\"(max-width: 428px) 100vw, 428px\" \/><\/p>\n<p>I\u2019m guessing that zero will be Christmas week, when the office is closed. The max is likely to be a promotional offer. I can also see that the standard deviation is nearly 12,000 pieces, which is high compared to the mean. You can also compare columns\/features to each other to see if there is any correlation:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6072\" src=\"https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A7.png\" alt=\"\" width=\"1021\" height=\"427\" srcset=\"https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A7.png 1021w, https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A7-300x125.png 300w, https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A7-768x321.png 768w, https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A7-600x251.png 600w, https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A7-800x335.png 800w\" sizes=\"(max-width: 1021px) 100vw, 1021px\" \/>Looking at a scatter plot comparison of sales quantity to the consumer confidence index value, that really doesn\u2019t seem to be adding anything to the data. I\u2019ll want to get rid of that feature. I\u2019ve also included a quick Python line plot of sales over the two-year period.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6073\" src=\"https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A8.png\" alt=\"\" width=\"959\" height=\"481\" srcset=\"https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A8.png 959w, https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A8-300x150.png 300w, https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A8-768x385.png 768w, https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A8-600x301.png 600w, https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A8-800x401.png 800w\" sizes=\"(max-width: 959px) 100vw, 959px\" \/>As you can see, there is a lot of variability in the data and perhaps a slight downward trend. Without some powerful explanatory variables, this is going to be a challenge to accurately forecast. A lot of tutorials use rich datasets which the <a href=\"https:\/\/ibf.org\/events\/chicago-bootcamp2018\/\">Machine Learning<\/a> systems can predict well to give you a glossy version. I wanted to keep this real. I work in an SME and getting even basic sales data is an epic battle involving about fifty lines of code.<\/p>\n<h2>Pre-processing and Transforming<\/h2>\n<p>Now it\u2019s time to transform the data. For simplicity, I\u2019ve loaded a dataset with no missing or invalid entries by cleaning up and resampling sales by week with Python, but you can use the \u2018scrub missing values\u2019 module or execute a Python\/R script in the Azure ML workspace to take care of this kind of problem.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-6074\" src=\"https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A9.png\" alt=\"\" width=\"208\" height=\"279\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6075\" src=\"https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A10.png\" alt=\"\" width=\"491\" height=\"219\" srcset=\"https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A10.png 491w, https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A10-300x134.png 300w\" sizes=\"(max-width: 491px) 100vw, 491px\" \/><\/p>\n<p>In this case, all I need to do is change the \u2018week\u2019 column into a datetime feature (it loaded as a string object) and drop that OECD consumer confidence index feature as it wasn\u2019t helping. I could equally have excluded the column without code using the select columns module:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6088\" src=\"https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A11.png\" alt=\"\" width=\"453\" height=\"260\" srcset=\"https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A11.png 453w, https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A11-300x172.png 300w\" sizes=\"(max-width: 453px) 100vw, 453px\" \/><\/p>\n<p>One of the other things I\u2019m going to do is to trim outliers from the dataset using another \u2018Execute Python Script\u2019 module to identify and remove outliers from the sales quantity column so the results are not skewed by rare sales events.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6076\" src=\"https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A12.png\" alt=\"\" width=\"779\" height=\"239\" srcset=\"https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A12.png 779w, https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A12-300x92.png 300w, https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A12-768x236.png 768w, https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A12-600x184.png 600w\" sizes=\"(max-width: 779px) 100vw, 779px\" \/>Again, I could have accomplished a similar effect by using Azure\u2019s inbuilt \u2018Clip Values\u2019 module. You genuinely do not have to be able to write code to use Azure (but it helps.)<\/p>\n<p>There are too many possible options within the transformation step to cover in a single article. I will mention one more important step. You should normalise the data to stop differences in scale of the features leading to certain features dominating over others. 90% of the work in forecasting is getting and cleaning the data so that it is usable for analysis (Adobe, take note. Pdf\u2019s are evil and everyone who works with data hates them.) Luckily, you can do all your wrangling inside the machine model, so that when you use the service, it will do all the wrangling automatically based on your modules and code.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6077\" src=\"https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A13.png\" alt=\"\" width=\"493\" height=\"265\" srcset=\"https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A13.png 493w, https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A13-300x161.png 300w\" sizes=\"(max-width: 493px) 100vw, 493px\" \/><\/p>\n<p>The Normalize data module allows you to select columns and choose a method of normalisation including Zscores and Min-Max.<\/p>\n<h2>Predictive Modelling In Microsoft Azure<\/h2>\n<p>Having completed the data transformation stage, you\u2019re now ready to move on to the fun part &#8211; making a Machine Learning model. The first step is to split the data into a training set and a testing set. This should be a familiar practice for anyone working in forecasting. Before you let your forecast out into the wild you want to test how well it performs against the sales history. It\u2019s that or face a screaming sales manager wanting to know where his stock is. I like my life as stress-free as possible.As with nearly everything in Azure ML, data splitting can be achieved by selecting a module. Just click on the search pane and type in what you want to do. I\u2019m going to split my data 70-30.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6078\" src=\"https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A14.png\" alt=\"\" width=\"261\" height=\"289\" \/><\/p>\n<p>The next step is to connect the left output of the \u2018Split Data\u2019 module to the right input of a \u2018Train Model\u2019 module, the right output of the \u2018Split Data\u2019 to a \u2018Score Model\u2019 module, and a learning model to the right input of the \u2018Train model\u2019.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6089\" src=\"https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A15.png\" alt=\"\" width=\"481\" height=\"255\" srcset=\"https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A15.png 481w, https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A15-300x159.png 300w\" sizes=\"(max-width: 481px) 100vw, 481px\" \/><\/p>\n<p>At first this might seem a little complicated, but as you can see, the left output of the \u2018Split Data\u2019 is the training dataset which goes through the training model and then outputs the resulting learned technique to the \u2018Score Model\u2019 where this learned function is tested against the testing dataset which comes in through the right data input node. In the \u2018Train Model\u2019 module you must select a single column of interest. In this case it is the quantity of product sold that I want to know.\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-6091\" src=\"https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A16.png\" alt=\"\" width=\"705\" height=\"291\" srcset=\"https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A16.png 705w, https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A16-300x124.png 300w, https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A16-600x248.png 600w\" sizes=\"(max-width: 705px) 100vw, 705px\" \/><\/p>\n<p>Microsoft offer a couple of guides to help you choose the right machine learning algorithm. Here\u2019s a <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/machine-learning\/studio\/algorithm-choice\">broad discussion<\/a> and if short on time, check this <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/machine-learning\/studio\/algorithm-cheat-sheet\">lightning quick guidance<\/a>. In the above I\u2019ve opted for a simple Linear Regression module and for comparison purposes I\u2019ve included a Decision Forest Regression by adding connectors to the same \u2018Split Data\u2019 module. One of the great things about Azure ML is you can very quickly add and compare lots of models during your building and testing phase, and then clear them down before launching your web service.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6092\" src=\"https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/AA.png\" alt=\"\" width=\"478\" height=\"122\" srcset=\"https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/AA.png 478w, https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/AA-300x77.png 300w\" sizes=\"(max-width: 478px) 100vw, 478px\" \/><\/p>\n<p>Azure ML offers a wide array of machine learning algorithms from linear and polynomial regression to powerful adaptive boosted ensemble methods and neural networks. I think the best way to get to know these is to build your own models and try them out. As I have two competing models at work, I\u2019ve added in an \u2018Evaluate Model\u2019 module and linked in the two \u2018Score Model\u2019 modules so that I can compare the results. I\u2019ve also put in a quick Python script to graph the residuals and plot the forecasts against the results.<\/p>\n<p>Here\u2019s the Decision Forest algorithm predictions against the actual sales quantity:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6079\" src=\"https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A18.png\" alt=\"\" width=\"864\" height=\"406\" srcset=\"https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A18.png 864w, https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A18-300x141.png 300w, https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A18-768x361.png 768w, https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A18-600x282.png 600w, https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A18-800x376.png 800w\" sizes=\"(max-width: 864px) 100vw, 864px\" \/><\/p>\n<p>Clearly something happened around May 2016 that the Decision Forest model is unable to explain, but it seems to do quite well in finding the peaks over the rest of the period 2017. Looking at the Linear Regression model, one can see that it does a better job of finding the peak around May 2016 but is consistently overestimating in the latter half of 2017.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6093\" src=\"https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A19.png\" alt=\"\" width=\"878\" height=\"407\" srcset=\"https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A19.png 878w, https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A19-300x139.png 300w, https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A19-768x356.png 768w, https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A19-600x278.png 600w, https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A19-800x371.png 800w\" sizes=\"(max-width: 878px) 100vw, 878px\" \/><\/p>\n<p>Clicking on the \u2018Evaluate Model\u2019 module enables a more detailed statistical view of the comparative accuracy of the two models. The linear regression model is the top row and the decision forest model is the bottom row.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6094\" src=\"https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A20.png\" alt=\"\" width=\"694\" height=\"333\" srcset=\"https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A20.png 694w, https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A20-300x144.png 300w, https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A20-600x288.png 600w\" sizes=\"(max-width: 694px) 100vw, 694px\" \/><\/p>\n<p>Coefficient of determinations of 0.60 and 0.72. The models are explaining between half and three-quarters of the variance in sales. The Decision Forest overall scored significantly better. As results go, neither brilliant nor terrible. A perfect coefficient of determination of 1 would suggest the model was overfitted and therefore unlikely to perform well on new data. The range of sales was from 0 to nearly 80,000, so I\u2019ll take 4421 pieces of mean absolute error without a complaint.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6080\" src=\"https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A21.png\" alt=\"\" width=\"339\" height=\"427\" srcset=\"https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A21.png 339w, https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A21-238x300.png 238w\" sizes=\"(max-width: 339px) 100vw, 339px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6096\" src=\"https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A22.png\" alt=\"\" width=\"230\" height=\"116\" \/><\/p>\n<p>It would really be ideal if we had a little more information at the feature engineering stage. The ending inventory in-stock value from each week, or customer forecasts from the S&amp;OP process as features would help accuracy.<\/p>\n<p>One of the benefits of forecasting in this way is you can incorporate features without having to worry about how accurate they are as the model will figure that out for you. I\u2019d recommend having as many as possible and then pruning. I think the next step for this model would be to try incorporating inventory and S&amp;OP pipeline customer forecasts as a feature. Building a model is an iterative process and one can and should keep improving it over time.<\/p>\n<h2>Publishing A Model And Consuming It In Excel<\/h2>\n<p>Azure ML makes setting up a model as a webservice and using it in <a href=\"https:\/\/demand-planning.com\/2018\/01\/15\/little-known-forecasting-tools-excel-2016\/\">Excel<\/a> very easy. To deploy the model, simply click on the \u2018Setup Web Service\u2019 icon at the bottom of the screen.<\/p>\n<p>Once you\u2019ve deployed the webservice, you\u2019ll get an API (Application Programming Interface) key and a Request Response URL link. You\u2019ll need these to access your app in Excel and start predicting beyond your training and testing set. Finally, you\u2019re ready to open good old Excel. Go to the \u2018Insert tab\u2019 and select the \u2018Store\u2019 icon to download the free Azure add-in for Excel.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6081\" src=\"https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A23.png\" alt=\"\" width=\"907\" height=\"311\" srcset=\"https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A23.png 907w, https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A23-300x103.png 300w, https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A23-768x263.png 768w, https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A23-600x206.png 600w, https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A23-800x274.png 800w\" sizes=\"(max-width: 907px) 100vw, 907px\" \/><\/p>\n<p>Then all you need to do is click the \u2018+ Add web service\u2019 button and paste in your Response Request URL and your secure API key, so that only your team can access the service.<\/p>\n<p>After that it\u2019s a simple process to input the new sales weeks to be predicted for the item and the known data for other variables (in this case promotions, holiday days in the week, historic average annual\/seasonal sales pattern for the category etc.). You can make this easy by clicking on the \u2018Use sample data\u2019 to populate the column headers so you don\u2019t have to remember the order of the columns used in the training set.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6082\" src=\"https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A24.png\" alt=\"\" width=\"327\" height=\"384\" srcset=\"https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A24.png 327w, https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A24-255x300.png 255w\" sizes=\"(max-width: 327px) 100vw, 327px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6083\" src=\"https:\/\/demand-planning.com\/wp-content\/uploads\/2018\/01\/A25.png\" alt=\"\" width=\"230\" height=\"294\" \/><\/p>\n<p>Congratulations! You now have a basic predictive webservice built for producing forecasts. By adding in additional features to your dataset and retraining and improving the model, you can rapidly build up a business specific forecasting function using Machine Learning that is secure, shareable and scalable.<\/p>\n<p>Good luck!<\/p>\n<p><strong>If you\u2019re keen to leverage Python and R in your forecasting, we also recommend attending IBF\u2019s upcoming <\/strong><a href=\"https:\/\/ibf.org\/events\/neworleans2018\/\"><strong>Predictive Analytics, Forecasting &amp; Planning conference<\/strong><\/a><strong> in New Orleans where attendees will receive hands-on Python training. For practical and step-by-step insight into applying Machine Learning with R for forecasting in your organization, check out IBF\u2019s <\/strong><a href=\"https:\/\/ibf.org\/events\/chicago-bootcamp2018\/\"><strong>Demand Planning &amp; Forecasting Bootcamp w\/ Hands-On Data Science &amp; Predictive Business Analytics Workshop in Chicago<\/strong><\/a><strong>.<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<\/span>","protected":false},"excerpt":{"rendered":"<p>If, like me, you work in a small to medium sized enterprise where forecasting is still done with pen and paper, you\u2019d be forgiven for thinking that Machine Learning is the exclusive preserve of big budget corporations. If you thought that, then get ready for a surprise. Not only are advanced data science tools largely [&hellip;]<\/p>\n","protected":false},"author":5255,"featured_media":6101,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[390,393,387,339],"tags":[341,35,342,340],"class_list":{"0":"post-6067","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-advanced-analytics","8":"category-how-to-guides-forecasting","9":"category-models-and-methods","10":"category-predictive-analytics-predictive-analytics","11":"tag-excel","12":"tag-forecasting","13":"tag-machine-learning","14":"tag-microsoft-azure"},"_links":{"self":[{"href":"https:\/\/demand-planning.com\/wp-json\/wp\/v2\/posts\/6067"}],"collection":[{"href":"https:\/\/demand-planning.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/demand-planning.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/demand-planning.com\/wp-json\/wp\/v2\/users\/5255"}],"replies":[{"embeddable":true,"href":"https:\/\/demand-planning.com\/wp-json\/wp\/v2\/comments?post=6067"}],"version-history":[{"count":0,"href":"https:\/\/demand-planning.com\/wp-json\/wp\/v2\/posts\/6067\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/demand-planning.com\/wp-json\/wp\/v2\/media\/6101"}],"wp:attachment":[{"href":"https:\/\/demand-planning.com\/wp-json\/wp\/v2\/media?parent=6067"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/demand-planning.com\/wp-json\/wp\/v2\/categories?post=6067"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/demand-planning.com\/wp-json\/wp\/v2\/tags?post=6067"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}