Using Model Management Components with a Workflow Activity

About Using Model Management Components in a Workflow Activity

SAS Model Manager enables you to integrate SAS Workflow with some of the model management tasks that are normally performed in the SAS Model Manager client. Workflow process definitions can be configured to use model management components with the workflow activities. When the workflow process definition is activated for use, the model management components are available through the object view for the associated activity in the SAS Model Manager Workflow Console.
In this exercise, you perform the model management tasks that are a part of the workflow. The steps in this exercise follow the workflow that was created in the previous exercise using the workflow process definition that was provided for Tutorial 10 in the SMM121Tutorial.zip file.

Import Models

If the Import Models component is associated with an activity, you can import models into the model repository. You can import models from the SAS Metadata Repository, a SAS package file (.spk), or a PMML file (.xml) into the version that is associated with the workflow. In this exercise you import models from the SAS package files into the 2013 version.
To import a model, follow these steps:
  1. Select the SAS package file import method from the Import drop-down list.
    Import Method List
    Example of Importing a Model from a SAS Package File
    Import Model from SAS Package File
  2. Navigate to the location where the tutorials were extracted and look in the \SMM121Tutorial\Tutorial3\Samples directory.
    • When importing a model from a SAS package file or from a PMML File, select Open.
      Select File window
    • When importing a model from SAS Metadata Repository, you select the file and specify a name in the same window.
      Import Models from SAS Metadata Repository
    For this exercise, open the Tree1 folder and select the miningResult.spk file to import. When importing a PMML model, you select an XML file.
  3. Enter a name for the model and click OK.
  4. Click Close in the success message.
  5. Repeat steps 1 through 4 for the SAS package file located in the Reg1 folder, and the PMML XML file located in Neural folder.
    Import Models Object Window After Models Are Imported
    Import Models window
  6. Select a model from the list, and click View model information to view the information for a model.
    Model Viewer window
  7. Select Variables from the left menu and click the Model Mapping tab.
    Model Viewer – Model Mapping
    Map the model output variables to the project output variables.
    Here are the model output variable mappings for the models that were imported:
    Neural
    Project Variables
    Model Variables
    score
    P_BAD1
    Reg 1
    Project Variables
    Model Variables
    score
    EM_EVENTPROBABILITY
    Tree 1
    Project Variables
    Model Variables
    score
    EM_EVENTPROBABILITY
For more information about importing models using SAS Model Manager, see Importing Models in SAS Model Manager: User's Guide.

Compare Models

If the View Models component is associated with an activity, you can view a list of the models. You can also view model information such as properties, model variables, score code, model files, notes, and history. By default, the Model Viewer component is available from both the Import Models and also the Set Champion and Challenger components. The Model Viewer enables you to modify properties, map model output variables, edit score code, and add notes for the selected model. You can also view the input variables, output variables, model files, and history of actions for the selected model.
The generic model viewer component can also be configured for an activity. This component displays a list of the models in the model repository that are associated with the version for which workflow process was created.
Generic Model Viewer component
For this exercise, perform the following steps for each model:
  1. Select a model from the list, and click View model information. The Model Viewer window appears.
    Model Viewer window
  2. Select Variables from the left menu and click the Model Mapping tab. Verify that the model output variables are mapped.
    Model Viewer – Model Mapping
  3. (Optional) Select Score Code from the left menu to view the score code for the model.
    View Model Score Code
  4. (Optional) Select Model Files from the left menu to view the files that are in the model folder.
    View Model Files
  5. (Optional) Select Notes from the left menu to add or view notes that are associated with the model.
    View Model Notes
  6. (Optional) Select History from the left menu to view the history of tasks that have been performed for the model.
    View Model History

View Reports

If the Reports Viewer component is associated with an activity, you can view reports that were created using the New Report wizard in the SAS Model Manager client application.
To view the reports, you must first create the reports for the 2013 version. You can follow the exercise Create Model Comparison and Summary Reports in tutorial 3 to create the Delta, Dynamic Lift, and Model Profile reports. In this exercise you view reports for the 2013 version. Some reports such as the Delta report and Dynamic Lift report enable you to select models from the version that contains the current project champion model.
View Reports
To view a report, follow these steps:
  1. Select a type of report from the left navigation menu.
  2. Right-click a report from the list and select Open to view the report.
    Note: You can also view the SAS code and SAS log if the report is not displayed.
  3. (Optional) To view the SAS code or SAS log for a report, select a report from the list and click on the icon in the Code or Log column.
For more information, see Validating Models Using Reports in SAS Model Manager: User's Guide.

Select a Champion or Challenger Models

If the Set Champion and Challenger component is associated with an activity, you can set a project champion model and challenger models.
This is an example of the project champion that already exists in another version.
Set Champion and Challenger models
For this exercise, select the Tree 1 model in the 2013 version and click Flag Challenger Model to flag it as a challenger. Click Yes for the confirmation message.
Here are the actions that you can perform using this component:
  • Select a model from the list, and click Set Champion Model to set the model as the project champion model.
    Note: You might receive warning messages indicating that you must complete required tasks before you can continue. Here are the possible scenarios in which a message might appear:
    • If there are model input variables that are not defined as project input variables, you are prompted to add the input variables. Click Yes to confirm. The model input variables are copied to the project input variables.
    • If project output variables are not defined, the Select Project Output Variables window appears for you to select the output variables. After you select the output variables, click OK.
    • The Set Model Output Mapping window appears if you have not mapped the model output variables to the project output variables.
  • Select a model from the list, and click Flag Challenger Model to flag a model as a challenger to the project champion model.
    Note: You might receive warning messages indicating that you must complete required tasks before you can continue. Here are the possible scenarios in which a message might appear:
    • If there are model input variables that are not defined as project input variables, you are prompted to add the input variables. Click Yes to confirm. The model input variables are copied to the project input variables.
    • The Set Model Output Mapping window appears if you have not mapped the model output variables to the project output variables.
  • Select a model from the list, and click Clear to clear a flagged challenger or champion model.
  • Select a model from the list and click View model information to view the model information.
For more information about champion and challenger models, see Deploying Models in SAS Model Manager: User's Guide.

Attach Documents

If the Add Documents component is associated with an activity, you can add, view, or delete attachments. The attachments are stored in the Documents folder that is located within a project or version in the model repository.
Add Documents
For this exercise, follow these steps:
  1. Click Add attachment to select a file to attach to the specified Attach location. The default location is the <version>/Documents folder. An example is 2013/Documents. The Select file to upload window appears.
    Attach Documents – File Selector
  2. Navigate to the location of the file, select the file, and click Open. The file appears in the list of documents.
  3. Select the item in the list for the file that you attached in the previous step and click Open or double-click the selected file to view the contents of the file.
  4. (Optional) Select an item from the list and click Delete attachment to delete the attachment.

Publish Models

You can publish champion and challenger models from the model repository to the SAS Metadata Repository or to a database. In this exercise, you publish a model to the SAS Metadata Repository and to a database.
To publish models to the SAS Metadata Repository, follow these steps:
  1. Select SAS Metadata Repository for the publish destination.
    Publish Models to SAS Metadata Repository
  2. Select the champion model Tree 1 in the 2012 version and the challenger model Reg 1 in the 2012 version from the Models list.
  3. Accept the default or specify a publish name for the challenger model. The champion model publish name is set as the project name.
    Note: The default format of the publish name is configured by the SAS administrator. You cannot modify the publish name for a champion model.
  4. Select the location in the SAS Metadata Repository to publish the models.
    Select a Location
    Click OK. The selected location appears in the Location box.
    Publish to SAS Metadata Repository.
  5. Click Publish. Click Close for the confirmation success message.
To publish models to a database, follow these steps:
  1. Select the type of database for the publish destination.
    Publish Models to a database
  2. Select a publish method.
  3. Select the models that you want to publish from the Models list.
    Note: You can publish both the project champion model and its challenger models.
  4. If you selected the SAS Embedded Process publish method, select the Replace scoring files that have the same publish name publish option.
  5. Specify a publish name for each model.
    Note: The default format of the publish name is configured by the SAS administrator.
  6. Specify the settings to connect to the database, and click More Options to specify the processing options that should be used when publishing the models.
    Database Options dialog box
    Select Display detailed log messages and click Save. You are returned to the Publish window.
    Publish Models to Database
  7. Click Publish. After the models are published to the database, you receive a success confirmation message. Click Close.
For more information about publishing models using SAS Model Manager, see Publishing Models in SAS Model Manager: User's Guide.

View Performance Results

If the Model Performance Viewer component is associated with an activity, you can view the performance of the project champion model through a series of charts. The performance charts are generated using performance tasks in the SAS Model Manager client application.
To view the performance reports you must set a model in the 2013 version as the project champion model. Then you must define and execute the performance tasks for the 2013 version in the SAS Model Manager client.
For this exercise, perform the following steps:
  1. Open the M7: View Performance Reports activity window. The performance charts are currently not available because the project champion model is not located in the version that is associated with this workflow.
    View Performance Reports
  2. Select the Review status and click Update and Close. The workflow process continues to the next activity.
  3. Open the M8: Administrative Review activity and select Claim. The Utility model management component appears in the activity window.
    Note: The Utility component consists of all the model management components. You can associate the Utility component with an activity so that you can perform administrative tasks or review all of the content that is available for a workflow without having to complete multiple activities. To switch between the model management tasks select a link from the object window navigation bar.
    Utility Component
  4. Select Set Champion and Challenger from the object window navigation bar.
    Utility Model Management Component
  5. Select the Tree 1 model from the 2013 version models list and click Set Champion Model to set the model as the project champion model. Click Yes in both of the warning messages.
    Set Champion and Challenger – Utility
  6. You must now define and execute the performance tasks in the SAS Model Manager client for the new project champion model. Follow the exercise Create the Champion Model Performance Data Sets for a Classification Project in tutorial 5 to define and execute the performance tasks.
  7. Return to the browser window where the SAS Model Manager Workflow Console is available and click Refresh in the M8: Administrative Review activity object window.
  8. Select Performance from the object window navigation bar.
  9. Select a type of report from the left navigation menu to view the performance charts. You can select the check boxes in the upper right corner to show markers in the chart and to display the table of data.
    Here is an example of the Gini charts.
    View Performance
For more information, see What is Performance Monitoring? in SAS Model Manager: User's Guide.