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:
-
Expand the
2012 version
in the
PD project and right-click the
Models folder.
Then select
Import FromSAS
Model Package File. The
SAS
Model Package File dialog box appears.
-
In the
Model
Name field, enter
HMEQ Scorecard
.
-
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.
-
Select the
hmeq_scorecard.spk
file
and click
OK.
-
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
-
Expand the
2012 version
in the
LGD-Interval project and right-click
Models.
Then select
Import fromLocal
Files. The
Local Files window
appears.
-
-
In the left pane, expand
the
Desktop folder and select
<drive>:\Tutorial6\Samples\LGD
.
-
In the
Choose
a model template box, select
Prediction.
-
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.
|
|
|
|
lgd_model_output.sas7bdat
|
|
|
|
|
|
lgd_model_target.sas7bdat
|
|
|
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.
-
-
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:
-
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:
-
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:
Copyright © SAS Institute Inc. All rights reserved.