Register A Model With Python Score Code
This example shows how to register a model that has Python score code within the Open Source Code node. The pipeline has the form Data >> Open Source Code >> Model Comparison where the score code includes only Python code.
This functionality is available from Viya 4 2020.1.1 release.
Data: HMEQ data
Data Description: The data contains observations for 5,960 mortgage applicants. The variable BAD indicates whether the customer has paid on the loan (0) or has defaulted on it (1).
Prerequisites to run the example
-
Apply sas-open-source-config overlay (this example only needs Python part of the overlay)
-
Apply sas-microanalytic-score astores overlay
Steps to run this example
-
Download hmeq.csv file from link above.
-
Log into SAS Visual Data Mining & Machine Learning, choose "Build Models" (Model Studio) and create a new project; select the above CSV file as data source with default options.
-
Under Data tab, select BAD as target variable.
-
Under Pipelines tab, create a simple pipeline with nodes: Data >> Open Source Code >> Model Comparison (you need to move the Open Source Code node to Supervised Learning lane).
-
Select Open Source Code node and click Open Code Editor button from properties. Copy code from hmeq_train.py into the Training Code pane and hmeq_score.py into the Scoring Code pane of the editor. Click Save and close the editor.
-
Run the pipeline and right-click and select Results to view output
-
Under Pipeline Comparison tab, select the model from above pipeline and click the three vertical dots at top right corner to select Register models. This registers the model in SAS Model Manager from where it can be deployed to various publishing destinations.