User Tools

Site Tools


bicn01:dm08

Creating and Working with Predictions

Susan has trained, tested, and explored the data mining models he created. Now he is ready to use the models to identify recipients for Adventure Bikes targeting mailing campaign.

Susan will create a query to predict which customers are most likely to purchase a bike. He will also retrieve the probability that the prediction is correct, so that he can decide whether to present the recommendation to the marketing department or not.

Once he has identified customers with a high probability of purchasing a bike, he will drill through to the details of the cases in the mining model to retrieve names and contact information for these customers.

Creating the Query

The first step in creating a prediction query is to select a mining model and input table.

  • On the Mining Model Prediction tab of Data Mining Designer, in the Mining Model box, click Select Model.
  • In the Select Mining Model dialog box, navigate through the tree to the Targeted Mailing structure, expand the structure, select STM-Decision-Tree-Older-45, and then click OK.

  • In the Select Input Table(s) box, click Select Case Table.
  • In the Select Table dialog box, in the Data Source list, select Customer DataSets.
  • In Table/View Name, select the DataSet Prospective Customer table, and then click OK.

Mapping the Columns

After Susan has selected the input table, the Prediction Query Builder creates a default mapping between the mining model and the input table, based on the names of the columns.

  • Right-click the lines connecting the Mining Model to the Input Table, and select Modify Connections.

Enlarge

Notice that not every column is mapped. We will add mappings for several Table Columns.

The input table has no corresponding Age Group column. Let us create a new calculated characteristic.

In Solution Explorer, move to the DataSourceView.

  • Right-click the DataSet Prospective Customers title and select New Named Calculation.
  • In the Column name box, type Age Group.
  • In the Expression box, type
CASE
WHEN [Customer Age] <= 25 THEN 'Age under 25'
WHEN [Customer Age] BETWEEN 26 and 35 THEN 'Age between 26 and 35'
WHEN [Customer Age] BETWEEN 36 and 45 THEN 'Age between 36 and 45'
WHEN [Customer Age] BETWEEN 46 and 55 THEN 'Age between 46 and 55'
WHEN [Customer Age] BETWEEN 56 and 65 THEN 'Age between 56 and 65'
WHEN [Customer Age] > 65 THEN 'Age above 65'
END
  • Click OK.
  • Explore the data and verify that your calculation was correct.

This expression will calculate customer age group from the input table Customer Age column. Since Age was identified as one of the most influential column for predicting bike buying, it must exist in both the model and input table.

  • In Data Mining Designer, select the Mining Model Prediction tab and re-open the Modify Connections window.
  • Under Table Column, click the Age Group cell and select Age Group from the DataSet Prospective Customers from the dropdown list.
  • Click OK.

Design the prediction query

The first button on the toolbar of the Mining Model Prediction tab is the switch to Design view / switch to Query view / switch to Result view button.

  • Click the down arrow on this button,and select Design.

Enlarge

  • In the grid on the Mining Model Prediction tab, click the cell in the first empty row in the Source column, and then select Prediction Function.

Enlarge

This specifies the target column for the PredictProbability function.

  • In the Prediction Function row, in the Field column, select PredictProbability.
  • From the Mining Model window above, select and drag [Bike Buyer Flag] into the Criteria/Argument cell.
When you let go, [STM_Decision_Tree_Older_45].[Bike Buyer Flag] appears in the Criteria/Argument cell.
  • Click the next empty row in the Source column and then select STM-Decision-Tree-Older-45.
  • In the Field column, select Bike Buyer Flag.
  • In the Criteria/Argument column, type ='yes'.
  • Click the next empty row in the Source column and then select DataSet Prospective Customers.
  • In that row, in the Field column, select ID to be the Key Attribute.

This adds the unique identifier to the prediction query so that you can identify who is and who is not likely to buy a bicycle

  • Add five more rows to the grid. For each row, select DataSet Prospective Customers as the Source and then add the following columns in the Field cells:
    • Age Group
    • Customer LastName
    • Customer FirstName
    • Customer City
    • Customer Address
  • Run the query and view results

Enlarge

  • After the query runs and the results are displayed, you can review the results.

The Mining Model Prediction tab displays contact information for potential customers who are likely to be bike buyers. The Expression column indicates the probability of the prediction being correct. You can use these results to determine which potential customers to target for the mailing.

  • Have a look at the query, you have just created.
  • You could save the results in a database if you do have the correct authorization rights ;-)

We will show next, how Susan is able to use this data for a mailing campaign with Excel 2010.

bicn01/dm08.txt · Last modified: 2018/12/04 08:39 (external edit)