BookmarkSubscribeRSS Feed

Publish and Run a Model In-Database – SAS Scoring Accelerator Introduction

Started ‎10-11-2021 by
Modified ‎10-11-2021 by
Views 4,050

SAS Scoring Accelerator is a product that allows you to export models or decisions built in SAS Viya to a database, so that you can run those models and decisions close to your production data.  

 

What are the advantages?

 

It’s all about performance and consistency:

 

  • There is no data transfer between the database and SAS Viya during the scoring phase
  • You can leverage the database infrastructure (massively parallel environments working on big data) for your scoring jobs
  • The scoring model is published as designed (there is no conversion/translation)
  • Data does not need to exit the database to be scored (which can be important from a data governance standpoint)

 

SAS Scoring Accelerator Lifecycle

 

SAS Scoring Accelerator is involved in the last steps of your analytics iteration. Once you have designed your models or decisions (which is a good use of your time), SAS Scoring Accelerator helps you “production-ize” your model/decision. The process, which would require a lot of time and effort with other tools, is very straightforward in SAS Viya: a simple step in the UI or statement in code to publish a model and then run it in the database.

 

nir_1_post_68_01_lifecycle-1024x517.png

Select any image to see a larger version.
Mobile users: To view the images, select the "Full" version at the bottom of the page.

 

The user doesn’t have to convert/translate the scoring function into something that the database will understand. The function stays in SAS language and will be executed by a lightweight SAS engine deployed in the database: SAS Embedded Process.  

 

Which applications leverage SAS Scoring Accelerator?

 

  You can publish a model in-database in multiple ways depending on the application you use to design your model:

  • From SAS code if you are explicitly using CAS actions or SAS procedures for the modeling phase and you want to finalize the process by publishing it to the database
  • From SAS Model Studio directly if you are designing your models using pipelines
  • From SAS Model Manager if you have numerous models to deal with

nir_2_post_68_02_applications-1024x454.png

 

Also, if you are using SAS Intelligent Decisioning to build rule sets and decisions (which can also include models) then you will be able to publish them directly in-database as well.

 

With regard to running a model in-database, SAS Viya only provides programming options such as the SCOREACCEL procedure and the underlying CAS actions (modelPublishing.runModelExternal).

 

Since you can use CAS actions to publish and run models in-database, you can trigger them from any CAS-compatible language such as Python, R or Lua.  

 

What is being moved in-database?

 

This is something you don’t have to worry about since SAS Viya will take care of this transparently and automatically.

 

But if you are curious, depending on the method/algorithm you use to create your model, the resulting scoring function can be based on:

 

  • DATA step language
  • DS2 language
  • DS2 language + analytic store (ASTORE)

 

When it comes to publishing the scoring function, DATA step-based models will be converted to DS2. If they rely on DS2 or ASTORE, they will be published as is. Note that if you publish an ASTORE file only, a DS2 wrapper will be generated.

 

SAS formats can be involved in the modeling process. For example, you can build a model from a sample table that has formats applied. Or you can create a decision that makes use of a lookup table (which is basically a SAS format). Formats will be moved automatically to the database.

 

nir_3_post_68_03_files-1024x441.png

 

Which data platforms are supported?

 

As mentioned earlier, SAS Scoring Accelerator relies on the SAS Embedded Process lightweight engine for running scoring functions in-database.

 

This component must be deployed beforehand in the database. There has been some effort recently to support more and more data providers. This topic is very hot. Indeed, 2021.1.5 brought some new options.

 

As of 2021.1.5, the following databases/data platforms are supported:

 

  • Teradata
  • Hadoop
  • Databricks (Spark)
  • Azure Synapse Analytics (Spark)

Thanks for reading.  

 

Find more articles from SAS Global Enablement and Learning here.

Version history
Last update:
‎10-11-2021 09:35 AM
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