534 Delivering Business Intelligence with Microsoft SQL Server 2005
in the training data set. The other columns show the actual value for the number of
children at home for each customer.
In Figure 14-13, the top grid shows the result for the Decision Trees mining
model. Looking at the top row in the grid, we can see that in 805 cases, the Decision
Trees mining model predicted three children at home when there were actually
three children at home. These were correct predictions. In 109 cases, the Decision
Trees mining model predicted three children at home when there were actually four
children at home. These predictions were in error.
The diagonal of the grid shows the correct predictions: predicted three with
actual three, predicted two with actual two, predicted four with actual four, and so
on. We want to have the largest numbers along the diagonal. This is the case for the
Decision Trees mining model. We already know this model was accurate. The Naïve
Bayes mining model, shown in the middle grid in Figure 14-13, does not have the
largest numbers along the diagonal. This mining model had a tendency to predict
two children at home when there were actually four children at home. This mistake
occurred 994 times during the processing of our testing data set.
Mining Model Prediction
All this training and testing has ﬁ nally gotten us to a place where we have a mining
model ready to make real-world predictions. We have seen how each of the mining
models does at making predictions; now, we can pick one and put it to work. The
Mining Model Prediction tab enables us to do just that.
Using the Mining Model Prediction tab, we can create queries that use a mining
model to make predictions. Two types of prediction queries are supported: a
singleton query and a prediction join. We look at the singleton query ﬁ rst.
A Singleton Query
A singleton query lets us feed a single set of input values to the mining model. We
receive a single value for the predictable based on these values. This enables us to
manually enter a scenario to see what the mining model will predict.
Creating a Singleton Query
For both the singleton query and the prediction join, we must ﬁ rst select the mining
model to use. When the model is selected, the Singleton Query Input dialog box
contains an input ﬁ eld for each input column in the mining model. We can then enter
values for each of these input columns.
We then select the columns we would like in the result set. The predictable
Chapter 14: Spelunking—Exploration Using Data Mining 535
column should be included in the result set; otherwise, the query isn’t doing much
for us. We can also include our own custom expressions, as desired.
When the query is designed, we switch to the result view to see the result set. We
can also switch to the SQL view to see the DMX query being created for us behind
the scenes. More on that in the section “Data Mining Extensions.” Queries can be
saved to be rerun at a later time.
Learn By Doing—Creating a Singleton Query
Creating a singleton query using the Mining Model Prediction tab
Business Need Our business need is simple. We will try out the mining model we
have worked so hard to create.
1. Open the Business Intelligence Development Studio.
2. Open the MaxMinSalesDM project.
3. If the Data Mining Design tab for the Classification - Children At Home data
mining structure is not displayed, double-click the entry for this data mining
structure in the Solution Explorer window.
4. Select the Mining Model Prediction tab on the Data Mining Design tab.
5. Click the Singleton Query button in the Mining Model Prediction tab toolbar.
This is shown in Figure 14-14.
Figure 14-14 The Singleton Query toolbar button