Deliver Models

In this exercise, you use the comprehensive publishing environment for model delivery to share models. Model delivery most often includes model score code and its associated input and output metadata. You export a model and the champion model for a project to the SAS Metadata Repository and publish a model to a publish channel. For each model that you export, SAS Model Manager creates a MiningResult object in the SAS Metadata Repository. Only models that have a Score Code Type of Data Step can be exported to the metadata repository. Application software, such as SAS Data Integration Studio or SAS Enterprise Guide, can access the MiningResult object through the SAS Metadata Server and submit on-demand or batch scoring jobs.

Export a Model to the SAS Metadata Repository

SAS Model Manager uses the SAS Folder view to export the model to any folder that is accessible to the user. You can export a model to folders in the SAS Foundation repository or to folders in custom repositories that are created in SAS Management Console to reflect the structure of your business organization.
To export a model to a SAS Metadata Repository, follow these steps:
  1. Expand Loanthen select2011then selectModels and right-click the Tree 1 model. Then select Export Model. The SAS Metadata Repository dialog box appears
  2. Navigate to the folder where you want to store the model.
    Export a model to SAS Metadata Repository
  3. Enter Tree 1 as the name and click Save. If a MiningResult object is in the repository that has the same name, then you are prompted to decide whether to overwrite the metadata for this stored object.
    CAUTION:
    Do not overwrite an existing MiningResult object unless you are certain that the model is from the same project in SAS Model Manager.
  4. In theExport Model message box, click Close.
If you change the score code for the model, then export the model again to ensure that your score application uses the current scoring code.

Verify the Model Export

To verify that SAS Model Manager successfully created the MiningResult object in the metadata repository for an exported model, use SAS Management Console. To view the contents of the exported model or project, you can use SAS Data Integration Studio. You can also use SAS Management Console to export the MiningResult object to a SAS package.
To view a MiningResult object in the metadata repository, follow these steps:
  1. Open SAS Management Console and log on to the SAS Metadata Server using the same user ID that you use to log on to SAS Model Manager.
  2. Click the Folders tab and expand the folders to locate the model that you exported. When you select the folder, the right pane lists the MiningResult objects for the exported models.
    SAS Management Console Folders view for exported models
  3. Right-click the Tree 1 MiningResult object and select Properties from the pop-up menu. The Properties window appears.
  4. Examine the Keywords box on the General tab to verify that the MiningResult object contains the universal unique identifier (UUID) of the exported model. The UUID is a system property that SAS Model Manager automatically assigns to each model. To view a system property in SAS Model Manager, click the + icon beside the System Properties heading to expand the section.
    General properties for model exported to SAS Metadata Repository
    Tip
    You can use the UUID to conduct filtered searches and query the exported models. For more information, see the SAS Model Manager: User's Guide.
  5. Examine the metadata on the Advanced tab to determine when the MiningResult object was created or most recently updated.
  6. Click OK.

Export the Champion Model

To export the champion model for a project, you must have already assigned the default version for the project. SAS Model Manager examines the project and always exports the champion model in the default version. When the default version for a project changes and you export the model again at the project level, the scoring application automatically uses the latest score code. SAS Model Manager exports only models whose model property Score Code Type is set to Data Step.
To export the champion model for a project, follow these steps:
  1. Verify that the project has a default version assigned. Select the Loan project folder to examine its properties. The Default Version property contains the name of the default version.
  2. Right-click the Loan project and select Export Project Champion Model from the pop-up menu. Click Yes for the information message that the project is unlocked. The SAS Metadata Repository dialog box appears.
  3. Navigate to the folder where you want to store the model.
    Export Champion model for a project to SAS Metadata Repository
  4. Select the folder and click OK. If a MiningResult object is in the repository that has the same name, then you are prompted to decide whether to overwrite the metadata for this stored object.
    CAUTION:
    Do not overwrite an existing MiningResult object unless you are certain that the model is from the same project in SAS Model Manager.
  5. In the information message box, click Close.

Publish Models

SAS Model Manager uses SAS Publishing Framework to publish models to defined channels. SAS Model Manager creates a SAS Package file (SPK) for the model in a publication channel. Authorized users who subscribe to the channel can choose to receive e-mail notifications when updated models are ready to deploy to testing or production scoring servers and when the SPK file is published to a publication channel. Then you can extract and validate the scoring logic, deploy champion models to a production environment, and monitor the performance of your models.
To publish a model to a channel, follow these steps:
  1. Expand Loanthen select2011 and right-click the Models folder. Then select Publish. The Publish to a SAS Channel window appears.
    Tip
    You can publish models from the organization, project, version, or model folder in the Project Tree.
  2. Select a publication channel from the Channel list.
    Note: The channel values for Description, Subject, and Subscribers are defined in the SAS Metadata Repository with SAS Management Console.
  3. Select Reg1 as the model to publish in the Select Entries to Publish table. SAS Model Manager lists all of the models in the version folder. To view the entire folder name, expand the ID column heading. Click Next.
    Select to Publish champion model to a SAS channel
  4. Specify an optional subject line for the e-mail message in the Message Subject box. For this example, enter Publish champion model. By default, SAS Model Manager uses the value that is defined in the publication channel. If you omit the subject line, then the name of the published model is used.
  5. In the Notes box include information about the model that might be useful to other users who are involved with the project. For this example, enter Loan project for 2011.
    Message subject line and notes sent when publish model to SAS channel
  6. Click Finish. The information dialog box appears and provides information about whether SAS Model Manager successfully published the model. Click Details to display a log of the publication process and any messages.
    Information dialog box with details about published model
  7. Click Close.
The SAS package that is sent to the publication channel contains the model input, output, SAS code, and its properties. You can submit a SAS DATA step program that calls the SAS Publish API (Application Programming Interface) to extract and deploy the model to a testing or scoring server. SAS Model Manager also provides a SAS macro program, called MM_GetModels, that extracts the SAS code and metadata to score the model. Typically, extracted files are placed on a local drive of the scoring server that is used to deploy the published model. For more information, see the SAS Model Manager: User's Guide.

Update the Life Cycle (Optional)

To update the life cycle milestones, follow these steps:
  1. In the Loan project, expand 2011then selectLife Cyclethen selectTest.
  2. Select each milestone task for Test. Click the Status box and select Completed.
    Note: Although this task was not part of this exercise, dependencies in the life cycle require you to mark this task complete.
  3. Expand the Production milestone. Select the Declare ready for production task. Click the Status box and select Completed.
  4. Select the Export model task. Click the Status box and select Completed.
  5. Select the Publish to production score server task. Click the Status box and select Completed.
  6. Click the Life Cycle node to examine its properties. The value for Date Modified is today's date. The Test and Production properties display bar charts that show the percentage of completed tasks for these milestones.
    The life cycle status of Test and Production milestones.

Update the Workflow Process (Optional)

To complete the activities in the associated workflow process, follow these steps:
  1. Click My Workflow Inbox from the SAS Model Manager main window to view the workflow process activities in your workflow inbox. Workflow Console is launched in a Web browser, and displays the Activities category view.
    Note: The list displays only the activities for which you are the actual owner or are assigned as a potential owner, and that have the state of Started.
  2. From the Activities category view, select an activity name, and click Claim the activity to claim an activity.
    Note: You can select an activity name and click Release the activity to release an activity that you had previously claimed.
  3. (Optional) Enter a property value or change an existing property value in the Properties pane.
  4. (Optional) Add a comment to the activity using the Comments pane.
  5. Select a status value to complete the activity. The workflow process continues to the next activity.
    Activity Status Menu
  6. Repeat steps 2 through 5 for the activities that you completed during this tutorial.
Note: For more information, see Tutorial 10: Using Workflow Console.