SAS Viya Workbench & SAS Model Manager for Model Training and Deployment: SAS Models

SAS Viya Workbench is an on-demand environment for SAS and Python coding. Programmers can spin up a Viya Workbench session in the cloud in just a few seconds, configure server size to match workload requirements, and minimize cloud computing costs with self-terminating sessions. Model developers can also take the models they’ve developed on SAS Viya Workbench and register them into SAS Model Manager. From SAS Model Manager, these models can be compared, tested, deployed, and monitored side-by-side with models developed on SAS Viya and other environments. Developers can build models in their preferred tooling, like SAS Viya Workbench, and still be incorporated into wider analytical processes using SAS Model Manager.

In this article, I’ll review how to register SAS models from SAS Viya Workbench using PROC REGISTERMODEL and build a complete Model Card. A future article will walk through the steps for a Python model.

Build the Bridge Between SAS Viya Workbench and SAS Viya

Before you can begin moving models and modeling assets between SAS Viya Workbench and SAS Model Manager on SAS Viya, your administrator needs to configure SAS Viya to accept traffic from Workbench. For many deployments of SAS Viya, this may mean allowing traffic to SAS Viya from the Workbench IP address. You can open up a terminal in Workbench and find your IP address by running:

curl ip.me

Once your Viya administrator has allowed traffic from Workbench, you need to generate an authorization token. By following the steps in the Authentication documentation, you can create and save a token that you can call in your code as myTokenName. If you encounter a problem generating the token, then traffic from your Workbench may not have been configured correctly. Note that tokens are only valid for one hour by default. So, if you’re working for longer than an hour, you may need to re-generate your token. Additionally, if you are seeing SSL errors when running PROC REGISTERMODEL, run this line of code ahead of the PROC:

options set=SSLREQCERT="allow";

The following demo walks through the steps required to create an access token after SAS Viya is configured to accept traffic from your workbench:

Getting Your Models to SAS Model Manager

When training models in SAS, there are two types of scoring output models may generate: Data Step and Analytical Stores. Both can be registered via PROC REGISTERMODEL, but you’ll need to select the right statement for each. When registering a Data Step model, you must specify the location of the code file via the CODE statement. Similarly, when registering an Analytical Store model, you must specify the location of the ASTOREMODEL statement.

This demo walks through a quick example of model training in SAS Viya Workbench and registration in SAS Model Manager:

Building a Model Card

Model Cards in SAS Model Manager consist of information about how well the model performed during training—and over time. To build a more robust Model Card, it’s best practice to separate your training data into training, testing, and validation. By splitting your data, you can calculate Generalizability, or how well your model performs on unseen data.

To complete your Model Card, there are some properties and metadata to fill out in SAS Model Manager, like the model usage properties and training data property.

The final piece tracks model performance over time. Within SAS Model Manager, you can create your Key Performance Indicator (KPI) thresholds, define your performance monitoring report, and then run the report.

Next Steps

The SAS Model Manager team continues to enhance Model Cards to compile and show more information. What would you like to see next in the Model Card update? Let us know below!

Want to learn more about SAS Model Manager and SAS Viya Workbench? Check out these resources:

Five reasons developers hit a productivity wall – and what to do about it

Lights ... Camera ... Let’s See SAS® Viya® Workbench in Action!

SAS® Viya® Workbench: Ask the Expert Webinar

Fostering Trustworthy AI Using a Model Card

Creating a Model Nutrition Label: Model Cards for SAS Model Studio Models

The Ultimate Must-Have for MLOps: SAS Viya

How Do I Use SAS® Model Manager?

SAS IS A LEADER - IDC MarketScape: Worldwide Machine Learning Operations Platform 2024