Beta Draft: 2016-09-12

10 Predictive Query Nodes

Predictive Query nodes enable you to score data dynamically without a predefined model. Predictive Queries use in-database scoring technology.

Note:

Predictive Query Nodes require Oracle 12c Release 1 or later.

Scoring using Predictive Query nodes has the following limitations:

  • The transient models created during the running of Predictive Query node are not available for inspection or fine tuning.

  • If it is necessary to inspect the model, correlate scoring results with the model, specify special algorithm settings, or run multiple scoring queries that use the same model, then a predefined model must be created.

The output of a Predictive Query is the output of an Apply operation.

See Also:

"Apply Node Output"

There are several Predictive Query nodes:

Anomaly Detection Query

An Anomaly Detection Query node analyses the input for anomalies. That is, it detects unusual cases in data.

Note:

Predictive Query Nodes require Oracle 12c Release 1 or later.

Anomaly Detection Query can run in parallel.

Create an Anomaly Detection Query Node

You create an Anomaly Detection Query node to build an Anomaly Detection model to analyze and detect anomalous occurrences such as fraud.

To create an Anomaly Detection Query in an existing workflow:
  1. In the Components pane, go to Workflow Editor. If the Components pane is not visible, then in the SQL Developer menu bar, go to View and click Components. Alternately, press Ctrl+Shift+P to dock the Components pane.
  2. Create the Data Source node containing the input data.
  3. Expand the Predictive Query section in the Components pane.
  4. Drag and drop the node from the Components pane to the Workflow pane.
    The node is added to the workflow. The GUI shows that the node has no data associated with it. Therefore, it cannot be run.
  5. Connect the Data Source node to the Anomaly Detection Query Node.
  6. Edit the Anomaly Detection Query node.
  7. Run the Predictive Query node and view the data for a Predictive Query node.
  8. To save the results of the query, use a Create Table or View node.

Edit an Anomaly Detection Query

In the an Anomaly Detection Query Node dialog box, you can specify or change the characteristics of the models to build.

To edit an Anomaly Detection Query node:

  1. Double-click the Anomaly Detection Query node or right-click the node and click Edit. The Edit Anomaly Detection Query Node dialog box opens.
  2. In the Anomaly Detection Query Node dialog box, enter the details in the following tabs:
    • Anomaly Predictions tab:

      • In the Case ID field, select a case ID from the drop-down list (Optional). It is recommended that you specify a case ID to uniquely define each record. The case ID helps with model repeatability and is consistent with good data mining practices.

      • You can edit the outputs of an Anomaly Prediction (optional). Oracle Data Miner automatically determines the output for the query. You can modify the output.

    • Partition tab: You can perform the following tasks.

      • Add one or more Partition attributes. This is optional. Selecting a Partition attribute directs the predictive query to build a virtual model for each unique partition.

      • Select partitions. To select partitions, click the Partition tab and click add. Use the Add Partitioning Columns dialog box to select the partitions. You can also specify partitioning expressions.

    • Input tab: You can perform the following tasks:

      • Modify Input

      • Add and modify input. Click Input to add and modify input.

      • Remove input.

      • Change the mining type.

    • Additional Output tab: You can add output (optional). By default, all target columns, the Case ID column, and partitioning columns are automatically added to additional output. To make changes, click Additional Output.

  3. Click OK.

Edit Anomaly Prediction Output

Oracle Data Miner automatically selects output for query. You can select and edit the parameters of the output functions.

The default output is listed in the Anomaly Prediction Outputs section in the Anomaly Predictions tab. The defaults are:

  • Prediction

  • Prediction Details

  • Prediction Probability

You can select Prediction Set and edit parameters of the output functions. You can perform the following tasks:

  • Delete: To delete an output, select the output and click delete.

  • Add: To add an output, click add. Use the Add Anomaly Function dialog box to select an output.

  • Edit: To edit an output, either double-click the function or select the function and click edit. Use Edit Anomaly Function dialog box to make changes.

The output of a Predictive Query is the output of an Apply (Scoring) operation.

Add Anomaly Function

You can add an anomaly function in the Anomaly Function dialog box.

To add anomaly function:

  1. In the Function field, select a function from the drop-down list. The options are:
    • Prediction

    • Prediction Probability

    • Prediction Details

    • Prediction Set

  2. To specify a default name instead of using the default name, deselect Auto. This turns off automatic selection.
  3. Click OK.

Edit Anomaly Function Dialog

You can edit the anomaly function in the Edit Anomaly Function dialog box.

To edit an anomaly function:

  1. Select the change that you want to make to the function.
  2. To specify a name instead of using the default name, deselect Auto. This turns off automatic selection.
  3. Click OK.

Anomaly Detection Query Properties

In the Properties pane, you can examine and change the characteristics or properties of a node.

To view the properties of a node, click the node and click Properties. If the Properties pane is closed, then go to View and click Properties. Alternately, right-click the node and click Go to Properties.

The Anomaly Detection Query Node properties has these sections:
  • Anomaly Predictions: Displays the predictions produced by the query.

  • Partition

  • Additional Output: Displays the output specified.

  • Cache

  • Details

Anomaly Detection Query Context Menu

The context menu options depend on the type of the node. It provides the shortcut to perform various tasks and view information related to the node.

To view the Anomaly Detection Query node context menu, right-click the node. The following options are available in the context menu:

Clustering Query

A Clustering Query node returns the clusters in the input.

Note:

Predictive Query nodes require Oracle 12c Release 1 or later.

A Clustering Query can run in parallel.

Create a Clustering Query

You create a Clustering Node to build clustering models.

To create a Clustering Query in an existing workflow:

  1. In the Components pane, go to Workflow Editor. If the Components pane is not visible, then in the SQL Developer menu bar, go to View and click Components. Alternately, press Ctrl+Shift+P to dock the Components pane.
  2. Create a Data Source node containing the input data.
  3. Expand the Predictive Queries section in the Components pane.
  4. Drag and drop the node from the Components pane to the Workflow pane.
    The node is added to the workflow. The GUI shows that the node has no data associated with it. Therefore, it cannot be run.
  5. Connect the Data Source node to the Clustering Query node.
  6. Edit the Clustering Query node.
  7. Run the Predictive Query node and view the data.
  8. To save the results of the query, use a Create Table or View node.

Edit a Clustering Query

In the Edit Clustering Query Node dialog box, you can specify or change the characteristics of the models to build.

To edit a Clustering Query node:

  1. Double-click the Clustering Query node or right-click the node and click Edit. The Edit Clustering Query Node dialog box opens.
  2. In the Edit Clustering Query Node dialog box, enter the details in the following tabs:
    • Cluster Predictions tab: In the Case ID field, select a case ID from the drop-down list. The case ID is optional. It is recommended that you specify a Case ID to uniquely define each record. The case ID helps with model repeatability and is consistent with good data mining practices.

      • In the Case ID field, select a case ID from the drop-down list. The case ID is optional. It is recommended that you specify a case ID to uniquely define each record. The case ID helps with model repeatability and is consistent with good data mining practices.

      • In the Number of Clusters to Compute field, specify the number to compute. Default is 10.

      • Edit Cluster Prediction Outputs. Oracle Data Miner automatically determines the output for the query. You can modify the output.

    • Partition tab: You can perform the following tasks:

      • Add one or more Partition attributes. This is optional. Selecting a Partition attribute directs the predictive query to build a virtual model for each unique partition.

      • Select Partitions: To select partitions, click the Partitions tab. Then, click add. Then use the Add Partitioning Columns to select the partitions. You can also specify partitioning expressions.

    • Input tab: You can modify Input. This is optional. You can add or remove inputs and change the mining types of inputs. Click Input.

    • Additional Output tab: You can add outputs (optional). By default, all target columns, the Case ID column, and partitioning columns are automatically added to Additional Output. To make changes, click Additional Output.

  3. Click OK.

Edit Cluster Prediction Outputs

The output of a Predictive Query is the output of an Apply (scoring) operation.

Oracle Data Miner automatically selects output for query. The default outputs are listed in the Cluster Prediction Outputs section in the Cluster Predictions tab. The defaults are:

  • Cluster Details

  • Cluster Distance

  • Cluster ID

  • Cluster Probability

You can also select Cluster Set, and edit parameters of the output functions. You can perform the following tasks:

  • Delete: To delete an output, select the output and click delete.

  • Add: To add an output, click add. Use Add Cluster Function dialog box to select an output.

  • Edit: To edit an output, either double-click the function or select the function and click edit. Use the Edit Cluster Function dialog box to make changes.

Add Cluster Function

In the Add Cluster Function dialog box, you can add cluster functions. To add Cluster function:

  1. In the Function field, select a function from the drop-down list. The options are:
    • Cluster ID

    • Cluster Probability

    • Cluster Details

    • Cluster Distance

    • Cluster Set

  2. To specify a default name instead of using the default name, deselect Auto. This turns off automatic selection.
  3. Click OK.

Edit Cluster Function

To edit Cluster function:

  1. Select the change that you want to make to the function.
  2. To specify a name instead of using the default name, deselect Auto. This turns off automatic selection.
  3. Click OK.

Clustering Query Properties

In the Properties pane, you can examine and change the characteristics or properties of a node.

To view the properties of a node, click the node and click Properties. If the Properties pane is closed, then go to View and click Properties. Alternately, right-click the node and click Go to Properties.

The Clustering Query Properties pane has these sections:

  • Cluster Predictions: Displays the predictions produced by the query.

  • Partition

  • Additional Output: Displays the output specified.

  • Cache

  • Details

Clustering Query Context Menu

The context menu options depend on the type of the node. It provides the shortcut to perform various tasks and view information related to the node.

To view the Clustering Query node context menu, right-click the node. The following options are available in the context menu:

Feature Extraction Query

A Feature Extraction Query extracts features from the input.

Note:

Predictive Query nodes require Oracle 12c Release 1 or later.

A Feature Extraction Query node can run in parallel.

Create a Feature Extraction Query

You create a Feature Extraction Query note to extract features from the data source or input.

To create a Feature Extraction Query to an existing workflow:

  1. In the Components pane, go to Workflow Editor. If the Components pane is not visible, then in the SQL Developer menu bar, go to View and click Components. Alternately, press Ctrl+Shift+P to dock the Components pane.
  2. Create a Data Source node containing the input data.
  3. Expand the Predictive Queries section in the Components pane.
  4. Drag and drop the node from the Components pane to the Workflow pane.
    The node is added to the workflow. The GUI shows that the node has no data associated with it. Therefore, it cannot be run.
  5. Connect the Data Source node to the Feature Extraction Query node.
  6. Edit the Feature Extraction Query node.
  7. Run the Predictive Query node and view the data.
  8. To save the results of the query, use a Create Table or View node.

Edit Feature Extraction Query

In the Feature Extraction Query Node dialog box, you can specify or change the characteristics of the models to build.

To edit a Feature Extraction Query Node:

  1. Double-click the Feature Extraction Query node or right-click the node and click Edit. The Edit Feature Extraction Query Node dialog box opens.
  2. In the Feature Extraction Query Node dialog box, enter the details in the following tabs:
    • Feature Predictions tab:

      • In the Case ID field, select a case ID from the drop-down list. The case ID is optional. It is recommended that you specify a case ID to uniquely define each record. The case ID helps with model repeatability and is consistent with good data mining practices.

      • In the Number of Features to Extract field, specify an input. The default is 10.

      • Edit Feature Prediction Outputs. Oracle Data Miner automatically determines the output for the query. You can modify the output.

    • Partitions tab:

      • Add one or more Partition attributes. This is optional. Selecting a Partition attribute directs the predictive query to build a virtual model for each unique partition. To add partitions, click add in the Partitions tab. Use the Add Partitioning Columns dialog box.

      • Specify partitioning expressions.

    • Input tab: You can perform the following tasks:

      • Add input

      • Modify input

      • Change the mining type

    • Additional Output tab: You can add output. This is optional. By default, all target columns, the Case ID column, and partitioning columns are automatically added to Additional Output. To make changes, click Additional Output.

  3. Click OK.

Edit Feature Prediction Outputs

The output of a Predictive Query is the output of an Apply (scoring) operation. Oracle Data Miner automatically selects output for query. The default output is Feature Set. You can also select feature ID, feature details, and feature value. You can edit the parameters of the functions and perform the following tasks:

  • Delete: To delete an output, select the output and click delete.

  • Add: To add an output, click add. Use the Add Feature Function dialog box to select an output.

  • Edit: To edit an output, either double-click the function or select the function and click edit. Use the Edit Feature Function dialog box to make changes.

Add Feature Function

To add a Feature Function:

  1. In the Function field, select a function from the drop-down list. The options are:
    • Feature ID

    • Feature Value

    • Feature Details

    • Feature Set

  2. To specify a default name instead of using the default name, deselect Auto. This turns off automatic selection.
  3. Click OK.

Edit Feature Function

To edit a Feature Function:

  1. Select the change that you want to make to the function.
  2. To specify a name instead of using the default name, deselect Auto. This turns off automatic selection.
  3. Click OK.

Feature Extraction Query Properties

In the Properties pane, you can examine and change the characteristics or properties of a node.

To view the properties of a node, click the node and click Properties. If the Properties pane is closed, then go to View and click Properties. Alternately, right-click the node and click Go to Properties.The Feature Extraction Query properties enables you to view and change information about this Predictive Query node. If the Properties pane is closed, then go to View and Properties. Alternately, right-click the node and click Go to Properties.

The Feature Extraction Query Properties has these sections:

  • Feature Predictions: Displays the predictions produced by the query.

  • Partition

  • Additional Output: Displays the output specified.

  • Cache

  • Details

Feature Extraction Query Context Menu

The context menu options depend on the type of the node. It provides the shortcut to perform various tasks and view information related to the node.

To view the Feature Extraction Query node context menu, right-click the node. The following options are available in the context menu:

Prediction Query

A Prediction Query node performs classification and regression using the input.

The data type of the target determines whether classification or regression is performed. A Prediction Query can run in parallel.

Note:

Predictive Query nodes require Oracle 12c Release 1 or later.

This section on Prediction Query node contains the following topics:

Create a Prediction Query

You create a Prediction Query node to perform the data mining functions Classification or Regression on the input data, depending on the type of input data.

To create a Prediction Query in an existing workflow:

  1. In the Components pane, go to Workflow Editor. If the Components pane is not visible, then in the SQL Developer menu bar, go to View and click Components. Alternately, press Ctrl+Shift+P to dock the Components pane.
  2. Create a Data Source node containing the input data.
  3. Expand the Predictive Queries section in the Components pane.
  4. Drag and drop the node from the Components pane to the Workflow pane.
    The node is added to the workflow. The GUI shows that the node has no data associated with it. Therefore, it cannot be run.
  5. Connect the Data Source Node to the Prediction Query Node.
  6. Edit the Prediction Query node.
  7. Run the Predictive Query node and view the date.
  8. To save the results of the query, use a Create Table or View node.

Edit a Prediction Query

In the Edit Prediction Query Node dialog box, you can specify or change the characteristics of the models to build.

To edit a Prediction Query node:

  1. Double-click the Prediction Query node or right-click the node and click Edit. The Edit Prediction Query Node dialog box opens.
  2. In the Edit Prediction Query Node dialog box, enter the details in the following tabs:
    • Predictions tab:

      • In the Case ID field, select a case ID from the drop-down list. The case ID is optional. It is recommended that you specify a case ID to uniquely define each record. The case ID helps with model repeatability and is consistent with good data mining practices.

      • In the Targets section, you can add one or more targets. To add target, click add. Use the Add Target dialog box to define targets.

      • In the Targets section, change the Mining Type of a target, if necessary. Each attribute has an associated data type and mining type. The mining type defines how the attribute is treated in the predictive query. For Regression query analysis, the mining type must be Numerical. For Classification query analysis, the mining type must be Categorical. If you make changes, click OK.

      • In the Prediction Output section, you can edit the prediction output. Oracle Data Miner automatically determines the output for each target. You can modify the output.

    • Partition tab: You can perform the following tasks:

      • Add one or more Partition attributes. This is optional. Selecting a Partition attribute directs the predictive query to build a virtual model for each unique partition. To add partitions, click add. Use the Add Partitioning Columns dialog box to select partitions.

      • Specify partitioning expressions.

    • Input tab: You can perform the following tasks:

      • Modify input

      • Add or remove inputs

      • Change mining types of inputs

    • Additional Output tab: You can add outputs (optional). By default, all target columns, the Case ID column, and partitioning columns are automatically added to Additional Output. To make changes, click Additional Output.

  3. Click OK.

Add Target

You must add at least one target. Targets can have different mining types.

To add a target:

  1. Select one or more attributes in the Available Attributes list to serve as prediction targets. The targets do not have to have the same data type.

    You can select nested attributes as targets if they are of type ODMR_NETSTED_*. For example, you could use a join to create a nested attribute consisting of all products purchased by a customer; this attribute would be nested and have the data type ODMR_NESTED_VARCHAR2.

  2. Move the target columns to the Selected Attributes list using the arrows.
  3. Click OK. The selected attributes are added to the Targets list.

Add Partitioning Columns

Partitioning columns result in building a virtual model for each unique partition. Because the virtual model uses data only from a specific partition, it can potentially predict cases more accurately than if you did not select a partition.

In addition to selecting attributes, you can specify partitioning expressions. Partitioning expressions are concatenated and the result expression is the same for all predictive functions.

  1. Select one or more attributes in the Available Attributes list to serve as partitions.
  2. Move the selected columns to the Selected Attributes list using the arrows.
  3. Click OK. The attributes are moved to the Partition list.

Optionally, you can add partitioning expressions.

Add Partitioning Expressions

Use Expression Builder to create an expression.

To specify a partitioning expression, click specify partitioning expression.

Suppose one of the partitions is AGE. Here is a sample partitioning expression:

CASE WHEN AGE < 20 THEN 1
     WHEN AGE >=20 AND AGE < 40 THEN 2
     WHEN AGE >=40 AND AGE < 60 THEN 3
     ELSE 4
  END

Suppose this expression is named Expression_1. After you run the node, the output includes a column titled Expression_1. This column will contain the value 1 if AGE is less than 20, 2 if AGE is 20 or larger but less than 40, and so forth.

See Also:

"Expression Builder"

Edit Prediction Output

The output of a Predictive Query is the output of an Apply (Scoring) operation. Oracle Data Miner automatically selects output for the target. The default output is listed in the Prediction Outputs section in the Predictions tab.

  • For Classification, the default output are:

    • Prediction

    • Prediction Details

    • Prediction Probability

    You can also select Prediction Set.

  • For Regression, the default outputs are:

    • Prediction

    • Prediction Details

For Classification or Regression, you can edit the parameters of functions and the output for each target one at a time. You can perform the following tasks:

  • To edit Prediction Output Function, select a target and click edit. You edit output for each target one at a time. Use the Edit Prediction Function dialog box to make changes.

  • To delete an output, select the output and click delete.

  • To add an output, select the target in the Targets section and click add. Use the Add Prediction Output Function dialog box to select an output.

See Also:

Add Prediction Output Function

To add Prediction Output Function:

  1. In the Function field, select a function from the drop-down list.
  2. To specify a default name instead of using the default name, deselect Auto. This turns off automatic selection.
  3. Click OK.
Edit Prediction Function Dialog

To edit Prediction Function:

  1. Select the change that you want to make to the function.
  2. To specify a name instead of using the default name, deselect Auto. This turns off automatic selection.
  3. Click OK.

Modify Input

The Input tab shows all columns that are used as input for the Predictive Query.

Target (for Prediction Query) and Case ID columns are identified with special icons. The Rule column in the grid explains why an attribute is not used.

By default, Determine inputs automatically (using heuristics) is selected. After you run the node, you can click the link to View Heuristic Results Details. To change the inputs, deselect Determine inputs automatically (using heuristics). You can perform the following tasks:

  • Override defaults, and add or remove input columns.

  • Change Mining Types: To change the mining type of a column, click the Mining Type entry for the column, and select a new mining type from the drop-down list.

  • Ignore columns: If you do not want to use a column as input, click the Input entry for the attribute and select ignore from the drop-down list. It ignored the selected column, and not used for input. To use a column, select include from the drop-down list.

  • Search column: To search for columns, use the Find field.

View Heuristic Results Details

The View Heuristic Results Details dialog box provides detailed information about automatic changes made to the input.

For example, the mining type is changed to Categorical when the number of unique values is less than the threshold value of 5. A column that has a constant value is excluded (not used as input).

Add Additional Output

The Output tab shows the columns that will be used in the output to identify the prediction data.

By default, all target columns for Prediction Query, the Case ID column, and partitioning columns are automatically added to Additional Output. You can perform the following tasks:

  • Add Additional Output: To add additional output, click Automatic to turn off automatic selection. Then click add. Use the Add Supplemental dialog to add columns to the output.

  • Remove Output Columns: To remove columns, select the column and click delete.

Add Supplemental Dialog

In the Add Supplemental dialog box, you can include or exclude columns to be used in the output for a Prediction Query.

Select the columns and use the arrows to move them from the Available Attributes list to the Selected Attributes list.

Run Predictive Query Node

You must run a Predictive Query node to view the data.

To run Predictive Query nodes, right-click the node and select either Run or View Data. Virtual models may take a while to be formulated. The View Data option generates a small sample output of the query.

Regardless of how you run it, select View Data to view the results of the query.

View Data for a Predictive Query

For Predictive Query Nodes, the View Data viewer displays the output from a node is run. It also displays the results when the query is applied to a small subset of the data.

The Predictive Query node must be run successfully.
To view data for a Predictive Query node:
  1. Right-click the node and select View Data.
  2. You can either sort or filter the data.
  3. Click OK.

You can view prediction details to see Prediction Details in a separate window.

View Prediction Details

To view the prediction details:

  1. Click the details that you want to view.
  2. Then, click view prediction details. The details are displayed in the View Value dialog box. You can also search for specific values.

Prediction Query Properties

In the Properties pane, you can examine and change the characteristics or properties of a node.

To view the properties of a node, click the node and click Properties. If the Properties pane is closed, then go to View and click Properties. Alternately, right-click the node and click Go to Properties.

The Prediction Query Node Properties has these sections:

  • Predictions: Displays the predictions produced by the query.

  • Partition

  • Additional Output: Displays the output specified.

  • Cache

  • Details

Prediction Query Node Context Menu

The context menu options depend on the type of the node. It provides the shortcut to perform various tasks and view information related to the node.

To view the Prediction Query node context menu, right-click the node. The following options are available in the context menu: