Using the Prediction Query Builder to Create DMX Prediction Queries

Prediction Query Builder is located in the Mining Model Prediction tab of Data Mining Designer.

The Mining Model Prediction tab provides the following screens. You can access these screens by using the list in the upper-left corner.

  • Design
  • Query
  • Result

You can design the query by using a combination of the visual tools on the Design screen and a text editor that gives you direct access to the DMX query on the Query screen. The query runs when you open the Result screen and displays the results in a grid.

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

Design

The tables Mining Model and Select Input Table(s) are at the top of the Design screen. Use these tables to select a mining model and an input table from which to create predictions. You can use any mining model in the project and any input table in the data source views. It is possible to create predictions without using an input table; instead of tying the mining model to a data source, you can feed data directly into the mining model by creating a singleton query. For more information about creating singleton queries, see Singleton Query.

To select a model, click Select Model, which opens the Select Mining Model dialog box. This dialog box contains a tree structure that lists the structures in the project and the models that are associated with each structure. Browse to the correct model, and click OK.

Use the hyperlinks that are associated with the Select Input Table(s) table to select the case table, to add a nested table, to modify joins, and to delete tables.

After you select a model and an input table, the columns that exist in both are mapped together. You can manually adjust the mappings by dragging a column name from one table to the other. You can remove a mapping between two columns by deleting the line that connects them.

Design the prediction query in the grid in the lower part of the Design screen. You can drag columns to the grid to include them in the prediction query. The grid contains the columns that are described in the following list.

  • Source
    Determines the source of the new column. Possible sources include the mining model, the input tables, a prediction function, or a customized expression.
  • Field
    Determines the specific column or function that is associated with the selection in the Source column.
  • Alias
    Determines how the column is to be named in the result set.
  • Show
    Determines whether the selection in the Source column is displayed in the results.
  • Group
    Works with the And/Or column to group expressions together by using parentheses. For example, (expr1 or expr2) and expr3.
  • And/Or
    Creates logic in the query. For example, (expr1 or expr2) and expr3.
  • Criteria/Argument
    Specifies a condition or user expression that applies to the column. You can drag columns from the tables to the cell.

After you design the query, you can either look at the DMX statement that was created or view the results.

Query

When you select the Query screen, the grid that you used to define the query is replaced by a basic text editor. Use the text editor to edit the query or to copy it to the Clipboard. If you type changes to the query in the text editor and switch back to the Design view, all the changes are lost, and the query reverts to the original query created by Prediction Query Builder.

For More Information:Prediction Queries (DMX), Mapping Functions to Query Types (DMX)

Result

Select the Result screen to display a grid of the results that are returned by the DMX query that you built on the Design screen or that you modified on the Query view. You can rerun the query by clicking Run in the lower right corner.

If the results contain a nested table, you can expand or collapse the results by using the Expand (+). You can copy the results to the Clipboard in HTML format.

See Also

Concepts

Creating DMX Prediction Queries
Singleton Query

Other Resources

Data Mining Extensions (DMX) Reference
Mining Model Prediction Tab How-to Topics

Help and Information

Getting SQL Server 2005 Assistance