3-Building Decision Trees Using SAS
3-Building Decision Trees Using SAS
Then enter the Path to the directory on the server machine that contains the sample
data that you downloaded from the Web. For example, if the sample data is located on
the desktop of the server machine (denoted by C drive), then you could enter
C:\Documents and Settings\<username>\Desktop, where <username> is your user
name on the server machine. Click Next.
c. Click Finish.
3. Define a new data source in the project, which is later used to import the sample data into
a process flow.
To use a sample data that is stored in SAS data used in Eminer project, you need to define a data
source. Data source stores the meta data of an input dataset. You can also use input data saved in
files (with extensions such as .jmp and .csv) that are not SAS data sets in a process flow. To
import an external file into a process flow diagram, use the File Import node, which is located on
the Sample tab on the Toolbar. Complete the following steps:
1. On the File menu, select New Data Source. The Data Source Wizard opens.
2. Proceed through the steps that are outlined in the wizard.
a. SAS Table is automatically selected as the Source. Click Next.
b. Enter DONOR.DONOR_RAW_DATA as the two-level filename of the Table.
Click Next.
c. Click Next.
d. Select the Advanced option button. Click Next.
e. Change the value of Role for the variables to match the description below. Then,
click Next.
CONTROL_NUMBER should have the Role ID.
TARGET_B should have the Role Target.
TARGET_D should have the Role Rejected.
All other variables should have the Role Input. To change an attribute, click on
the value of that attribute and select from the drop-down menu that appears.
128
Note: SAS Enterprise Miner automatically assigns the role Target to any variable whose name
begins with the prefix TARGET_. For more information about the rules that SAS Enterprise
Miner uses to automatically assign roles, see the SAS Enterprise Miner Help.
f.
Select the Yes option button to indicate that you want to build models based on the
values of decisions. Click Next.
On the Prior Probabilities tab, select the Yes option button to indicate that you
want to enter new prior probabilities. In the Adjusted Prior column of the table,
enter 0.05 for Level 1 and 0.95 for Level 0.
The values in the Prior column reflect the proportions of observations in the data set
for which TARGET_B is equal to 1 and 0 (0.25 and 0.75, respectively). However,
as the business analyst, you know that these proportions resulted from oversampling of donors from the 97NK solicitation (TARGET_B equal to 1). In fact,
you know that the true proportion of donors for the solicitation was closer to 0.05
than 0.25. For this reason, you adjust the prior probabilities.
On the Decision Weights tab, the Maximize option button is automatically
selected, which indicates that you want to maximize profit in this analysis. Enter
14.5 as the Decision 1 weight for Level 1, 0.5 as the Decision 1 weight for
Level 0, and 0.0 as the Decision 2 weight for both levels. Click Next.
129
4. Create a new diagram within the project, and you can create the first node (for the input
data source) in the process flow. complete the following steps:
1. On the File menu, select New Diagram.
2. Enter Donations as the Diagram Name, and click OK. An empty diagram opens in the
Diagram Workspace.
3. Select the DONOR_RAW_DATA data source in the Project Panel. Drag it into the
Diagram Workspace; this action creates the input data node.
To use the StatExplore node to produce a statistical summary of the input data, complete
the following steps:
1. Select the Explore tab on the Toolbar.
2. Select the StatExplore node icon. Drag the node into the Diagram Workspace. To
determine which node an icon represents, position the mouse pointer over the icon and
read the tooltip.
130
3. Connect the DONOR_RAW_DATA input data source node to the StatExplore node.
To connect the two nodes, position the mouse pointer over the right edge of the input data
source node until the pointer becomes a pencil. With the left mouse button held down,
drag the pencil to the left edge of the StatExplore node. Then, release the mouse button.
An arrow between the two nodes indicates a successful connection.
4. Select the StatExplore node. In the Properties Panel, scroll down to view the Chi-Square
Statistics properties. Click on the value of Interval Variables and select Yes from the
drop-down menu that appears.
Chi-square statistics are always computed for categorical variables. Changing the
selection for interval variables causes SAS Enterprise Miner to distribute interval
variables into five (by default) bins and compute chi-square statistics for the binned
variables when you run the node.
5. In the Diagram Workspace, right-click the StatExplore node, and select Run from the
resulting menu. Click Yes in the confirmation window that opens.
When you run a node, all of the nodes preceding it in the process flow are also run in
order, beginning with the first node that has changed since the flow was last run. If no
nodes other than the one that you select have changed since the last run, then only the
node that you select is run. You can watch the icons in the process flow diagram to
monitor the status of execution.
Nodes that are outlined in green are currently running.
Nodes that are denoted with a check mark inside a green circle have successfully
run.
Nodes that are outlined in red have failed to run due to errors.
In this example, the DONOR_RAW_DATA input data node had not yet been run.
Therefore, both nodes are run when you select to run the StatExplore node.
131
6. In the window that appears when processing completes, click Results. The Results
window opens
Note: Panels in Results windows might not have the same arrangement on your screen, due to
window resizing. When the Results window is resized, SAS Enterprise Miner redistributes
panels for optimal viewing. The results window displays the following:
a plot that orders the variables by their worth in predicting the target variable.
Note: In the StatExplore node, SAS Enterprise Miner calculates variable worth using the Gini
split worth statistic that would be generated by building a decision tree of depth 1. For detailed
information about Gini split worth, see the SAS Enterprise Miner Help.
the SAS output from the node.
a plot that orders the top 20 variables by their chi-square statistics. You can also choose to
view the top 20 variables ordered by their Cramer's V statistics on this plot.
Remarks
1. In SAS Enterprise Miner, you can select graphs, tables, and rows within tables and select
Copy from the right-click pop-up menu to copy these items for subsequent pasting in
other applications such as Microsoft Word and Microsoft Excel.
2. Expand the Output window, and then scroll to the Class Variable Summary Statistics
and Interval Variable Summary Statistics sections of the output.
- Notice that there are four variables for which there are missing values. Later in the
example, you will impute values to use in the place of missing values for these
variables.
132
- Notice that several variables have relatively large standard deviations. Later in the
example, you will plot the data and explore transformations that can reduce the
variances of these variables.
3. Close the Results window.
To use the MultiPlot node to graphically discover patterns and trends in the input data,
complete the following steps:
1. From the Explore tab on the Toolbar, select the MultiPlot node icon. Drag the node into
the Diagram Workspace.
2. Connect the StatExplore node to the MultiPlot node.
3. Select the MultiPlot node. In the Properties Panel, scroll down to view the Train
properties. Click on the value of Type of Charts, and select Both from the drop-down
menu that appears. Changing the selection causes SAS Enterprise Miner to produce both
scatter plots and bar charts when you run the node.
4. In the Diagram Workspace, right-click the MultiPlot node, and select Run from the
resulting menu. Click Yes in the confirmation window that opens.
5. In the window that appears when processing completes, click Results. The Results
window opens.
6. Maximize the Train Graphs window. This window displays a bar chart and a scatter plot
for each variable. You can use the buttons at the bottom of the window to scroll through
the plots.
Note: The MultiPlot node uses all observations in the input data set, rather than a sample of the
observations, for plotting.
133
134
4. Select the Data Partition node. In the Properties Panel, scroll down to view the data set
allocations in the Train properties.
- Click on the value of Training, and enter 55.0
- Click on the value of Validation, and enter 45.0
- Click on the value of Test, and enter 0.0
These properties define the percentage of input data that is used in each type of mining
data set. In this example, you use a training data set and a validation data set, but you do
not use a test data set.
5. In the Diagram Workspace, right-click the Data Partition node, and select Run from the
resulting menu. Click Yes in the confirmation window that opens.
6. In the window that appears when processing completes, click OK.
Replace Missing Values
In this example, the variables SES and URBANICITY are class variables for which the value ?
denotes a missing value. Because a question mark does not denote a missing value in the terms
that SAS defines a missing value (that is, a blank or a period), SAS Enterprise Miner sees it as an
additional level of a class variable. However, the knowledge that these values are missing will be
useful later in the model-building process.
To use the Replacement node to interactively specify that such observations of these variables
are missing, complete the following steps:
1. Select the Modify tab on the Toolbar.
2. Select the Replacement node icon. Drag the node into the Diagram Workspace.
3. Connect the Data Partition node to the Replacement node.
4. Select the Replacement node. In the Properties Panel, scroll down to view the Train
properties.
a. For interval variables, click on the value of Default Limits Method, and select None
from the drop-down menu that appears. This selection indicates that no values of
interval variables should be replaced. With the default selection, a particular range for
the values of each interval variable would have been enforced. In this example, you do
not want to enforce such a range.
Note: In this data set, all missing interval variable values are correctly coded as SAS
missing values (a blank or a period).
b. For class variables, click on the ellipses that represent the value of Replacement
Editor. The Replacement Editor opens.
- Notice that SES and URBANICITY both have a level that contains observations with
the value ?. In the case of these two variables, this level represents observations with
missing values. Enter _MISSING_ as the Replacement Value for the two rows. This
135
action enables SAS Enterprise Miner to see that the question marks indicate missing
values for these two variables. Later, you will impute values for observations with
missing values.
- Enter _UNKNOWN_ as the Replacement Value for the level of DONOR_GENDER
that has the value A. This value is the result of a data entry error, and you do not know
whether the intention was to code it as an F or an M. Click OK.
5. In the Diagram Workspace, right-click the Replacement node, and select Run from the
resulting menu. Click Yes in the confirmation window that opens.
6. In the window that appears when processing completes, click OK.
Note: In the data that is exported from the Replacement node, a new variable is created for each
variable that is replaced (in this example, SES, URBANICITY, and DONOR_GENDER). The
original variable is not overwritten. Instead, the new variable has the same name as the original
variable but is prefaced with REP_. The original version of each variable also exists in the
exported data and has the role Rejected.
Remark
To view the data that is exported by a node, click the ellipses that represent the value of the
General property Exported Data in the Properties Panel. To view the exported variables, click
Properties in the window that opens, and then view the Variables tab. Similarly, you can view
the data that is imported and used by a node by clicking the ellipses that represent the value of
the General property Imported Data in the Properties Panel.
To model the input data using nonparametric decision trees:
1. You will enable SAS Enterprise Miner to automatically train a full decision tree and to
automatically prune the tree to an optimal size. When training the tree, split rules at each
step are selected to maximize the split decision logworth. Split decision logworth is a
statistic that measures the effectiveness of a particular split decision at differentiating
values of the target variable. For more information about logworth, see the SAS Enterprise
Miner Help.
2. You will interactively train a decision tree. At each step, you will select from a list of
candidate rules to define the split rule that you deem to be the best.
Decision tree models are advantageous because they are conceptually easy to understand, yet
they readily accommodate nonlinear associations between input variables and one or more target
variables. They also handle missing values without the need for imputation. Therefore, you
decide to first model the data using decision trees. You will compare decision tree models to
other models later in the example.
SAS Enterprise Miner enables you to build a decision tree in two ways: automatically and
interactively. You will begin by letting SAS Enterprise Miner automatically train and prune a
tree. To use the Decision Tree node to automatically train and prune a decision tree, complete the
following steps:
1. Select the Model tab on the Toolbar.
2. Select the Decision Tree node icon. Drag the node into the Diagram Workspace.
3. Connect the Replacement node to the Decision Tree node.
136
4. Select the Decision Tree node. In the Properties Panel, scroll down to view the Train
properties:
- Click on the value of the Maximum Depth splitting rule property, and enter 10. This
specification enables SAS Enterprise Miner to train a tree that includes up to ten
generations of the root node. The final tree in this example, however, will have few
- er generations due to pruning.
- Click on the value of the Leaf Size node property, and enter 8. This specification
constrains the minimum number of training observations in any leaf to eight.
- Click on the value of the Number of Surrogate Rules node property, and enter 4. This
specification enables SAS Enterprise Miner to use up to four surrogate rules in each
non-leaf node if the main splitting rule relies on an input whose value is missing.
Note: The Assessment Measure subtree property is automatically set to Decision because you
defined a profit matrix in Create a Data Source. Accordingly, the Decision Tree node will build
a tree that maximizes profit in the validation data.
5. In the Diagram Workspace, right-click the Decision Tree node, and select Run from the
resulting menu. Click Yes in the confirmation window that opens.
6. In the window that appears when processing completes, click Results. The Results
window opens.
a. On the View menu, select Model English Rules. The English Rules window
opens.
b. Expand the English Rules window. This window contains the IF-THEN logic that
distributes observations into each leaf node of the decision tree.
137
7. Notice that there are seven leaf nodes in this tree. For each leaf node, the following
information is listed:
- node number
- number of training observations in the node
- percentage of training observations in the node with TARGET_B=1 (did donate),
adjusted for prior probabilities
- percentage of training observations in the node with TARGET_B=0 (did not donate),
adjusted for prior probabilities
8. This tree has been automatically pruned to an optimal size. Therefore, the node numbers
that appear in the final tree are not sequential. In fact, they reflect the positions of the
nodes in the full tree, before pruning.
9. Close the Results window.
Interactively Train a Decision Tree
To use the Decision Tree node to interactively train and prune a decision tree, complete the
following steps:
1. From the Model tab on the Toolbar, select the Decision Tree node icon. Drag the node
into the Diagram Workspace.
2. In the Diagram Workspace, right-click the Decision Tree node, and select Rename from
the resulting menu. Enter Interactive Decision Tree and then click OK in the window
that opens.
3. Connect the Replacement node to the Interactive Decision Tree node.
4. Select the Interactive Decision Tree node. In the Properties Panel, scroll down to view the
Train properties, and click on the ellipses that represent the value of Interactive. The
Interactive Decision Tree window opens.
a. Select the root node (at this point, the only node in the tree), and then from the
Train menu, select Split Node. The Split Node window opens that lists the
candidate
splitting
rules
ranked
by
logworth
(-Log(p)).
The
FREQUENCY_STATUS_97NK rule has the highest logworth. Ensure that this
row is selected, and click OK.
138
b. The tree now has two additional nodes. Select the lower-left node (where
FREQUENCY_STATUS_97NK is 3 or 4), and then from the Train menu, select
Split Node. In the Split Node window that opens, select
MONTHS_SINCE_LAST_GIFT, which ranks second in logworth, and click Edit
Rule to manually specify the split point for this rule. The Interval Splitting Rule
window opens. Enter 8 as the New split point, and click Add Branch. Then,
select Branch 2 (>= 8.5) and click Remove Branch. Click OK.
139
140
4. You will model the input data using neural networks, which are more flexible than logistic
regression (and more complicated). In SAS Enterprise Miner, there are two nodes for
development of neural network models. In this example, you will use both.
Impute Missing Values
For decision trees, missing values are not problematic. Surrogate splitting rules enable you to use
the values of other input variables to perform a split for observations with missing values. In
SAS Enterprise Miner, however, models such as regressions and neural networks ignore
observations altogether that contain missing values, which reduces the size of the training data
set. Less training data can substantially weaken the predictive power of these models. To
overcome this obstacle of missing data, you can impute missing values before you fit the models.
Remark
It is a particularly good idea to impute missing values before fitting a model that ignores
observations with missing values if you plan to compare those models with a decision tree.
Model comparison is most appropriate between models that are fit with the same set of
observations.
To use the Impute node to impute missing values, complete the following steps:
1. Select the Modify tab on the Toolbar.
2. Select the Impute node icon. Drag the node into the Diagram Workspace.
3. Connect the Replacement node to the Impute node.
4. Select the Impute node. In the Properties Panel, scroll down to view the Train properties:
- For class variables, click on the value of Default Input Method and select Tree
Surrogate from the drop-down menu that appears.
- For interval variables, click on the value of Default Input Method and select Median
from the drop-down menu that appears.
The default input method specifies which is the default statistic to use to impute missing values.
In this example, the values of missing interval variables are replaced by the median of the nonmissing values. This statistic is less sensitive to extreme values than the mean or midrange and is
therefore useful for imputation of missing values from skewed distributions. The values of
missing class variables, in this example, are imputed using predicted values from a decision tree.
For each class variable, SAS Enterprise Miner builds a decision tree (in this case, potentially
using surrogate splitting rules) with that variable as the target and the other input variables as
predictors.
5. In the Diagram Workspace, right-click the Impute node, and select Run from the
resulting menu. Click Yes in the confirmation window that opens.
6. In the window that appears when processing completes, click OK.
141
Note: In the data that is exported from the Impute node, a new variable is created for each
variable for which missing values are imputed. The original variable is not overwritten. Instead,
the new variable has the same name as the original variable but is prefaced with IMP_. The
original version of each variable also exists in the exported data and has the role Rejected. In
this example, SES and URBANICITY have values replaced and then imputed. Therefore, in
addition to the original version, each of these variables has a version in the exported data that is
prefaced by IMP_REP_.
Transformation of Variables
Sometimes, input data is more informative on a scale other than that on which it was originally
collected. For example, variable transformations can be used to stabilize variance, remove
nonlinearity, improve additivity, and counter non-normality. Therefore, for many models,
transformations of the input data (either dependent or independent variables) can lead to a better
model fit. These transformations can be functions of either a single variable or of more than one
variable. To use the Transform Variables node to make variables better suited for logistic
regression models and neural networks, complete the following steps:
1. From the Modify tab on the Toolbar, select the Transform Variables node icon. Drag the
node into the Diagram Workspace.
2. Connect the Impute node to the Transform Variables node.
To align a process flow diagram vertically, as in the image above, right-click anywhere in
the Diagram Workspace, and select Layout Vertically from the resulting menu.
3. Select the Transform Variables node. In the Properties Panel, scroll down to view the
Train properties, and click on the ellipses that represent the value of Formulas. The
Formulas window opens.
142
a. In the variables table, click the Role column heading to sort the variables in
descending order by their roles.
b. You can select any row in the variable table to display the histogram of a variable
in the panel above. Look at the histograms for all variables that have the role
Input. Notice that several variables have skewed distributions.
c. Click OK to close the Formulas window.
4. In the Properties Panel, scroll down to view the Train properties, and click on the ellipses
that represent the value of Variables. The Variables - Trans window opens.
a. The log transformation is commonly used to control skewness. Select the transformation
Method for the following interval variables and select Log from the drop-down menu
that appears:
- FILE_AVG_GIFT
- LAST_GIFT_AMT
- LIFETIME_AVG_GIFT_AMT
- LIFETIME_GIFT_AMOUNT
143
You can hold down the CTRL key to select multiple rows. Then, when you select a new Method
for one of the selected variables, the new method will apply to all of the selected variables.
b.
Select the transformation Method for the following interval variables and select
Optimal from the drop-down menu that appears:
- LIFETIME_CARD_PROM
- LIFETIME_GIFT_COUNT
- MEDIAN_HOME_VALUE
- MEDIAN_HOUSEHOLD_INCOME
- PER_CAPITA_INCOME
- RECENT_RESPONSE_PROP
- RECENT_STAR_STATUS
The optimal binning transformation is useful when there is a nonlinear relationship between an
input variable and the target. For more information about this transformation, see the SAS
Enterprise Miner Help.
c. Click OK.
5. In the Diagram Workspace, right-click the Transform Variables node, and select Run
from the resulting menu. Click Yes in the confirmation window that opens.
6. In the window that appears when processing completes, click OK.
Note: In the data that is exported from the Transform Variables node, a new variable is created
for each variable that is transformed. The original variable is not overwritten. Instead, the new
variable has the same name as the original variable but is prefaced with an identifier of the
transformation. For example, variables to which the log transformation have been applied are
prefaced with LOG_, and variables to which the optimal binning transformation have been
applied are prefaced with OPT_. The original version of each variable also exists in the exported
data and has the role Rejected.
Analyze with a Logistic Regression Model
As part of your analysis, you want to include some parametric models for comparison with the
decision trees that you built in Build Decision Trees. Because it is familiar to the management
of your organization, you have decided to include a logistic regression as one of the parametric
models. To use the Regression node to fit a logistic regression model, complete the following
steps:
1. Select the Model tab on the Toolbar.
2. Select the Regression node icon. Drag the node into the Diagram Workspace.
3. Connect the Transform Variables node to the Regression node.
144
4. To examine histograms of the imputed and transformed input variables, select the
Regression node. In the Properties Panel, scroll down to view the Train properties, and
click on the ellipses that represent the value of Variables. The Variables - Reg window
opens.
a. Select all variables that have the prefix LOG_. Click Explore, and then click OK
in the confirmation window that opens. The Explore window opens.
You can select a bar in any histogram, and the observations that are in that bucket
are highlighted in the EMWS.Trans_TRAIN data set window and in the other
histograms. Close the Explore window to return to the Variables - Reg window.
b. (Optional) Explore the histograms of other input variables.
c. Close the Variables - Reg window.
145
5. In the Properties Panel, scroll down to view the Train properties. Click on the model
selection Selection Model, and select Stepwise from the drop-down menu that appears.
This specification causes SAS Enterprise Miner to use stepwise variable selection to
build the logistic regression model.
Note: The Regression node automatically performs logistic regression if the target
variable is a class variable that takes one of two values. If the target variable is a
continuous variable, then the Regression node performs linear regression.
6. In the Diagram Workspace, right-click the Regression node, and select Run from the
resulting menu. Click Yes in the confirmation window that opens.
7. In the window that appears when processing completes, click Results. The Results
window opens.
8. Maximize the Output window. This window details the variable selection process. Lines
17111727 list a summary of the steps that were taken. Line 1732 lists the variables that
are in the final model.
Note: Notice that the variables that were selected are all class variables (recall that
OPT_MEDIAN_HOME_VALUE is a binned version of the continuous
MEDIAN_HOME_VALUE variable). Therefore, use caution when interpreting the
parameter estimates. SAS Enterprise Miner uses reference-cell coding in the design
matrix, and therefore parameter estimates reflect differences from a reference group.
9. Minimize the Output window and maximize the Score Rankings Overlay window. From
the drop-down menu, select Cumulative Total Expected Profit.
The data that is used to construct this plot is ordered by expected profit. For this example, you
have defined a profit matrix. Therefore, expected profit is a function of both the probability of
donation for an individual and the profit associated with the corresponding outcome. A value is
computed for each decision from the sum of the decision matrix values multiplied by the
classification probabilities and minus any defined cost. The decision with the greatest value is
146
selected, and the value of that selected decision for each observation is used to compute overall
profit measures. The plot represents the cumulative total expected profit that results from
soliciting the best n% of the individuals (as determined by expected profit) on your mailing list.
For example, if you were to solicit the best 40% of the individuals, the total expected profit from
the validation data would be around $1850. If you were to solicit everyone on the list, then based
on the validation data you could expect a $2250 profit on the campaign.
10. Close the Results window.
Analyze with a User-Specified Neural Network Model
Neural networks are a class of parametric models that can accommodate a wider variety of
nonlinear relationships between a set of predictors and a target variable than can logistic
regression. Building a neural network model involves two main phases. First, you must define
the network configuration. You can think of this step as defining the structure of the model that
you want to use. Then, you iteratively train the model.
A neural network model will be more complicated to explain to the management of your
organization than a regression or a decision tree. However, you know that the management
would prefer a stronger predictive model, even if it is more complicated. So, you decide to run a
neural network model, which you will compare to the other models later in the example.
Because neural networks are so flexible, SAS Enterprise Miner has two nodes that fit neural
network models: the Neural Network node and the AutoNeural node. The Neural Network node
trains a specific neural network configuration; this node is best used when you know a lot about
the structure of the model that you want to define. The AutoNeural node searches over several
network configurations to find one that best describes the relationship in a data set and then
trains that network. To use the Neural Network node to train a specific neural network
configuration, complete the following steps:
1. From the Model tab on the Toolbar, select the Neural Network node icon. Drag the node
into the Diagram Workspace.
2. Connect the Transform Variables node to the Neural Network node.
3. Select the Neural Network node. In the Properties Panel, scroll down to view the Train
properties, and click on the ellipses that represent the value of Network. The Network
window opens.
147
a.
Click on the value of Direct Connection and select Yes from the drop-down
menu that appears. This selection enables the network to have connections directly
between the inputs and the outputs in addition to connections via the hidden units.
b. Click on the value of Number of Hidden Units and enter 5. This example trains a
multilayer perceptron neural network with five units on the hidden layer.
c. Click OK .
4. In the Diagram Workspace, right-click the Neural Network node, and select Run from
the resulting menu. Click Yes in the confirmation window that opens.
5. In the window that appears when processing completes, click Results. The Results
window opens. Maximize the Score Rankings Overlay window. From the drop-down
menu, select Cumulative Total Expected Profit.
Notice that the plot from this model has the same shape as the plot from the logistic
regression model.
6. Close the Results window.
Analyze with an Automatically Selected Neural Network Model
Because the AutoNeural node searches over several network configurations, its calculations
require more computer resources than those of the Neural Network node. Therefore, you decide
to first perform preliminary variable selection before you automatically select and train a neural
network. To use the Variable Selection node to reduce the number of input variables that are
used in a neural network:
1. Select the Explore tab on the Toolbar.
2. Select the Variable Selection node icon. Drag the node into the Diagram Workspace.
3. Connect the Transform Variables node to the Variable Selection node.
148
4. In the Diagram Workspace, right-click the Variable Selection node, and select Run from
the resulting menu. Click Yes in the confirmation window that opens.
5. In the window that appears when processing completes, click Results. The Results
window opens.
6. Expand the Variable Selection window.
149
Examine the table to see which variables were selected. The role for variables that were not
selected has been changed to Rejected. Close the Results window.
Note: In this example, for variable selection, a forward stepwise least squares regression method
was used that maximizes the model R-square value. For more information about this method, see
the SAS Enterprise Miner Help. To use the AutoNeural node to search for and train an optimal
neural network configuration, complete the following steps:
1. Select the Model tab on the Toolbar.
2. Select the AutoNeural node icon. Drag the node into the Diagram Workspace.
3. Connect the Variable Selection node to the AutoNeural node.
4. Select the AutoNeural node. In the Properties Panel, scroll down to view the Train
properties:
Click on the value of the model option Architecture and select Cascade from the dropdown menu that appears. This action causes SAS Enterprise Miner to train only cascade
network models.
Click on the value of the model option Train Action and select Search. This action
causes SAS Enterprise Miner to perform a search to find the best of the candidate
network models.
5. In the Diagram Workspace, right-click the AutoNeural node, and select Run from the
resulting menu. Click Yes in the confirmation window that opens.
6. In the window that appears when processing completes, click Results. The Results
window opens. Maximize the Score Rankings Overlay window. From the drop-down
menu, select Cumulative Total Expected Profit.
150
Again, compare this plot to the plots for the other two models. The shape of the curve is similar
for this model to that of the curve for both other models. However, the range of cumulative total
expected profit is considerably larger on this plot.
For example, if you were to solicit the best 40% of the individuals, the total expected profit from
the validation data would be around $6250. Soliciting all of the individuals yields a cumulative
total expected profit of about $8900.
7. Close the Results window.
Compare Models
To use the Model Comparison node to compare the models that you have built in this example
and to select one as the champion model, complete the following steps:
1. Select the Utility tab on the Toolbar.
2. Select the Control Point node icon. Drag the node into the Diagram Workspace.
3. Connect all five model nodes to the Control Point node.
Remark: Control Point nodes enable you to better organize your process flow diagram. These
nodes do not perform calculations; they simply pass data from preceding nodes to subsequent
nodes.
4. Select the Assess tab on the Toolbar.
5. Select the Model Comparison node icon. Drag the node into the Diagram Workspace.
6. Connect the Control Point node to the Model Comparison node.
151
7. In the Diagram Workspace, right-click the Model Comparison node, and select Run from
the resulting menu. Click Yes in the confirmation window that opens.
8. In the window that appears when processing completes, click Results. The Results
window opens.
9. In the Fit Statistics window, notice that the logistic regression model was selected as the
champion model. The champion model has the value Y in the Selected Model column in
the Fit Statistics window.
In the model selection node, SAS Enterprise Miner selects the champion model based on
the value of a single statistic. You can specify which statistic to use for selection in the
node Properties Panel. Because you did not change the value of this property, the default
statistic was used, which (because a profit matrix is defined) is average profit in the
validation data.
10. Close the Results window.
152
Description
CARD_PROM_12
CLUSTER_CODE
CONTROL_NUMBER
DONOR_AGE
DONOR_GENDER
FILE_AVG_GIFT
this
variable
is
LIFETIME_AVG_GIFT_AMT
FILE_CARD_GIFT
FREQUENCY_STATUS_97NK
HOME_OWNER
INCOME_GROUP
IN_HOUSE
LAST_GIFT_AMT
LIFETIME_AVG_GIFT_AMT
LIFETIME_CARD_PROM
153
identical
to
LIFETIME_GIFT_AMOUNT
LIFETIME_GIFT_COUNT
LIFETIME_GIFT_RANGE
LIFETIME_MAX_GIFT_AMT
LIFETIME_MIN_GIFT_AMT
LIFETIME_PROM
MEDIAN_HOME_VALUE
MEDIAN_HOUSEHOLD_INCOME
MONTHS_SINCE_FIRST_GIFT
MONTHS_SINCE_LAST_GIFT
MONTHS_SINCE_LAST_PROM_RESP
MONTHS_SINCE_ORIGIN
MOR_HIT_RATE
NUMBER_PROM_12
OVERLAY_SOURCE
PCT_ATTRIBUTE1
154
PCT_ATTRIBUTE2
PCT_ATTRIBUTE3
PCT_ATTRIBUTE4
PCT_OWNER_OCCUPIED
PEP_STAR
PER_CAPITA_INCOME
PUBLISHED_PHONE
RECENCY_STATUS_96NK
RECENT_AVG_CARD_GIFT_AMT
RECENT_AVG_GIFT_AMT
RECENT_CARD_RESPONSE_COUNT
RECENT_CARD_RESPONSE_PROP
RECENT_RESPONSE_COUNT
RECENT_RESPONSE_PROP
RECENT_STAR_STATUS
SES
155
the
TARGET_D
URBANICITY
WEALTH_RATING
156