Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Knowledge Base

Definitive answers from Designer Desktop experts.

Time Series Factory Tools vs Batch Macro Time Series

SandeepSK
Alteryx Alumni (Retired)
Created
dcvsmarvel.fandom.com/wiki/Superman_vs._Hulkdcvsmarvel.fandom.com/wiki/Superman_vs._Hulk

The pre-requisites to reading this article are Performing Time Series Forecasting in Alteryx Designer written by@PamW,and Build Your First Batch Macro! written by@JoeM.

Imagine you have a data set with sales data for eight different wines for years 1992 to 2018 and you’d like to predict the next 6 years of sales for each of these. This can be performed by building a batch macro around the Time Series tools, or by using the Time Series (TS) Factory tools.

Factory Time Series

Batch Macro Time Series

Ease of use, tools just need configuring

Macro requires building, does not come pre-built

Shorter run time

Longer run time

Minimum record count: Annual – 2 records, Quarterly – 8 records, Monthly – 24 records [Note: you always need 2 years of data for each time unit]

No minimum historical record count, but fewer records produce a poor forecast with little to no change

No interactive reporting

No interactive reporting

Date aggregation functionality – e.g. monthly data and forecasting on a yearly basis, automatically aggregates months in the same year, but require a date type field

No date aggregation functionality

Automatically brings through group name for which you are forecasting (e.g. Wine type)

Group name (e.g. Wine type) is not automatically appended to forecast output, must be configured in macro

ARIMA and ETS modeling

ARIMA and ETS modeling

Below is the workflow using the batch macro. The batch macro requires a control parameter (indicated by the “¿” input anchor), which in this case is the wine type; hence a list of wine types is passed to the macro, as well as the data set containing all the sales data.




clipboard_image_3.png

The workflow inside the macro can be seen below. The macro inputs all the wine data, then filters by the wine type from the wine type control parameter list. The sales data for each wine type is then used to build the time series model and forecast the next six years. The wine type is then appended to the forecasted years and output. This is done for each wine type, with the forecasting results being stacked on top of one another as the workflow output.

clipboard_image_4.png



The output of the workflow can be seen below, with each run of the macro being stacked onto one another. The configuration for each of the tools and the macro can be seen in the attached workflow.


clipboard_image_5.png



The alternative to using a batch macro to predict wine sales is the TS Factory time series tools, which can be downloaded via the Alteryx public gallery (TS Model Factory, TS Forecast Factory). The TS Model Factory tool is used to build the time series models and the TS Forecast Factory is used to forecast a user-defined number of periods. The workflow using these tools can be seen below.

clipboard_image_0.png

The TS Factory tools can build time series models and forecasts for multiple sets of historical data groups, without the need to separate them. All that is required is that within your data, exists a field to identify each set of historical data so it can be treated as a separate time series. In the wine example, this field is the Wine Type field, much like the control parameter for the batch macro. Then like the ordinary time series tools, a time series forecast is produced for the next 6 years based on the model built for each wine type. The output of this can be seen below:

clipboard_image_7.png



In conclusion, when working with multiple sets of historical data, there is more advantage in using the time series factory tools, especially if you are not familiar with building macros. Additionally, the factory time series are quicker to run and achieve the same result as the batch macro, with fewer tools and more functionality.

Attachments
Comments
rahmed
Alteryx Alumni (Retired)

This is great! Thank you for the information  😁

TLyle
7 - Meteor

The link for "TS Model Factory" sends me to "TS Forecast Factory".  I also can't find TS Model Factory on the gallery.  Can you update it?

TLyle
7 - Meteor

Nevermind,  I found the answer in another post. It is in the Predictive District:

https://gallery.alteryx.com/#!districts/56327e37aa690a17f0760bdc

 

TLyle
7 - Meteor

It seems that the TS Model Factory can only process around 25 products.  How can use it to forecast around 1000 different products? I don't necessarily need a different model for each product but i need for the model(s) to cover all the products.

TS factory model error.JPG

SandeepSK
Alteryx Alumni (Retired)

@TLyle  In this case you could make use of the batch macro approach if you did want to create an individual model for each product type. If you wanted to create one model that covered all of the product types, you could use the summarize tool to aggregate values across the products for the same time frame, such as sales figures. Then plug this into the time series tools to create a single forecast. Is this what you meant?

TLyle
7 - Meteor

@SandeepSK  Yes, that is roughly what i meant.  I don't need a model for each individual product but I do want an aggregated model that i could then apply back to the product level and i don't know how to do that.  For example i have attached real data (that i have muted) that looks like this below:

TLyle_1-1579121999850.png

There are 10 locations and around 60 different product ID's. I like to aggregate the Product ID's and create a model for each of the 10 locations and then apply that model back to each of the individual products in each location to forecast sales.  Is this type of thing possible?  What i am really after is an Product level sales forecast that also is robust at an aggregated location level.

 

Also, i can't figure out how to attach the example data file...

vivaisun11
7 - Meteor

Hey there,

I downloaded the TS Model Factory and the TS Forecast Factory tools, but they show up as workflows instead of icons with input and output nodes.

How do I go about using these tools?

 

Thanks

SandeepSK
Alteryx Alumni (Retired)

@vivaisun11 Hi Vijay, so the two tools are actually alteryx macros, so they are workflows underneath that you would save down that become drag and droppable tools. If you use the following link: https://help.alteryx.com/2018.2/Macro_Modules.htm , first navigate to the section on creating a macro repository. Essentially this is creating a folder to store Alteryx macros and linking this with Alteryx Designer. Once you've done that, there is a section just above that explaining how to save macros down. Once saved you'll find the factory time series tools in the time series categories.

 

Hope this helps 🙂

sheidari
8 - Asteroid

how can i compare the performance of the TS model and TS factory tools? I'd like to know how they perform before deciding on which one to deploy. 

cneivam
9 - Comet

Very nice article @SandeepSK , very usefull to me.

Thanks.

Gualigee
8 - Asteroid

https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Questions-about-times-series/m-p/93181...

 

I set ETS tool to (m,n,a) or (m,n,m), the difference between ETS tool and Factory tool is more than 10%. Can anyone please advise?

 

why does it have such a big difference?

 

Please refer to the link above which has the workflow and data. Thanks.

Charity_K_Wilson
10 - Fireball

Just discovered another reason to go with Batch Macro:

 

Greater control over model type.

 

I love the factory options.  Have used them so many times and so many ways.  But I'm producing some models where accuracy is pretty important.  And I need to be able to swap out modeling criteria.  Certain Divisions need to use a differencing component, others have drift, and a few others need a Box-Cox transformation with different levels of lambda.

 

So, I'm batching them with different modeling criteria.  And it works.