Creating Scoring Task Input and Output Tables

About Scoring Task Input and Output Tables

The scoring task input table is a data table whose input is used by the scoring task to score a single model. The scoring task input table must contain the variables and input data for the variables that the model requires. Typically, a scoring table is identical to its corresponding train table except that the target variables in the train table are not included in the scoring table.
A scoring task output table contains the data that is produced when you execute a scoring task. You can provide a scoring task output table or you can create a scoring output table definition in SAS Model Manager. When a scoring task is executed, SAS Model Manager uses the scoring output table definition to create the scoring output table. The name of the scoring output table definition is used as the name of the scoring output table.
You can create a scoring output table definition by selecting the Create Output Table function directly from the model. In the Create Output Table function, you select variables from a scoring task input table as well as variables from the model’s output. The variables in the Input Variables table are variables from the scoring task input table if one is specified for the Default Scoring Task Input Table property for a project, version, or model property. Otherwise, the Input Variables table is empty. The Output Variables that appear in the window are model output variables. You use the variables from both tables to create the scoring output table.
SAS Model Manager saves the table definition as metadata in the SAS Metadata Repository. The location of the metadata is defined by the SAS library that you specify when you create the output table definition. After SAS Model Manager creates the table definition, the table can be selected as the output table for subsequent scoring tasks.
A SAS Model Manager scoring task can run in test mode, which is the default mode, or it can run in production mode. When the task runs, it populates a scoring task output table. In test mode, the scoring task output table is stored in the SAS Model Manager model repository. You view the table under the scoring task node in the version Scoring Tasks folder. In production mode, if the scoring output table is a table that you provided, that table is updated. If you created a scoring task output definition, the scoring output table is located in the designated SAS library that you specified when you created the table definition in the Create Output Table window. The production scoring task output table is not stored in the SAS Model Manager repository.

Create a Scoring Task Input Table

This DATA step creates a scoring task input table from customer data, keeping 500 rows from the train table:
data hmeqtabl.scorein;
   set hmeqtabl.customer (obs=500);
   keep mortdue reason delinq debinc yoj value ninq job clno derog clage loan;
run;

Create a Scoring Task Output Table

You can create a scoring output table using the Create Output Table window that you open from the Project Tree. The Create Output Table window provides a graphical interface for you to select the variables that you want to include in your scoring output table. If the library that you select in the Create Output Table window is a folder in the SAS Metadata Repository, SAS Model Manager registers the table in the repository. You can view the table in the Data Sources category view of SAS Model Manager. For information, see Create Scoring Output Tables.
You can also create a scoring task output table using a DATA step to keep or drop variables from the train table.
The input variables that you might want to keep in the output data set are key variables for the table. Key variables contain unique information that distinguishes one row from another. An example would be a customer ID number.
This DATA step keeps the input variable CLNO, the client number, which is the key variable, and the output variable SCORE:
data hmeqtabl.scoreout;
   length clno 8 score 8;
run;