BookmarkSubscribeRSS Feed

MLOps Uncoiled: Python’s Path on SAS Viya with SAS Model Manager

Started ‎10-09-2023 by
Modified ‎10-09-2023 by
Views 1,009

Python-sasctl is an open-source package provided by SAS to ease the handoff between the data scientists developing the model and the MLOps engineers managing and deploying the model. Through Python-sasctl, data scientists can take their models developed using Python packages, such as sklearn or xgboost, and automatically generate the scoring code, model pickle file, input variables metadata, output variables metadata, package and version requirements, training performance metadata, and model properties in just a few lines of code. Next, these files are directly pushed into SAS Model Manager.

 

SophiaRowland_0-1696878062451.png

 

SAS Model Manager offers a unified model repository where models can be organized, audited, tested, monitored, and deployed. Python models can be deployed into a variety of locations, such as a real-time REST API endpoint on SAS Viya, into a batch destination on SAS Viya, or into a container. A container packages the model and its dependencies. This allows it to run on-prem or in any cloud.

 

SophiaRowland_1-1696878109574.png

 

Since SAS Explore took place in Las Vegas this year (and I didn’t want to miss any of the fun), for my session MLOps Uncoiled,  I trained several models in Python to predict whether my flight would be delayed 15 minutes or more. Next, I leveraged Python-sasctl to generate the metadata and executable scoring model.  Python-sasctl supports automatic score code and metadata generation for many popular Python frameworks, including Sklearn, Xgboost, MLflow, TensorFlow Keras, H2O, and more. Finally, I used Python-sasctl to register the model into SAS Model Manager, where it can be compared, tested, monitored, and deployed.

 

Python-sasctl helps generate several pieces of metadata. To explain why we collect each piece, let’s dive into the anatomy of a model.

 

 

To ensure I collect all the rich metadata MLOPs Engineers want, I follow a specific pattern when registering Python models:

  1. Initialize variables specific to our model. This make reusing the same block much easier!
  2. Create a sub-folder to hold model files. This keeps everything organized.
  3. Save a binary representation of the model. For most Python models, this is the pickle file.
  4. Create metadata files. The more we provide to our ML Engineer the happier they will be! Since I strive to act in best practice, I will generate them all. These files include:
    • The inputs my model expects
    • The output my model generate
    • My model's performance on the training and testing data
    • Basic model information, like modeler, algorithm, target variable, etc.
    • Package and version requirements
  5. Next, I use the import model function to write our score code, zip the model files together, and deliver the zip folder directly into Model Manager, where our ML Engineer can start managing my models.

 

The following demo is a clip from my SAS Explore session highlighting data visualization, model training, model registration, and model management.

 

 

To learn model about Python-sasctl and SAS Model Manager, check out the following resources:

Version history
Last update:
‎10-09-2023 03:09 PM
Updated by:
Contributors

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Free course: Data Literacy Essentials

Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning  and boost your career prospects.

Get Started

Article Tags