User-Defined Model Templates

Creating a New Model Template

Overview of Model Templates

When you import a SAS code model or R model, you must define the component files to be used in the model and specify the properties for the model. SAS Model Manager provides model templates that you can use as an example to create your own model template. You use the SAS Model Manager Template Editor to define model component files and to specify system and user properties for your model template. The model templates that are included with SAS Model Manager cannot be modified. For a list of the component files that must be created for the different model types, see Model Template Component Files. For a list of properties, see Model Template Properties.
Note: Only a user or group with the role of Model Manager: Administration Usage can upload a template after it has been created by a user. Several sample user template XML files are included with the SAS Model Manager installation package and are available to be used as a starting point for creating your own model template.
To open the Template Editor from the SAS Model Manager menu, select Toolsthen selectManage Templates.

Create a New Model Template

You can create a new model template either by modifying an existing model template or by starting from an empty model template. To create a model template by modifying an existing template, see Modify a Model Template.
To create a new model template from an empty template, follow these steps:
  1. From the SAS Model Manager Template Editor window, select Filethen selectNew Model Template. The Template Editor opens a template that has the name Untitled Template. Properties that display an asterisk ( * ) require a value for the property.
    New Model Template Window
  2. Assign values to the model Properties on the right. The Name box is required. Replace Untitled Template with the template name. For more information, see Model Template Properties.
  3. Create a list of component files for the model. For each new filename, right-click the FileList folder and select New File Item. The New File Item window appears.
    New File Item Window
  4. Enter a Name and Description for the file, and then click OK. For more information, see Model Template Component Files.
  5. After all required files have been created, select each filename and assign values for the properties on the right. For more information, see FileList Properties.
  6. To create a new property for the template, follow these steps:
    1. Right-click the System or User folder and select New Property. The New Property window appears.
      New Property Window
    2. Enter a Name and Description for the new property, and then click OK.
    3. After all required properties have been created, select each property name and enter the property field values on the right. For more information, see System and User Properties.
  7. To save the template, select Filethen selectSave As. Then select a directory and filename for the template. This creates a backup of the template at a local or network location.
  8. Upload the template to the SAS Content Server. From the Browse Templates window, select Upload File.
  9. In the Upload File window, ensure that the name is correct and click OK.

Modify a Model Template

Only user templates can be modified with the use of the SAS Model Manager Template Editor. Reserved templates can be used as a model to create a customized model template. When you open a reserved template, modify the template, and upload the template to the SAS Content Server, SAS Model Manager creates a new user template using the same name as the reserved template, the template is not reserved.
To modify a model template, follow these steps:
  1. From the SAS Model Manager Template Editor window, select Filethen selectBrowsethen selectBrowse Templates.
  2. Select a model template, and then click Open. The template properties appear on the right.
    Model Template Editor Window
  3. To modify model template properties, select the property and make changes to the property value. For more information, see Template Properties.
  4. Create or modify file properties:
    • To create a new file property, right-click the FileList folder and select New File Item. Complete the properties, and then click OK.
      New File Item Window
    • To modify file properties, select the filename and make changes to the property values.
      Modify File Item Properties
    For more information, see FileList Properties.
  5. Create or modify system and user properties:
    • To create a new property, right-click the System or User folder and select New Property. Complete the properties, and then click OK.
      New Property Window
    • To modify system or user properties, select the property and make changes to the property values on the right.
      Modify Property Window
    For more information, see System and User Properties.
  6. To delete a file, system, or user property, right-click the property and select Delete.
  7. To save the template, do one of the following:
    1. Select Filethen selectSave to save the changes to the existing template.
    2. Select Filethen selectSave As, and then select a directory and filename for the template.
      Saving the template creates a backup file of the template.
  8. Upload the template to the SAS Content Server. From the Browse Templates window, select Upload File.
  9. In the Upload File window, ensure that the name is correct and click OK.

Model Template Properties

Template Properties

Here is a list of the general properties that define the model template.
Property Name
Description
Name
Identifies the name of the template. This property is required. The characters @ \ / * % # & $ ( ) ! ? < > ^ + ~ ` = { } [ ] | ; : ‘ " cannot be used in the name.
Description
Specifies user-defined information about the template.
Type
Specifies the type of the model. SAS Model Manager supports the following model types:
AnalyticalModel
specifies the type of model that is associated with the Analytical model function.
ClassificationModel
specifies the type of model that is associated with the Classification model function.
PredictionModel
specifies the type of model that is associated with the Prediction model function.
ClusteringModel
specifies the type of model that is associated with the Segmentation model function.
For more information about the model function types, see SAS Model Manager Model Templates.
Tool
Specifies a text value that describes which tool is used to produce this type of model.
Validate
Indicates that SAS Model Manager verifies that all of the required files are present when users try to import a model into SAS Model Manager. If validation fails, the model will not be successfully imported.
Display Name
Specifies a text value that is displayed as the name of the model template.
Score Code Type
Specifies whether the imported model score code runs by using a DATA Step fragment, SAS Program code, or PMML.

FileList Properties

Here is a list of the FileList properties that specify the files that are contained in a model.
Property Name
Definition
Name
Identifies the name of the file. This property is required.
Description
Specifies user-defined information about the file.
Required
When it is selected, indicates that the file is a required component file of the model that must be imported before using the model.
Report
When it is selected, indicates that the file is to be included in a SAS package file when a model is published to a channel.
Type
Specifies a file whose type is text or binary.
Fileref
Specifies an eight-character (or fewer) SAS file reference to refer to this file in score.sas code. The fileref is assigned by SAS Model Manager when a SAS job is submitted.
Note: All user-defined models must have three files.
  • score.sas is the model's score code.
  • modelinput.sas7bdat is a SAS data set whose variables are used by the model score code. The contents of the data set is not used by SAS Model Manager.
  • modeloutput is a resulting data set when a user runs score.sas against modelinput.sas7bdat. The data set provides output variables that the model creates after a scoring task is executed. The contents of the data set is not used by SAS Model Manager.

System and User Properties

Here is a list of the system-defined and user-defined properties for a model template. Users can set these properties when they import a model.
Property Name
Description
Name
Identifies the name of the property. This is a required field.
Description
Specifies user-defined information about the property.
Type
Specifies a property whose type is String or Date.
Edit
Indicates that the property can be modified when importing a model or after the model is imported to SAS Model Manager.
Required
Indicates that the property is required.
Initial Value
Specifies a text string for the initial value for the property.
Display Name
Specifies a text value that is displayed as the name of the property.