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 usually performed in the SAS Model Manager client. Workflow definitions can be configured to use model management components with the workflow activities. When the workflow 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 definition that was provided for Tutorial 11 in the SMM123Tutorial.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.
Note: If you did not claim the activity from the Activities category view, select the Claim check box in the activity status bar.
To import a model:
  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 \SMM123Tutorial\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. When a message confirms that the model was imported successfully, click Close.
  5. Repeat steps 1 through 4 for the SAS package file located in the Reg1 folder, and the PMML XML file that is 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:
Note: If you did not claim the activity from the Activities category view, select the Claim check box in the activity status bar.
  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

Create and View Reports

If the Create and View Reports component is associated with an activity, you can create reports and also view reports. The reports can be created by using the Workflow Console as well as by using the New Report wizard in the SAS Model Manager client application.
Note: If you did not claim the activity from the Activities category view, select the Claim check box in the activity status bar.
Here is an example of the Create and View Reports activity that uses this component.
Create and View Reports
To create a report:
  1. Click New report and select a type of report. For this exercise, select Delta Report. The New Report window appears.
    New Report window
  2. Select an output type. The default is PDF.
  3. Select a style for the report. When the SAS default option is selected, the default style and themes are used when generating the report. For example, the SAS default style for the HTML output type is HTMLBLUE.
  4. From the list, select the models that you want to include in the report. For this exercise, select both Tree 1 and Reg 1 because the Delta Report requires two models to be selected.
  5. Specify a name and description if you do not want to use the default values.
  6. (Optional) Specify the report options for the selected report type. Some reports have additional options that can be set. To view them, click More options.
    Here is an example of the More Options window for the Probability of Default Model Validation Report
    New Report — More Options window
  7. Click Run Report. The new report is generated and appears in the default viewer for the selected output type.
To view an existing report:
  1. Select a type of report from the left 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.
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 or challenger models.
This is an example of the Select a champion model or challenger activity.
Set Champion and Challenger models
For this exercise, set both the champion and the challenger model.
Note: If you did not claim the activity from the Activities category view, select the Claim check box in the activity status bar.
  1. Select the Tree 1 model in the 2013 version and click Set Champion Model to set the model as the project champion model. Click Yes for the confirmation message.
    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.
  2. Select the Reg 1 model in the 2013 version and click Flag Challenger Model to flag a model as a challenger to the project champion model. Click Yes to confirm.
    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.
Set Champion and Challenger
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.
  • Select a model from the list, and click Flag Challenger Model to flag a model as a challenger to the project champion model.
  • 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
Note: If you did not claim the activity from the Activities category view, select the Claim check box in the activity status bar.
To add an attachment:
  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.
    Attach Documents – File Selector
  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:
  1. Select SAS Metadata Repository for the publish destination.
    Publish Models to SAS Metadata Repository
  2. Select the champion model Tree 1 and the challenger model Reg 1 in the 2013 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. After the models are published to a database, you receive a success confirmation message. Click Close.
To publish models to a database:
  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. (Optional) Specify an identifier to add to the database target table for each model. The default value is the project name. This option is available only for the SAS Embedded Process publish method.
  7. 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
  8. 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 by 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 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. 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.
  5. 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.
  6. Select Performance from the object window navigation bar.
  7. Select a type of report from the left 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.