Dela via


Using the Prediction Query Builder to Create DMX Prediction Queries

The 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 a data mining query by using a combination of the visual tools on the Design screen and a text editor that gives you direct access to the Data Mining Extensions (DMX) query on the Query screen. To run the query, you switch to the Result view.

For More Information: How to: Create a Prediction Query, How to: Create a Singleton Query in the Data Mining Designer

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

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.

For input, you can use any tables that are available in the data source views. It is also 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.

To specify the input cases, use the options 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 have selected a model and specified an input table, the columns that exist in both tables are mapped to each other. You can manually change the mappings by dragging a column name from one table to the other; or, you can click the line that connects the columns, and modify the connections. You can also remove a mapping between two columns by deleting the line that connects them.

The grid in the lower part of the Design screen provides an area where you can build a prediction query by adding functions, columns, and expressions. 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.

You can drag columns to the grid to include them in the prediction query. Each row that you add to the grid creates a new column in the query results. For example, you might drag the following columns to the grid:

  • Source data column that contains an attribute value

  • Prediction function that returns the most likely predicted value

  • Prediction function that returns the probability associated with the most likely predicted value

  • Prediction function that returns the probability associated with the least likely predicted value

  • Custom expression that calculates the difference between two values

After you design the query, you can run the query to get results, or review and customize the DMX statement that was created.

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

Switch to Query Result view to display a grid containing the columns that are returned by the DMX query that you built. If the underlying data has changed and you want to rerun the query, click the Play button in the status bar.

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