Import Models

In this exercise you import models into SAS Model Manager from a SAS model package file, and you also import a SAS code model from local files. Then you map the model variables. SAS code models consist of the SAS code and the model component files (metadata) that are used to process a model in SAS Model Manager. To import a SAS code model, at least three component files are required: the model score code, the model input file, and the model output file. For prediction or classification models, you also must prepare model target files.

Import Model Package Files

SAS Enterprise Miner and SAS/STAT linear model package files, or SPK files, contain complete model information. You can import SAS Enterprise Miner and SAS/STAT models even if they are not registered in the SAS Metadata Repository. For information about how to create a package file, see the SAS Model Manager: User's Guide.
To import a model that was saved as a package file, follow these steps:
  1. Expand the 2012 version in the PD project and right-click the Models folder. Then select Import Fromthen selectSAS Model Package File. The SAS Model Package File dialog box appears.
  2. In the Model Name field, enter HMEQ Scorecard.
  3. Navigate to the location of the folder that contains the SAS package files. For this example, use <drive:>\Tutorial6\Samples\PD that was installed by the SAS Model Manager administrator. For more information, see Prepare Tutorial 6 Data Sets and Models.
  4. Select the hmeq_scorecard.spk file and click OK.
    Import model from a SAS Enterprise Miner package file
  5. Examine the Models folder to verify that it contains the models. Right-click the folder and select Expand All to examine the model files.

Import SAS Code Models

  1. Expand the 2012 version in the LGD-Interval project and right-click Models. Then select Import fromthen selectLocal Files. The Local Files window appears.
  2. Import an LGD model.
    1. In the left pane, expand the Desktop folder and select <drive>:\Tutorial6\Samples\LGD.
    2. In the Choose a model template box, select Prediction.
    3. Type LGD in the Name box. For each filename in the Object column, click the filename and drag it to the corresponding option box. This action maps the tutorial model component filenames to the SAS Model Manager model component filenames.
      Object
      Option
      lgd_model_input.sas7bdat
      modelinput.sas7bdat
      lgd_model_output.sas7bdat
      modeloutput.sas7bdat
      lgd_model_est.sas7bdat
      outest.sas7bdat
      lgd_score.sas
      score.sas
      lgd_model_target.sas7bdat
      target.sas7bdat
      lgd_training.sas
      Training.sas
      Note: This file is needed only if you want to retrain the model.
      Here is the Local Files window after the files have been mapped.
      Local Files window to import model 1
    4. Click OK.
  3. Examine the Models folder to verify that it contains the model. Right-click the folder and select Expand All to examine the model files.

Map Model Variables to Project Variables

When the names for the model output variable are not identical to the names for the project output variables, you must map the variables.
To map model output variables to project output variables, follow these steps:
  1. Map model variables for the first model. Select HMEQ Scorecard in the Models folder, click the Model Mapping tab in the right pane, and click Edit. Set the following mapping and click OK:
    Project Variables
    Model Variables
    score
    P_BAD1
  2. Map model variables for the LGD model. Right-click LGD in the Models folder of the 2012 version in the LGD-Interval project, and select Set Model Output Mapping. Set the following mapping and click OK:
    Project Variables
    Model Variables
    p_lgd
    p_lgd