Models for the real world – the deployment hassle

2

Building a predictive model is generally not the end of the project. Indeed, there is a major difference between building a model and actually getting it ready for people to use in their products and services. Even if the purpose of the model is to increase knowledge of the data, you will need to organise and present the knowledge in a way that the customer can use it. In other words, you need to deploy your model.

There seems to be a common problem in moving machine learning from science to production. Companies struggle to get value out of their models and, in turn, to achieve the expected business targets and ROI on their analytics investments. That is because deploying machine learning models is not an easy process. Model deployment has become a sort of team project, where different people from different departments – that means different skills and background – interact with each other. But it is not simply a project management challenge; it is also (mainly) a technological one.

Hidden Insights: Models for the real world - The deployment hassle

Models for the real world – the deployment hassle.

SAS & OS

Indeed, to deploy your models, you need the right cloud infrastructure, you must design and implement APIs for model usage, and you have to eventually integrate everything with data pipelines – just to name a few. These are all complex tasks to worry about when you want to create an application that works at scale. What’s more, using different open source components increases the complexity and requirements of your system because you are required also to manage the integration between different components. This raises the question of whether you want to build a model that doesn’t get used in the real world.

The good news is that now you can use SAS to make this process easier. SAS Viya allows companies to easily manage the deployment phase, providing a combination of powerful tools together with a flexible and scalable infrastructure. Everything works either with SAS models or open source models. Or both.

New capabilities with SAS Viya

SAS Viya opens up an entirely new set of capabilities for SAS. This state-of-the-art software architecture is designed to enable distributed (i.e., over many host computers) in-memory analytics, meaning that data is held in memory. Therefore, it’s really scalable and really fast. But that’s not all.

One of the best new features of SAS Viya is its ability to pair with open source platforms, which allows developers the freedom of language and implementation to integrate with the power of SAS analytics. For instance, with the SWAT package (where "SWAT" stands for the SAS scripting wrapper for analytical transfer), you can use R or Python clients to run SAS procedures using objects and constructs they are familiar with. If you are not aware of SWAT yet or just want to learn more, check out the SAS GitHub repository.  

But what if users just want to deploy their Python models? Can they still use the SAS environment to manage and deploy these models? The answer is still yes! Let’s see how.

OS model deployment with SAS

Model deployment is the last step of the so-called analytics life cycle. SAS Viya natively supports this phase for SAS models with different tools: SAS Model Manager for model management and administration, SAS Intelligent Decisioning for real-time decisioning and SAS Event Stream Processing (ESP) for streaming data analytics.

When it comes to the open world, SAS provides users with different approaches to integrate and deploy open source models in SAS Viya, depending on their needs.
Let’s have a look at them.

Model exchange formats

Open source developers can convert their model into objects that can be decoded and reused in SAS Viya. Two options are available: PMML (Predictive Model Markup Language) and ONNX (Open Neural Network Exchange).

PMML

PMML is the leading standard for statistical and data mining models. It is supported by over 20 vendors and organisations. With PMML, you can develop a model on one system using one application. Then you can easily deploy the model on another system using another application simply by transmitting an XML configuration file (the PMML object). In other words, your R or Python model can be saved in a PMML object that, in turn, can be decoded and converted in SAS DATA step code. After this step, the model becomes eligible to be managed by all the above-mentioned SAS deployment tools.

SAS Viya has opened an entirely new set of capabilities for SAS. This state-of-the-art software architecture is designed to enable distributed (i.e., over many host computers) in-memory analytics. Click To Tweet

ONNX

For those who cannot use PMML or simply don’t want to (maybe they don’t like the name!), the alternative is using ONNX. ONNX provides an open source format for AI models, both deep learning and traditional ML. It defines an extensible computation graph model, as well as definitions of built-in operators and standard data types. That means that developers can easily move models between start-of-the-art tools and choose the combination that is best for them.

ONNX is developed and supported by a community of partners, and SAS is part of this group. This means that model developers can take their neural networks models built in OS framework (TensorFlow, Keras, CoreML and so on) and convert them to objects that can be deployed into the SAS Platform. But that is not all. Using the same concept, SAS deep learning models can be converted in ONNX and deployed in all the open/proprietary frameworks supporting this format.

Overall, the flexibility of these two approaches allows you to choose the best deployment option for your existing architecture.

Python node in SAS Intelligent Decisioning and ESP

SAS Intelligent Decisioning is a real-time decisioning platform on SAS Viya that provides a holistic solution to support the decisioning process. It lets you combine business rules management, decision governance, advanced analytics, and real-time capabilities to automate and manage a range of operational decisions. When designing the decision flow, you can use the Python node to easily integrate the Python model in the decision flow. Then you can make it available for real-time decisioning with no restriction on the libraries to be used. That means being able to put the models into production using a simple drag and drop GUI.

With a similar approach, you can integrate Python code in ESP to quickly create a real-time transaction processing pipeline. Here is a detailed article on how to make it work.

Govern open source models with SAS Model Manager

SAS Model Manager allows you to easily manage both SAS and open source analytical models via a centralised, secure, web-based repository. With this tool, you can validate, assess and compare candidate models for champion model selection. Then you can publish and monitor them to ensure optimal performance.

Thanks to the SAS Viya open architecture, you can also register and manage your source models using RESTful API calls directly from an OS client (e.g., Jupyter Notebook). For more information on the open APIs for model governance, have a look at this article. And here is the complete list of public APIs that interact with SAS Viya from open clients.

Share

About Author

Matteo Landro

Matteo is a data scientist at SAS. He supports global initiatives and projects that involves advanced analytics and artificial intelligence technologies. He is passionate about helping companies transforming their business processes with analytics. Matteo has a MSc in Management Engineering. from Politecnico di Milano, with a specialization in Industrial Management

2 Comments

  1. Reece Clifford on

    Nice article Matteo! I would suggest to include information about managing native open source models as a result of containerization! Gives even wider choice to the analytic community.

Leave A Reply

Back to Top