There are two main steps for integrating open source forecasting models into SAS Visual Forecasting, each with increasing benefits and value:
- The Foundation: Accelerate Open Source Forecasts Programmatically
- Sharing the Wealth: Open Source Forecasts as a Custom Modeling Node
Step 1: The Foundation: Accelerate Open Source Forecasts Programmatically
The foundation to integrating open source forecasting models into SAS is running the process programmatically through a code-based approach. You’ve read about the power of the TSMODEL procedure and the EXTLANG package.
Within the TSMODEL procedure, there are several options for running open source models. You can run only open source models, leveraging SAS as the infrastructure for accelerating and operationalizing your open source strategy. You can take this one step further and run open source models alongside SAS models, for which SAS automatically selects the best-fit model across SAS and open source at a time series level. You can even combine SAS and open source models, and SAS will determine whether the combination of SAS and open source is the most appropriate for each time series. This approach enables the best of both worlds by leveraging all the efforts you’ve already put in building open source models, while also incorporating additional SAS algorithms. You don’t have to know ahead of time which modeling approach is optimal, SAS will do the heavy lifting for you. SAS determines for every single time series whether to select the open source or SAS model, or a combination of the two. In a world where choices are endless, this is one less choice you have to make (See? We’re saving you time already!)
Figure 2 illustrates the TSMODEL procedure and EXTLANG package in action. This is an example of running a R auto.arima function with SAS. When using the EXTLANG package, there is flexibility with how to read the open source code. You can write out the open source code explicitly within SAS (as in Figure 2), or you can read in the open source code from a specified file.
Figure 2. Programmatically Running a R model with the SAS TSMODEL procedure and EXTLANG package
With this foundational step, open source and SAS forecast models run programmatically. The resulting forecasts can easily be fed into a downstream planning or execution system for consumption by a broader business audience. To gain additional benefits, you can build upon this foundational programmatic approach by taking the TSMODEL code and wrapping it up into a custom modeling node within the SAS Visual Forecasting user interface.
Step 2: Sharing the Wealth: Open Source Forecasts as a Custom Modeling Node
SAS Visual Forecasting Model Studio User Interface enhances collaboration with the ability to create custom nodes and load them into the Exchange for use within model pipelines. The custom node leverages the EXTLANG capability to run any R or Python forecast model. You can create many of these nodes if there are different techniques you would like to use. The payoff is multi-fold. These nodes can be applied to any forecasting project and shared with your team to enhance collaboration. Once created, they can be reused in different pipelines and even with different data inputs. See Figure 3.
Figure 3. Open Source Forecast Node loaded to the Exchange
Your custom modeling node can be added to any model pipeline, in which you can mix and match SAS forecasting techniques and your open source node(s). Your pipeline runs a tournament with multiple open source and SAS algorithms, and SAS performs an evaluation to identify the best fit model per your specifications. Using a model comparison node, you have a quick, transparent way to manage multiple open source and SAS techniques and compare them to assess the best modeling strategy. See Figure 4.
Figure 4. Custom Node for Open Source forecasting in a Pipeline
Using the SAS Visual Forecasting User Interface, you get all the value of the programmatic approach, including distributed workloads and model selection across open source and SAS. But wait, there’s more. This approach comes with the additional benefits of increasing productivity and transparency, a governed workflow with overrides and exception management, and integration with visualizations. These visualizations are integrated into the UI, and help you better understand and assess the forecasting models without additional effort. The experience is much more interactive and collaborative and expands the audience beyond coders.
Whether you take the programmatic approach or build a custom modeling node within the Visual Forecasting UI, SAS enables scalable, resilient forecasting for transitioning from small project to enterprise solution.
To recap, SAS Visual Forecasting extends open source forecasting strategies. TSMODEL is the underlying procedure to SAS Visual Forecasting, and the EXTLANG package enables integration with open source languages. TSMODEL and EXTLANG make the magic happen. SAS distributes the open source scripts. SAS reads multiple input data sets in parallel. SAS distributes the execution of the open source code. SAS writes multiple output data sets in parallel. Distributed. Scalable. Resilient. Check!
SAS Visual Forecasting is not just about modeling. It’s also about a repeatable, collaborative workflow for your data scientists, forecast analysts, and business users. Integrating open source models into the Visual Forecasting UI provides an interactive and consistent user experience from data preparation to model building to model deployment. You can expand the audience beyond coders and drive better forecast adoption from the business. This enables your organization to quickly, efficiently scale to solve many forecasting use cases driving better business decisions across the enterprise.
SO WHAT’S NEXT?
Well, if you’ve made it this far, you might be interested in more information. As luck would have it, we’ve compiled a list of valuable resources for just that reason. For more information on these topics, reference the following links:
- SAS Visual Forecasting: https://www.sas.com/en_us/software/visual-forecasting.html
- Deeper technical details regarding how the TSMODEL procedure and EXTLANG package work to accelerate open source: Scalable Cloud-Based Time Series Analysis and Forecasting, Thiago Quirino, Michael Leonard, and Ed Blair, SAS Institute Inc. This paper is available in the free ebook Forecasting with SAS®: Special Collection.