BookmarkSubscribeRSS Feed

Building Data Visualization Applications Using Python and SAS Q&A, Slides, and On-Demand Recording

Started ‎01-28-2025 by
Modified ‎01-29-2025 by
Views 1,685

Watch this Ask the Expert session to learn how easy it is to build custom web applications using Python as a programming language and SAS to provide data. 

 

Watch the Webinar

 

You will learn how to:

  • Use Dash and Django to visualize SAS data and score data from a web browser.
  • Use the SWAT package to integrate CAS data into your custom web application.

 

The questions from the Q&A segment held at the end of the webinar are listed below and the slides from the webinar are attached.

 

Q&A

What does SASCTL stand for?
This is an insightful inquiry. The concept does not possess a definitive meaning. One may consider it as a SAS control package, as previously described, which facilitates interaction with models. However, the SASCTL offers a multitude of additional functionalities. It can assist in the development of applications utilizing Python. Furthermore, it allows for querying and retrieving a list of SAS folders defined within your SAS content server. Nearly all REST APIs can be queried, with some featuring predefined methods or functions, while others require direct API calls. The SASCTL effectively consolidates all aspects related to session management, connection, and authentication into a single package, thereby streamlining the development process. It enables the invocation of Python functions that, in turn, call the underlying REST APIs, providing a convenient solution. There does not appear to be a specific name associated with it; I typically refer to it as a SAS controller or SAS control package.
 
Can we create graphs and visualizations using Workbench and use SASCTL to "export" to SAS Viya?
Models can be developed in Workbench and subsequently published to Viya. This process can be accomplished using astores or by employing macro language from Workbench to Viya. Once published, the models can be scored using either the CAS server or MAS. Regarding visualization, any graphs created will not be readily available in Viya. The most effective strategy, which leverages the full capabilities of SAS and its various components, involves constructing the models in Workbench. Following this, data can be imported into Visual Analytics (VA) to create graphs. These graphs can then be integrated into your web application using the SAS report packages with the SAS VA SDK, resulting in visually appealing graphs generated within VA. These graphs can be reused seamlessly as part of the VA interface or incorporated into your own application, providing the convenience of integrating all defined components from Viya into your application. Additionally, I have examples that utilize the SAS VA SDK.
 
Can't we just do the price prediction using python? What was the need to utilize SASCTL, DASH here?
This example is relatively modest, as it involves utilizing the CAS table, which consists of 400 lines. Loading such a small dataset into CAS may not be practical, as it requires a significant effort for a mere copy-paste operation. The primary aim here is to demonstrate the integration capabilities and the advantages of loading data to leverage the full potential of SAS. The true benefits are realized when dealing with larger datasets. In this instance, the prediction is quite limited. However, for model training and deployment, SAS offers a comprehensive platform and architecture that can accommodate thousands of users accessing CAS predictions. Additionally, Intelligent Decisioning can be employed to construct your model, allowing for deployment based on predefined rules. This model can then be utilized to score data and make informed decisions. While this example illustrates the various components involved, it can be effectively scaled for larger datasets when building models. Furthermore, as previously mentioned, models can also be developed in Python and subsequently registered within SAS, enabling the use of the complete platform. Although a small model can operate on a personal machine, scaling it effectively may necessitate leveraging the full capabilities of the SAS platform.
 
Do we need a SASCTL license or is it part of Base SAS?
SASCTL does not require a license. It can be accessed on GitHub; however, SASCTL by itself is not functional. To utilize it effectively, a connection to your SAS Viya environment is necessary. Without a SAS Viya license, the use of SASCTL will not be possible. Nonetheless, the package is open source, allowing you to fork it, enhance it, incorporate examples, and introduce new functions. The responsibility to develop it into a fully operational package lies with you.
 
Are there examples of using SASCTL with OpenAI, Llama, Bing, etc.?
I do not possess an example of utilizing SASCTL, as its primary function is to invoke models that are already deployed within the SAS environment. Currently, we are not deploying large language models within SAS; instead, we are utilizing OpenAI for that purpose. Integration with OpenAI is possible, and I have authored several blogs discussing how to incorporate OpenAI within Visual Analytics, such as for generating email templates. Additionally, individuals like David WEIK are developing applications that feature an interface to call large language models in the background, which subsequently populates data that can be scored using SAS models based on the generated information. While we have examples of such implementations, there is no significant requirement for SASCTL to directly call the large language models, as these models offer their own packages for interaction. Therefore, it is feasible to integrate various models, whether from SAS or other providers, to create a comprehensive web application or a complete solution.
Integrate GenAI into your SAS Visual Analytics report
 
 
Any particular reason or reasons why we would use this type of framework (Python visualizations calling Viya on the back end) vs building interactive dashboards natively in Viya and publishing that to the end users?
The primary goal is to empower users who may not be well-versed in SAS. If your teams include students, it is likely they have been trained in Python, a language highly favored by data scientists. This allows them to continue utilizing their preferred programming language while seamlessly integrating with the Viya platform, which harnesses the capabilities of the SAS environment for processing large datasets. While it is certainly possible to perform all tasks within SAS, there are various tools available for model creation, including SAS Studio, SAS Viya Workbench, SAS Model Studio, Model Manager, and SAS Visual Analytics for both model development and visualization. The platform is designed to be adaptable, enabling users to select their preferred tools and languages rather than adhering to a rigid SAS-only framework. Users can code in Python or R, utilize SAS Studio, or employ Python within SAS Viya Workbench. Future enhancements will also allow for R coding in both the Viya Workbench and SAS Studio. This flexibility ensures that the SAS statistical engine is accessible to a broader audience.
 
I would like to find resources for how to develop AI Agent on SAS Viya to create Reports and Dashboards.
I don’t have any specific example of building an AI Agent to create Reports and Dashboards. You can most probably find inspiration from:
 
Are there benchmarks on SAS vs other frameworks? What is the remaining real value added of SAS?
The Futurum Group analyzed the productivity of data and AI teams who use Viya compared with alternatives. The results are exposed in this white paper: From Data to Decision: Increasing AI Productivity with SAS Viya
 
 
What about SAS Copilot then?
SAS is currently working on Copilots to help users in their daily tasks. A Copilot for SAS code in Visual Studio Code is already in private preview. Other copilots will also be released in the coming months and years.
 
 
Recommended Resources

Please see additional resources in the attached slide deck.

 

Want more tips? Be sure to subscribe to the Ask the Expert board to receive follow up Q&A, slides and recordings from other SAS Ask the Expert webinars.

Version history
Last update:
‎01-29-2025 02:59 PM
Updated by:

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Article Tags