Partilhar via


Singleton Query

You can configure Prediction Query Builder, in the Mining Model Prediction tab in Data Mining Designer, to easily create a singleton prediction query. Singleton queries do not require an input table; instead, a set of data is passed into the model, from which a single prediction is returned in real time. In comparison, regular prediction queries create batch predictions that are based on data that a table contains.

For More Information:Prediction Queries (DMX), Using the Prediction Query Builder to Create DMX Prediction Queries, How to: Create a Singleton Query, Data Mining Extensions (DMX) Reference

Creating Singleton Predictions

To configure the query builder to create singleton predictions, click Singleton Queries in the top left corner of the tab. This replaces the Select Input Table(s) dialog box with the Singleton Query Input dialog box. Columns are automatically mapped between the Mining Model dialog box and the Singleton Query Input dialog box, because the columns in both are derived from the same mining model.

After the new dialog box appears, you can use it to specify the data that you will use to create the query. If your model contains nested tables, click the value column for the nested table column to open the Nested Table Input dialog box. You can use this dialog box to select column states to include in the query.

For example, open the Targeted Mailing mining model in the Adventure Works DW sample database, and navigate to the Mining Model Prediction tab. After clicking the Singleton Query button, you will see the Singleton Query Input dialog populated with columns from the TM_Decision_Tree model (the first model in the structure). Consider that you want to create a query that predicts if a customer with the following characteristics would buy a bicycle from Adventure Works:

  • Age 35
  • Married
  • 2 kids at home
  • Lives within 10 miles form work

If you enter this information under the values column in the dialog, and drag the Bike Buyer column from the Mining Model dialog into the Source column of the grid, you have set up everything you need to complete the query. If you switch the results pane of the query builder you will see that this example customer is likely to buy a bicycle.

See Also

Tasks

How to: Create a Singleton Query

Concepts

Using the Prediction Query Builder to Create DMX Prediction Queries
Data Mining Concepts
Working with Data Mining

Other Resources

Data Mining Extensions (DMX) Reference

Help and Information

Getting SQL Server 2005 Assistance